Why does one leg of my panel drop to 0v and the other rise to 240v when a load is connected?

Question: I have red/black/white cable coming into barn to breaker box from main panel at house.  With a tester to neutral bar each leg reads 120v and if two hot legs are tested, 240v.
I have a 20 amp breaker that goes to a timer that control a series of lights.  When I turn on breaker for the lights, which are wired correctly,  one hot leg drops to 0v and the other leg reads 240v when tested to neutral bar.
I have another breaker to outlet plug that reads fine until I energize the breaker for timer then it too loses voltage because of timer motor somehow shifting all volts to other leg.  I've replaced timer with new brand new timer / replaced breaker with new one.  I've even run extension cord to lights directly and bypassing breaker box and they work fine if timer/breaker box is bypassed.
Any suggestions where to look?
Comment: Do you have a bare or green ground wire in the cable as well?
Answer: It sounds like you have a loose, broken, or disconnected neutral at some point.
Double check all terminations are tight, and contact the conductor, not the insulation.
Also check that you have the correct earthing/bonding methods. Do you have an earth/ground wire back to the house?
If so, you need a separate earth and neutral bar, with each wire connected to the correct bar, and no link between them.
If not, you need an earth electrode connected to the earth bar, the incoming neutral connected to the neutral bar, and a link between the two.*
* I believe the NEC no longer allows this approach; I'm not familiar with US code. It may be grandfathered in.
Comment: His installation may be grandfathered in,  it is certainly not permissible now, **and OP's situation is why**.  Not only are all the neutrals being lit up at 120V, so are all the grounds! Don't touch one and expect not to be shocked!  Really they are 't even grounds in any proper sense.
Comment: @Harper Not that the incoming feed to the house is wired in exactly the same way...
Answer: The feeder neutral's toast
The wild voltage fluctuations you are seeing are due to a feeder neutral wire that cannot handle any significant current (effectively open).  When this happens, applying a load to one leg causes the voltage across that leg to drop and the voltage across the other leg (an unloaded leg in your case, which explains the extreme magnitude of shift you see) to rise, due to the loads on the two legs forming a voltage divider.
In your situation, I would undo and redo the connections at each end of the neutral with the house breaker for this feeder off, torquing the connections screws properly at each end.  If that does not correct the issue, then you will need to re-lay the cable, or use a small dry-type distribution transformer at the barn (something in the 5kVA range would be plenty adequate) to provide a new neutral point for this feeder.


test vectors for 3DES seem to in fact be testing DES - not 3DES

Question: NIST SP 800-20 Appendix A has what presumably are supposed to be test vectors for 3DES except almost all of the test vectors utilize 8-byte keys and not the 24-byte keys that 3DES is supposed to have. See, for example, table's A.2, A.3, A.4, A.8 and A.10. So what's the point? These test vectors don't seem like they're testing what they ought to be testing.
Comment: Did you confuse bits and bytes? DES has a 56/64 bit key and 3DES has a 168/192 bit key.
Answer: It is for the 1st version of 3DES which is only using the same key three times (3DES-EDE1)
Which is equivalent to DES (I think they did that so you could use 3DES to exchange with someone using DES).
There are 3 different versions (or ways of using DES). EDE3 is the strongest with 3 different keys being used.


Is it worth it to take the Wild Wasteland trait in Fallout New Vegas?

Question: I know that this trait adds some more fun to the game but other than that?
Answer: According to the wiki, there are a number of otherwise unattainable encounters that you can experience if you have the Wild Wasteland trait, including some in the DLCs.
Number of Wild Wasteland Encounters:

"Core" game - 22
Dead Money - 3
Honest Hearts - 2
Old World Blues - 11
Lonesome Road - 4

These feature references to many popular movies/TV:

Star Wars
Indiana Jones
Lassie

Notable Loot:

Alien Blaster (and 100 shots)

Unattainable Loot:

YCS/186 unique Gauss Rifle is not available if you have the Wild Wasteland perk (as it is replaced by the Alien Blaster)

Is it worth it? That's something only you can decide.
Comment: @AdamArold the unique Gauss Rifle can be repaired using normal gauss rifles, or at vendors that offer that service, or by a weapon repair kit, or by other means if you have the Jury Rigger perk. The Alien Blaster - although it can be repaired, has a limited number of shots, because the ammo cannot be purchased or (to my knowledge) built.
Comment: If I get it right I will have just one YCS/186 unique Gauss Rifle so I won't be able to maintain/repair it anyway and it will blow up eventually, right?
Answer: You can read up on the specifics of the trait on the Fallout Wiki article.
The biggest difference is trading the unique Gauss Rifle for a unique Alien Blaster. I think the Alien Blaster uses special ammo that you only find a very limited supply of while the Gauss Blaster uses MF cells. The Alien Blaster is pretty ridiculous though, zero spread and every shot is a critical. You also miss out on a few mini-nukes.
If you want the perk, get it for the humor. IMO it far outweighs the (fairly minor) gameplay changes, which I'm sure is intentional. It's basically one gun difference, plus a few mininukes, and if you're like me you never even use "too good to use" consumable items like that anyway.
Comment: The mini-nukes are replaced in Wild Wasteland by the Holy Frag Grenades: http://fallout.wikia.com/wiki/Holy_Frag_Grenade
Answer: In my experience, if you are the kind that would like/love a good laugh at times, it would be worth it.
Otherwise I don't recommend it considering that
unique YCS/186 Gauss Rifle is replaced with Alien Blaster when you have this perk.
Note:
If you do get the perk, you can get one then the other with console codes on the PC, that would be the only way to get both, considering I have both.
To acquire both of the weapons (and extra ammo for the Alien Blaster), you can use player.additem item_base_id_here command.
Fallout wiki articles have the "item codes" ("base id") :

YCS/186 Gauss Rifle - 0015b38d.
Alien Blaster - 00004322
Alien power cell (ammo for the blaster) - 00029364
Comment: I don't mind circumventing stupid limitations so I would definitely use the console thanks!
Comment: @AdamArold I've added more info on how exactly use can obtain these weapons (and APC for blaster) to the answer.
Answer: I never take it. The Ycs/186 is far more versatile especially outside of vats and with the inclusion of max charge ammo. One to two sneak crits will kill every legendary creature in the game. You can also use scrounger and the brotherhood ammo reward crate in hidden valley to get 100+ ammo every few days. It is the ultimate sniper platform in the game and the unique laser pistol Pew Pew with the high crit chance attainable for laser weaponry through perks and challenges is comparable to the Alien Blaster in terms of killing power.
Answer: simply put, "wild wasteland" tickles your wrinkled little brains, while it's absence does not. Either way, you'll eventually be an overpowered demi-god, so an additional char buff perk doesn't ultimately add nuff.
Some use the YCS as an argument...well, the gun is nothing much, really. The .50 is better in terms of rate of fire, explosive ammo option, 'friendly' scope and suppression.
The trait adds content. A DLC of sorts, but without the 'D' So why not. You'll still kick ass. FFS, Vegas is accessible on level 1 and you're being picky about some damn trait as if it's a life-and-death matter.
Comment: This answer adds nothing not covered in more detail, aside from complaining about the question.
Comment: These are actually good points, even if the tone could be friendlier. You can beat this game with a 10mm pistol if you want. I've done it without killing *anyone*.
Answer: Well there's a glitch that allows you to use any ammo for the alien blaster so its definitely worth it. equip a weapon you have alot of ammo for and hold the hot key button dont let go goto ammo and equip that ammo under a hot key and boom more then 100 bullets for the alien blaster
Answer: I think the trait is good if you like to have a good time and don't care about the serious tone that immerses you into the game. I f you want to play the game properly and complete the main mission and all, then the trait might not be for you. But if you don't really care about the quests and just want to wander the mojave to just see what you stumble across, then you might want it.


Why teilnehmen AN?

Question: I learn German and I don't get it. As I know, 'an' is usually used when we say that something is near a vertical surface (das Bild hängt an die Wand). And in english, polish, russian and ukrainian we have take part in. So I wonder what's the origin of the word that caused it to go with 'an', not 'in'.
Comment: When you learn languages, you soon will find, that neither comparing with other language, nor logic thinking might help to understand. Sometimes you just have to accept how it is, and learn it.
Comment: What is your question - why you should use "an" with "teilnehmen" or what is the origin of "teilnehmen"?
Comment: I fully support Hubert's answer ("Don't ask, just use it!") because asking "why" with regard to language usage is often leading to nowhere. However, actually thinking about it, I start wondering myself: why is it *teilnehmen **an** etwas* and not *teilnehmen **von** etwas* - as *nehmen* would imply that you *take* something, and this should be *von*, in that case...
Comment: @ChristianGeiselmann Interesting that "teilhaben", "patizipieren" and "beteiligt sein" also need the "an".
Comment: Grimms only say that it is with genitive in Old High German, but not when the use with *an* arose.
Comment: @ChristianGeiselmann *auf* Französisch sagt man das doch auch so, *participer de*, w.i.m.r.e. Auch der großartige Künstler Fler sagte eins im Interview  "... davon kann ich doch partizipieren", woraufhin ich laut auflachen musste.
Answer: "An" is in no way limited to the meaning of the English "at" (or similar relation-to-surface prepositions in other languages). See the following examples:

an etwas denken - to think of / about something
an etwas arbeiten - to work on something
sich an etwas erinnern - to remember _ something
sich an etwas gewöhnen - to get used to something
an etwas leiden - to suffer from something
And of course: an etwas teilnehmen - to participate in something

Technically, yes, "an" has the general meaning of "being close or attached to something". But it requires some serious mental gymnastics to fit all these examples to this pattern, doesn't it?
This is why all these prepositions are part of their dictionary entries in the first place. They are mere conventions of how to use these verbs - they don't necessarily have a logical connection that could be inferred on the fly. Many do, of course, but I advise to always assume that any particular verb goes with a particular preposition by pure chance and you save yourself a lot of headaches.
-> Assume that "an etwas teilnehmen" had the same chance to exist like "in etwas teilnehmen", and the German language community simply flipped their coin differently than the English language community, without any specific reason. You have to learn the correct German preposition(s) for each verb from scratch.
Answer: If you see it figuratively, and this is what I visualize in my mind's eye, you sit AT a table with your participators. This means "Anteil haben" or "teilhaben an". See also here.
Comment: BTW: I even wonder why other languages use *in* because the thing to participate usually isn't in a box or something ;)
Comment: you should move that addendum to your answer :)
Answer: Prepositions have no logic.

Sie nimmt über Weihnachten unter Protest an einer Konferenz über Wohlstandsmüll in Bitterfeld teil.

We can only guess an is used for the meeting you attend because there may still be a place in the sentence where that meeting is held – that one gets the in. Not that it would stop us:

Im Einkaufszentrum in der Stadt gab es im September in der Feinkostabteilung schon Glühwein zu kaufen.

→ There is no logic.
Comment: "Im Einkaufszentrum der Stadt gab es September schon Glühwein von der Feinkostabteilung zu kaufen"--besser? Das erste Beispiel ist komplizierter. Die Wendungen sind historisch gewachsen. Da die Frage unter Etymologie läuft, hilft es wohl niemandem zu sagen, darin läge keine Logik, nur weil diese nicht offensichtlich ist.

Why teilnehmen AN?


What does "you're every song" mean?

Question: What does "you're every song" mean?
http://www.metrolyrics.com/everything-lyrics-michael-buble.html
Answer: The song describes the woman as everything that is good in the world. Songs are good. In fact as a singer songs are really good because that is his job. So all the songs he sings are for her. And most songs are about love in which case they are probably about her too. And she is as important to him as all the songs. Something like that maybe.

What does "you're every song" mean?


How to change the email recipient for contact form

Question: On a Drupal 8 site, I have a content type called TeamMember which has an email field.  From the view where I show all the TeamMembers, I'd like to link to a form where the user can email that person directly.  Is there a way to customize the recipient of the email from a contact form?
Answer: What we do in a few places is to have a hidden reference field to the team node in your contact message entity.
Then you pre-fill that when displaying the contact form and later on in hook_mail_alter(), use that information to change the recipient.
Requires a bit of custom code but then you don't have to create a lot of contact forms.
Comment: In my opinion this is also the only solution for creating forms with different recipients depending on the selected message subject.
Answer: Contact forms in D8 don't have customizable recipients out of the box so you're going to need some sort of workaround.
A couple of paths that you could take:

Treat your TeamMember not as Node entities, but as User entities. Use their profile page (/user/X) as the content page and use the personal contact form (/user/X/contact) as the per-TeamMember contact form.
Keep the TeamMember, but create a unique contact form for each TeamMember. On the TeamMember node type, create a Link field that links to each unique contact form you've built.


How can I seal the gap around a valve handle in drywall?

Question: I have a valve under my kitchen sink that controls the water at my outdoor spigot, and I was unable during a kitchen remodel to fully seal this area leaving an opening in the drywall around the valve. I'd like to close this off to prevent bugs and critters from making it in through this opening, but I also need to be able to move the valve on and off (90 degrees up from its current position). Any creative ideas from folks? Thank you in advance!

Click for full-size original
Comment: If there are bugs and critters inside your walls, this is not where you need to be worried about sealing - it's the **outside** shell of the house that has integrity problems.
Comment: Do you operate this valve seasonally, or only when doing repairs?
Answer: There are ball valve stem extensions available, or you can make your own fairly easily.
Extend the stem about 1/2".  Now get a standard low voltage wall opening kit with expanding wings.  Cut the drywall and put the wall opening kit in.  Now get a regular blank plate and drill a hole in it to go around the stem extension.
Put the wall plate on, and then screw the handle of the ball valve onto the stem extension.
@jay613 suggests adding a foam washer under the handle to help seal things up, and I think that this is a good suggestion.
Comment: Add the foam washer to the answer and I'll vote it.   Only because the objective here is mainly peace of mind, the perception of excluding insects.  I'm familiar with the mentality and you can never do too much.  I also like using the low voltage box to provide *better* access to maintain the valve than OP already has, and avoiding packing the valve stem with gunk.
Comment: Nice. I like coax jack plates for this. They have nice round holes in them already. A foam washer under the handle could help seal things.
Answer: How about a split flange, they come in different sizes.  You could pack the opening with steel wool or insulation to seal the hole.
Comment: Looks like the valve may be too recessed for this solution without the stem extension that gbronner mentions.
Answer: Cut a piece of tube from toilet paper roll (the center) and put it around the handle rod.
Foam gun/caulk gun with silicone around it.
The cardboard may or may not be possible to remove - try it.
You will have a nice round hole, and the filling can be removed if valve needs to be replaced some day.
Answer: I'm in agreement with Thomas regarding the use of caulk or "foam & fill" [expanding cyanoacrylate], but…
I'd first take the handle off, grease the mechanism heavily so no foam & fill will stick to it, then use a longer piece of tube than you need to end up with, for two reasons

Foam & fill always overspills more than you think it will.
It would give you something to grip to keep it steady as it dries.

Cut back when dry & replace handle.


How to not lose focus after each disruption in flow

Question: I have observed that whenever I'm studying something, or solving an assignment, whenever I would hit a question which I am unable to solve or is taking too long for me to do, my mind wanders away from that task, no matter how urgent or important my current task is. I would maybe end up surfing the net, or thinking about a conversion ,etc. I end up wasting 15-20 minutes of my time . This is very frustrating. How can I curb this problem ??
Comment: This isn't enough information for a diagnosis, but consider getting screened for ADHD. I spent four years trying to "try harder" and hitting walls before getting diagnosed, and I can confirm that no advice will help very much if you have that and don't act against it specifically (with therapy or treatment or both).
Comment: Avoid reading Academia.SE and other SE sites for too long.... :-(  If only it were so easy!
Answer: A very simple solution, that might work, and is worth a try. When you reach such a block, jot a note to yourself that captures the problem or the crux. Then get up from your desk and take a ten minute or so walk. Get your blood moving a bit and break the flow explicitly. Take the note and a pencil/pen, so that you can write ideas that might occur.
You may find that the solution will come to you, but at least, the break may help to clear your mind of the reason you may be pursuing the wrong solution.
This won't work for everyone, of course, but it is a painless way to experiment.
Oh, and don't be checking your phone on the walk or texting, or ... It might even be best to leave it behind since you will only be away for a few minutes.
Answer: Try to print out your assignment and the relevant notes. Keep all tech (laptop/phone) out of reach.
I'm sure you catch yourself visiting a website or checking your messages, not consciously remembering when you stopped working. Breaking this habit will require training your brain to focus for longer periods of time. Having physical copies of your work helps with that. If that's not possible, download a program called SelfControl, it allows you to blacklist websites for a set amount of time.
Also, remember to take breaks and get exercise. It will help with maintaining focus.
Comment: additionally also a very important aspect is, to get enough fresh air and to drink enough water to be more concentrated
Answer: This is quite common. There are few things to consider. Possibility of ADHD is one of them. More on that is left for medical proffesionals. Other things to consider,

almost every piece of digital content you consume is designed to catch your attention. Companies often use incredibly sophisticated deisgn choices to abuse the human element, very often in a similar fashion to what casinos do. Getting rid of all electronics would probably help. Getting paper copies, going to a corner of the library, with no (including a smartphones) electronics possibly can improve your concentration.

similar to Erik's comment about exercise, you should try to supply your body with its basic needs (if you weren't). A healthy dose of exercise, healthy diet or social interactions usually help me.

your mind is not your slave. You can't force it to work or concentrate. This is one of the reasons why cramming often does not work. You have to negotiate with yourself.

compartmentalizing also help some people. Obvious example would be to change the room when you want to study. Get to a desk different than the one you surf the web. It can be in a library, a university working hall or even some picnic table. I sometimes even go and work on the dining table in the kitchen.

Another tactic might be to "abuse" your sense of shame. For example, if you go to your library and start to procrastinate, you might feel being judged by the others. Hence it might be a good way to control yourself. Going to your department's communal areas might work better if you are more "afraid" of "judgement" from your proffesors / colleagues.
It is not likely that every single one of these will work for you. These are the tricks I use or see other people use. I hope it helps a bit.
Answer: Boaty McBoatface's suggestions are excellent, but I disagree with getting rid of all electronics. Struggling with distraction will not go away after university, and often your work will require that you are online. Here is what works for me:

Make yourself accountable to another person. This is a permutation of Boaty's "sense of shame" suggestion. You can have a study partner, or a significant other who asks you how focused you were during your study session. Working in the same room as someone else, with them able to see your screen, can be very helpful as long as this person is not a distraction in and of themselves.
From consulting: track your hours at the end of the day. It is incredibly depressing to have to stay late at work because you spent an hour on Wikipedia. If you were to be charging someone for your study time, could you reasonably charge them for 7.5 hours of work? Does the product (notes, knowledge, flashcards, etc.) reflect that? The simplest way to do this would be a spreadsheet.
Be honest with yourself. Can you focus with music playing? Can you focus with a 15-minute facebook break every two hours, or does this balloon into a 15-minute break every 30 minutes? No? Then set hard controls on your access to these distractions. Try removing access to music, or using a browser extension such as StayFocusd.
Others' suggestions that are vital: sleep, eat, exercise, make dedicated time for social engagement, and leave your phone out of reach if you don't need it.
Lastly, if this is a serious problem, ask a doctor about being tested for ADHD. I've been putting that off indefinitely... Mostly because of distractions like Stackexchange!

Good luck on that exam.
Answer: Your mind can only focus for so long before it needs a break. This is completely natural. Eliminating sources of distraction will only help so much, and if you can't eliminate them all the time, they will be even more distracting when they are available. If you notice it happening a lot, you may be burnt out and need a real break, or you may have an attention disorder that a doctor may be able to help with.
There is no "magic pill" or single solution to fixing this, and some options are harder than others to enact.
Others have already mentioned good options that work for me as well, so I don't repeat them. Some things that are miss are:

Simply realize you are off topic and get back to work. If you struggle to do so, you need a real break.
Close your eyes and take a few deep breaths, maybe take a few sips from your drink, maybe a bite or two from a snack, and refocus. (This really is different than the suggestion above.)
Try to realize your mind staring to wander before it gets very far and refocus on your work.
Open floor plans in offices and libraries are full of distractions and we are finding people actually like cubicles at work. If you can, move to a location where physical/real life distractions are minimized. This includes getting away from the kids, laundry, dishes, dusting, mowing the lawn, etc.
If you work from home, take a walk or drive around the block when you "go to work" and "come home", which may include entering a different door than you left. This helps to disassociate your home life from your work life, even when it's in the same building and helps to remove the distractions of home life listed and hinted at in the previous bullet point.
Finish out the train of thought that distracted you so you don't rehash it again later, then refocus.
Take a note of the topic that got you distracted so you can consider looking at it later, when you aren't working or studying, and refocus.
Schedule regular, real breaks every 1-2 hours so that unscheduled breaks happen less frequently.

And last but not least:

Close StackExchange when you aren't actively using it.

FYI, even when you aren't actively working on something, your subconscious mind still is. That's why you can wake up in the middle of the night with "the answer" to a question you struggled all day and it'll be "so obvious". This can happen at any time. Sometimes I will purposely take a break from a tough project so that my subconscious can take over. This works especially well when you "hit a wall". When that obstacle seems insurmountable, sometimes you can beat your head against it until you overcome it, and sometimes you need to walk away and let it crumble away on it's own. Sometimes you can even just get a fresh perspective from leaving it for a while. Breaks definitely have their uses.
Answer: As a variation on Buffy's answer, set a timer for a maximum of about half an hour - say 25 minutes. When the time is up, STOP WORKING, physically get up and do something else for 5 minutes, then reset the timer for another 25 minute work session and repeat.
You will gradually condition yourself not to give up or get distracted before the timer "gives you permission."
If you can't keep working for a 25 minute period, even when you know the timer is going to "tell you to stop" at the end of the time interval, that would suggest there is some underlying cause that needs professional diagnosis.
Once this technique is working for you, you might want to increase the length of the work periods - but you may find that regular short breaks every half hour are more productive than one long session anyway, and you don't need to use the timer to maintain that working pattern.


Excel file downloads instead of displaying in iframe

Question: I have this in my controller class:
    public ActionResult ExcelDoc()
    {
        var doc = Server.MapPath("~/Content/Sheet1.xlsx");
        return File(doc, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
    }

And in my view:

It simply DOES NOT display the file in the iframe. Instead, it begins downloading sheet1.xlsx as ExcelDoc.xlsx. Very frustrating as previous questions have helped me to develop this solution to my previous problem of trying to display a dynamically generated excel file in an iframe. I am using Google Chrome, if that is relevant.
Answer: Returning a file makes your browser try to download it, that's expected behaviour. I think it's not possible to display an excel file as-is in your browser window, unless you use something like a plug-in.


In Evernote, is it possible to have multiple separate pages in a single note?

Question: In Evernote, is it possible to have multiple separate pages in a single note?
Answer: Your question represents a longstanding gripe among Evernote users, myself included. While they allow merging of notes, splitting them is not supported, and neither is the creation of separate pages within a single note. (The closest you could get might be uploading a multi-page pdf into a single note.)
Apart from Note Taker for OS X, I can't think of any that provide multi-page functionality.


Best way to approach statistics pages

Question: In general what is the best way to approach a statistics page. Not a dashboard, but a page showing a number of numerical stats with labels. Say for example, there are around 10 numerical stats that we want to show. How should hierarchy be determined when we are unsure of what data is most important? or maybe some data is important to some users but not others and we have no way of determining this until it has been in use for a while. We want the page to be aesthetically pleasing but at the same time functional.
Answer:
Say for example, there are around 10 numerical stats that we want to
  show. How should hierarchy be determined when we are unsure of what
  data is most important?

This must come from business. Unless you have domain expertise you cannot make any decisions.
I did mock-ups for a medical app.  Our team though it was organized well for a first draft. A domain expert came in, reviewed it and completely reorganized it. "Type of illness" (which we thought was of crucial importance) was unimportant but room number and time of admittance were very important.
Answer: I completely agree with Mayo, particularly if the business is able to come up with the best hierarchy. Although if it's something that is likely to be different for each user then perhaps you can give the user the ability to set their own order.
I know you don't have a dashboard, but even a list of numerical stats with labels could be 'dragged and set' by the user, or ordered by changing settings in another page.
Basically I completely agree with Mayo, if it's an application for a certain type of user e.g. doctors. But I just want to also touch on the use case where each user may have different preferences and giving them the ability to set their own order might help.

Best way to approach statistics pages


Custom Scripts per page or Custom Post Type

Question: A client has requested some interesting functionality. THey have about 20 different scripts, most of which are needed by one page only. They would like an area within Wordpress's pages and custom post types to add scripts for THAT PAGE ONLY. So when that page loads, the script loads in the header or footer, NOT inline with the body content. I am looking for an idea or a plugin to make this functionality happen. Any ideas?
Comment: Do you want to add ability to choose script in edit-post page ?
Comment: yes, exactly. In pages, specifically
Comment: This is definitely a better direction than the answers below: http://wordpress.stackexchange.com/questions/34894/load-a-script-just-to-custom-post-type-in-admin
Answer: I would do this using a custom metabox. I use WPAlchemy MetaBox class, but if you're just creating one metabox it's probably best to just use the Wordpress metabox API.
A Standard text field would suffice, but an upload metabox would be more user friendly.
Then retrieve the URL entered in that metabox either in the header or footer.
Let me know if you need a more technical answer and I'll edit this with more info.
Comment: This sounds great. I can create a custom field with an option to add to both the header or footer. But in the template, I cannot place the loop before the header (and end after the footer), can I? How would I make it work with  and ?
Answer: I'm assuming that you want to load some post-specific scripts (JavaScript) in header.
1. Using Wordpress Custom Fields
One way you achieve this by using wordpress custom fields, While posting new post just add a custom field with name (i.e - header_script) and enter the Script source in next text-field.
This will store the Script source in wordpress database with name - header_script
To load the script located at that source in header files put the following code in header.php or put in footer.php incase you want that script to load in footer.
Here's the code that will load src information stored in custom field - header_script
Update - The code has been update to work outside Wordpress Loop.
<?php global $wp_query;
  $postid = $wp_query->post->ID;
  $key="header_script";?>

UPDATE - 2
Use this code to show multiple scripts.
NOTE - I changed the third value to false which allow us to store and retrive multiple values under same custom field name.
<?php global $wp_query;
$postid = $wp_query->post->ID;
$key="header_script";
$h_scripts=get_post_meta($postid, $key, false);
foreach($h_scripts as $h_scripts) { ?><?php }?>

2. Using conditional statments in wordpress
If the scripts are specific per post types or categories means eg - image posts needs jQuery thick-box and video posts needs some script to show videos on page... just an example
You can use conditional statements to load only needed scripts for post types.
<?php if ( 'image' == get_post_type() ) { ?>

<?php } elseif ( 'video' == get_post_type() ) { ?>

<?php } else {} ?>

Above code will load script 1 only on image post type and so on. But I think the best way is to save the script source as a custom field.
Comment: sounds promising, let me try this out.
Comment: I tried this, and the page showed this in the src:   It looks like it is not loading the content. I am using advanced custom fields to create the custom field, and that always works great with get_post_meta. Any thoughts?
Comment: There will be a field called - 'custom fileds' try using that. Oops. I think that won't work outside WP loop, wait I'll fix the code to work outside..
Comment: hey, I've updated the answer with right code to load script in header (i.e outside wordpress loop).
Comment: This works great. I am trying to figure out a good solution to allow the user to add more than one script. Any thoughts?
Comment: Nevermind, I figured it out... Just add the script tags in the custom field, and load em up! Thanks
Comment: Ok, but see the update-2 : that helps you to add two scripts under same field.
Comment: thanks! my solution works better for me, but I will keep that in mind. With your solution, you would have multiple custom fields with the same key?
Answer: If you want to load a js file for a specific post type, you can use get_post_type()
if (get_post_type() === 'products') {
    wp_enqueue_script('pd', JS_DIR . '/product-gallery.js', array(), '1.0', true);
}


Shortwave / CB / ham

Question:
Are all of these the same?  Shortwave, CB, and ham
If they are not the same, which one is better?
Which one can be easily hidden (doesn't ham need a big antenna?) for broadcasting?
Comment: Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackexchange.com/rooms/90520/discussion-on-question-by-user2263986-shortwave-cb-ham).
Answer: Welcome to Amateur Radio Stack Exchange.  Be sure to take the Tour.  It shows what this community expects and how to craft a question in such a way that it will attract useful answers.  In this way the database is expanded for the benefit of everyone.
Here are your answers:

No, they are not the same.

Imho, ham radio is much better.  It is just plain fun.  It can use shortwave and talk all around the world.  It can use hand-held radios to talk around town.
It works when nothing else does.  Where the rubber meets the road is in emergency situations: When the cell towers quit working there will always be ham radio.

There are small antennas for all of these.
Nitpick:  The term broadcasting is point-to-multipoint, which is only done on ham radio briefly in order to establish a point-to-point connection for actual communications.  It is not like a commercial station that continuously broadcasts to anyone who cares to tune in.

Here a Q&A that examines some of the issues I think you are looking for:
Should I use ham or cb radio?
Answer: Ham radio is the most flexible and most capable, and I should say in my opinion, the most fun of the two Ham versus CB radio.  I am not answering for Shortwave Listener type radio hobby because that is quite a bit different in some respects and I know quite a few Ham radio operators who are also avid shortwave listeners (to non ham band broadcasts).
Ham radio on HF bands is world wide communication.  You can't do that usually with CB.  It is theoretically possible for a 5 watt CB signal to get good skip in the peak sunspot cycle but often there are not any other parties on varieties of countries that are replying to CB transmissions.
Another difference between Ham and CB is that Ham radio offers plethora of different communications modes.  The conventional AM, SSB, CW, and FM then the various Data modes like RTTY, PSK, and a seeming myriad of others.
Ham radio offers such esoteric activities as Moon bounce or EME (Earth-Moon-Earth communications) and also a variety of satellite capabilities for extending the reach of your signal (in particular, your VHF/UHF signal).
My favorite mode is CW and that represents close to 95 to 98 percent of all my activity.  The value of CW is that is really can cut thru the noise without using a lot of power.  Most of my CW contacts are 100 watts and less for both ends of the QSO.
Ham radio is also a fraternity of like-minded people who join together in local amateur radio clubs, in contests, and other group activities including emergency traffic handling and offering communications in disaster areas hit by hurricanes or other calamities.
To many ham radio operators, part of the enjoyment is building something -- that is, home brewing your own equipment, radios, amplifiers, antennas, and even computer assisted operations with home grown software.  Therefore, I think more than CB or other SW listening activities, Ham Radio is very much into education, training, and helping others in times of need.
Answer: Shortwave or HF is a broad term that describes any radio use roughly in the 1mhz-30mhz range, and includes shortwave listening, CB, and Ham Radio.
Shortwave listening includes listening to anything in this range, including broadcast shortwave.
CB and Ham Radio in the US allow receiving and transmitting on specific ranges of frequencies based on laws and rules formulated and enforced by the FCC.
CB is channelized AM that anyone can use (free open license) but is limited to 5w and all of its frequencies are in the 11m wavelength band.
Ham Radio or Amateur Radio requires a license to transmit.   To get a license (in the US) you must pass a basic knowledge test that includes questions about the technical, legal, and safe use of Amateur Radio.  Multiple ranges of frequencies have been allocated to amateur radio with a much higher power limit, which is at least in part why there are saftey questions on the exam.
CB is better if you want unrestricted communication with cheap equipment and no exam.   Amateur radio is better if you want to use more power and use more frequencies, including ones beyond shortwave.  Amateur radio equipment can be cheap or very expensive, depending on what you want it to do and how much quality you want.  There's practically no upper or lower limit on cost.  (The lower limit would be kit radios built from scraps -- almost free!)
You can use amateur radio knowledge to build better antennas and hidden antennas, and this applies well to shortwave listening and CB as well as amateur radio.  (An antenna is an antenna, the theories work for any radio.)
Amateur radio (in the US) has some very minor restrictions on what you can transmit.
Broadcasting is one person talking to many people with no expectation of a response; this is prohibited in amateur radio, as amateur radio is two way communication -- which means you have to at least occasionally stop transmitting so you can listen.   Broadcasting is prohibited.
Transmitting for profit is banned in amateur radio.  It is intended to be a hobby for people to enjoy, not something you get paid for.  (If you want to transmit for profit, get a commercial license on commercial frequencies.)
And lastly, amateur radio prohibits communications that are not family friendly, as it it is intended that even children might be in the hobby.

Shortwave / CB / ham


Traveling inspecting flights and customer service

Question: If I'm working as self employed, traveling on airlines and rating their flights and customer service and being paid by that airline, will I need a work visa for USA and other countries. EG flying AIR New Zealand, from Auckland to LAX rating the customer service and flight and also the check-in on customer service on return flight. Can you get away with this as research?
Comment: Are you sure you will be paid by the airline? This sounds very much like a scam.
Comment: There are a number of people doing this for a living and they are definitely not paid by the airline.
Comment: It is work. Can you get away with this? A few times however of course you are aware after a few trips in and out out of the country in a short period of time, immigration will notice, apprehend you, and **definitely** remove you. In any case no **credible** international airline will allow you to do this without proper work authorization.
Answer: Technically, B-1 (or VW equivalent) might work if you are not paid by the US source. Properly collected documents, such as your company established in NZ, business agreements between AIR NZ and your company, traceable funds (bank statements in NZ, showing payment in NZ currency) will help you to establish your case. However, the situation is somewhere on the edge, so I would speak with a lawyer, and ask the lawyer to create a documentation package for you, and draft a letter to the head of the port of entry, explaining why B-1 is a legal visa in your case. As rightfully noted by @SheikPaul, you will be stopped and questioned after a few trips in and out of the country in a short period of time. And you have to be prepared to explain.
Possibly, B1 in lieu of H1B is an appropriate visa for you. But you have to use professional help to prepare for an interview for such a visa.
If you are paid by an airline, but not an employee, aren't they supposed to check your work permits before awarding you a contract? The story sounds fishy to me.


Error response from daemon: EOF on remove image

Question: I receive the error Error response from daemon: EOF when trying to remove an image with the command docker rmi 07f8e8c5e660. I've tried the force option with the same result.
I'm doing all of this within a docker machine having setup the machine and set my environment with the commands:
docker-machine create --driver virtualbox dev
eval "$(docker-machine env dev)"

Running on a Mac with OS X Yosemite.  Docker version:
Client version: 1.6.0
Client API version: 1.18
Go version (client): go1.4.2
Git commit (client): 4749651
OS/Arch (client): darwin/amd64
Server version: 1.6.0
Server API version: 1.18
Go version (server): go1.4.2
Git commit (server): 4749651
OS/Arch (server): linux/amd64

I've tried restarting docker:
boot2docker stop
boot2docker start
<set variables>
eval "$(docker-machine env dev)"

But I still get the error when I try to remove the image.
I can create a new machine and start over but this machine has issues.
Answer: I'm still learning Docker, but what worked for me in this situation was to pull the image again with docker pull <image>. At that point you can remove it without issues, if that's what you want. Hope this helps:
$ docker run tomcat:7
Error response from daemon: EOF

$ docker pull tomcat:7
7: Pulling from library/tomcat
141f200a609c: Pull complete
78af5c127529: Pull complete
00f6930c0831: Pull complete
0ffc41dcdb30: Pull complete
d2428219250d: Pull complete
47297c3ce14f: Pull complete
7afa3cfe7b5b: Pull complete
843e2bded498: Already exists
8c00acfb0175: Already exists
8b49fe88b40b: Already exists
3bdf542c6cd7: Already exists
6bc56fdd5d30: Already exists
65c0e7a8ee08: Already exists
69d701da3d27: Already exists
3360f01309dd: Already exists
6e7a2279985d: Already exists
21c22bddbd60: Already exists
5d6dc56636f2: Already exists
64b19662bd12: Already exists
library/tomcat:7: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.
Digest: sha256:b545868782d6cbae48a1d585cd3bc9ed1de44993c2c8261e495aa6ac67d45462
Status: Downloaded newer image for tomcat:7

$ docker images
REPOSITORY                TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
tomcat                    7                   7afa3cfe7b5b        6

$ docker rmi -f 7afa3cfe7b5b
Untagged: tomcat:7
Deleted: 7afa3cfe7b5b83fd4b001e15aaec8070de1f792a2c6c72c6e7c34b834fbcce37
Deleted: 47297c3ce14f196ac1a2c8dd73c97f76acd3e8dac400b127cc094527a8ac15b2
Deleted: d2428219250d54fd8f0983fd1053957ce93a8966b2197df407d91c2d9c59dc96
Deleted: 0ffc41dcdb30734cc8119a17fae5b480fd0557f7ef49b3ddeddab1e576101f3b
Deleted: 00f6930c0831bb7d276405b6f77767a26ac982ed52a892e4c6f079c8b450b65c
Deleted: 78af5c1275296c92f03800d9e540fc83e4fef5c7616a226576f3250b1fb0f5e8
Deleted: 141f200a609cc59568b33705dd4222c5f41a9bc17094e6c36e181f581254c156


What are the advantages of using a 3rd party product review aggregator compared to self managing reviews?

Question: We want to start collecting Product Reviews on our site but I don't know if it's best that we use a 3rd party product review aggregator like ShopperApproved or if we should manage our own reviews directly from within our eCommerce Store. We plan to display our reviews in Google Shopping & implement Rich Snippets both of which are built into ShopperApproved which makes things easy but I don't only want the easiest solution but the smartest solution. What's the best decision here?
Answer: It depends.. do you want control of your reviews or allow anyone to leave one even if they never did business with you? Keep in mind the most "helpful" reviews on most review sites are sadly, the bad ones. Between fake reviews and discount for product reviews, the whole review idea is losing credibility.
What I have told clients who sell a product is to simply send an email after point of sale with a simple 4 field form.

Were you satisfied with the product
Were you pleased with the customer service (if applicable)
If any, what would you change about the shopping experience
Would you be willing to leave us a review below

This way you get a real feedback, and makes the client feel you cared for their thoughts and opinion after the sale, not just from a pre-sales aspect.
Then post your reviews to your site. Dedicate a review page with proper heading and meta data, so if someone looks for reviews, they find it and you keep clients on your site.
Clients have loved it so far.


Open Reason Re-fills outside of Reason

Question: Is there any program that can open Reason's refill files? Other than Reason of course.
I would potentially like to use some of the samples contained within the Reason refill in another DAW.
Answer: I'm unaware of any, but the traditional approach to this is to load them in Reason, and then connect Reason to any other app using ReWire. Reason then, essentially, acts like a hardware box connected to an input and output.

Open Reason Re-fills outside of Reason


What were the technological differences between Japan and the USA in World War 2?

Question: Other than the nuclear bomb, I'm just curious as to why they lost WW2.
Comment: You appear to be asking two different questions. The answer to the first is not necessarily the reason for the second (which was mainly a question of resources).
Comment: It's also far too large a question to be answered in less than book length, because there were many differences, most insignificant.  You might ask about differences that  significantly affected the war.  But ultimately Japan was doomed to lose due to greater US resources.  It might not have surrendered without shock effect of the bomb, leading to either an invasion/conquest, or isolating the home islands into a "hermit kingdom" like North Korea.
Comment: @SteveBird No, I am using the second statement as the reason for why I am interested in the question
Comment: @jamesqf Perhaps you think that I am asking for why Japan lost, no I am asking for technological differences. you can direct me to resources, or specify simply for example better radar, some types of weapons used by USA, etc.
Comment: @Goldname: Maybe the reason I think you're asking why Japan lost is that you explicitly write that you're "...curious as to why they lost WW2".  But AFAIK (I'm making no claims to being an expert historian) there really were no significant technological differences.  Japan might have had a slight technical advantage when the US entered the war, due to having been at war for years while the US was unprepared.  But the US had an advantage in resources that let them produce improved weapons, like long-range bombers.
Answer: Japan lost because they didn't have large petroleum resources nearby, and had to over-extend themselves. With sufficient petroleum, they would not have needed to expend into SE Asia, and thus would not have needed to attack the Americans in the Philippines and Pearl Harbor.
There were technical differences abound, but really both Japan and the US had nearly equivalent technology. They lost because of over-extension and oil.


What does Cranberry Compound mean?

Question: I just read on the side of a Cranberry Juice pack that one of its ingredients was Cranberry compound? What does it mean?
Answer: I honestly cannot think of anything they'd be referring to other than a chemical compound, which, in layman's terms, is basically anything more complex than a pure element like oxygen.
A cranberry - and any other food - contains an enormous number of "compounds", so I'm pretty sure that the phrase "cranberry compound" just means that it's not made from fresh/whole cranberries.  It either uses some kind of artificial flavour or concentrate.
If it says "from concentrate" then it is almost definitely the latter; if it says "no artificial flavours" and nothing else then it might be the latter, and if it says "not from concentrate" (but doesn't say anything about artificial flavours) then I'd guess it to be the former.
I'd love to post some kind of citation, but as I said, I don't think it refers to any specific thing, it sounds more like a weasel word to avoid listing one or more "chemical" names like "proanthocyanidin".
Answer: I am not 100% sure, but I believe compound is fruit (in your case cranberries), which were cooked with sugar. There are IMO certain similarities between the english compound and the german word "kompott". See also the wiktionary entry to kompott.
Comment: I doubt that.  I have never heard a *compote* referred to as *compound*, ever, anywhere, and besides, a compote is a type of dessert as the wiktionary entry indicates.  It's highly illogical for that to be used as an *ingredient* in juice; they would just use cranberries and sugar and list those as ingredients.

What does Cranberry Compound mean?


Data Augmentation for Regression

Question: I want to use deep learning for regression. However, the number of training samples is not large. In image processing, some new samples are generated on the basis of initial data through tasks like rotation to increase the number of data sets. Can I know if there is any algorithm to generate more data based on current samples (data augmentation for regression)?
Comment: would you please explain more your data
Answer: Yes, you can perturb your data (and targets) in ways that you wish your model to be robust against, for example by adding small amounts of noise (possibly Gaussian) or synthetic anomalies, or by creating meaningful aggregates. Some models also improve just by running the same training data through them more than once, randomly shuffled ("epochs").
Answer: You can try something like SMOTE and see how your newly generated data fits your requirements. If your data has a statistical model you can use an appropriate parametric model to generate data. You can even try methods like Non Parametric estimation such as Parzen windows etc. All of this depends on the statistical fit of your image data which you have processed so far.
Other Methods similar to SMOTE: ADASYN, Boundary SMOTE etc (Look them up on the internet)
Note: Apply SMOTE on the already processed image data such as the training data you already have not directly on the image itself.
Comment: Why SMOTE over other augmentation procedures? SMOTE is computationally expensive and not guaranteed to give better results than KNN on small data sets.
Comment: I just mentioned a general case as there was no context about the data. In a small dataset depending upon the application most times, the safest option is SMOTE because it generates agreeable values in a small range. ADASYN can also be used I would say an enhanced version of SMOTE with the assistance of a directional vector, but as mentioned I knew nothing about the data so I gave a general solution for the simplest case.

Data Augmentation for Regression


Why are bovines different genera if they can interbreed?

Question: Why are bovinae a "subfamily", above Genus, when members can interbreed?  Some like the beefalo are fertile, which is the normal defining characteristic of a species. And Genus are groups more distantly related, so by definition they should not be closely related species.
Answer: Species are not defined by whether they can interbreed, not even close.
In fact, there is no objective, scientific standard for what defines species, or genera, at all. What is a species is determined by little more than the "feels" of the individual naming it, or the committee approving it.
And the same is true of the entire rest of taxonomic structure. It's not really science, it's just a way of organizing ideas that got popular, and in fact is under constant assault now by somewhat more scientific things like genetic testing. The hierarchy of the taxonomic system changes pretty much daily, and has no official structure or definition at all. Even the number of kingdoms is entirely up in the air.
Getting back to the specifics here, since there is no objective, scientific standard for what is a species or genus, it's no surprise that separate ones can interbreed.
And it's not like bovines are the only ones. There are many other intergeneric hybrids possible, like sheep and goats, wheat and rye, camels and llama, house cats and servals, marine and land iguanas, et cetera.
Perhaps someday there will be objective definitions to establish a truly scientific taxonomy. But for the moment, it's just whatever people in positions of power feel makes sense, at any given moment.
List of Intergeneric hybrids
Comment: Although binning organisms into "species" *is* an artificial construct to allow conceptualization and organization of life's diversity, your post is misleading and seemingly misinformed. There are dozens of ways to "define " a species, which we term [**species concepts**](https://www.sciencedirect.com/science/article/pii/S1319562X17301365) -- many of which do not rely on the ability for interbreeding as part of the "definition". These concepts are not defined by "people in positions of power", but rather used to varying degrees in the scientific literature as support for certain taxonomies.
Comment: ...In other words, it's the peer review process that ultimately decides the value for binning species according to the concepts defined in various papers; not "people of power". Perhaps becomign more common are concepts based on genetics/phylogenetics as they seem to be somewhat more objective than more historically utilized concepts (e.g., morphology).
Comment: You say that as if peer review were in any way a valid part of the actual scientific method, instead of being an impediment to it that cultivates conventional wisdom and censors ideas that sometimes turn out to be correct.
Answer: Different genus doesn't mean that they are very far away genetically, it means that they can be classified at a clear level above species.
Genus are not strict and codified, they give order in the animal world for groups of the nearest affiliation after species... based on: common ancestry, reasonably compact groupings, distinctness (of ecology morphology etc).
There are 143 bovidae in 50 genera, sheep to gazelle to wildebeest. cows are in the subfamily bovinae, made of 9 or 12 genera and three tribes.
They have decided that cows are of three types, buffalo's, bison's and bos/ox, in the tribe bovini, and that there oryx, kudu and bongo antelope are cousins of cows from a different bovinae tribe.
Scientists have agreed that bison can be grouped in a different group, genus, that zebu and cattle. It's logical.

vs

vs

They have agreed that indian cows, zebu, from indian aurochs, is in nearly the same as a cow derived from eastern aurochs, compared to the 5 species of buffalo.
For example with pigeons, they have decided to group all the species related to the wood pigeon into one group, and the columbidae family actually has 42 genera of pigeons, mostly exotic and tropical ones, and even stuff like dodo's.
https://simple.wikipedia.org/wiki/Bovinae
They make mistakes regarding genus as often as for species, and may have to swap around a species from one genus to another based on genetic evidence, even if two genus have members with parallel ecologies and appearances.
Taxonomists will say "Tragelaphus and Taurotragus genera are sometimes included with bovinae", the groups can be blurred and flexible.
It's a messy job for taxonomists.
http://bioweb.uwlax.edu/bio203/s2007/hayes_katy/images/ruminants.bmp
https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSWBirAqviIKqUNdGHbxfhZJ9JcK57jU8mYD5iydpV5wFIARCQJ
https://www.researchgate.net/publication/225666813_DNA_barcoding_of_18_species_of_Bovidae
https://ai2-s2-public.s3.amazonaws.com/figures/2017-08-08/9b140afd9d0d3eaf61ac9bde4560f8c9c207e380/9-Figure4-1.png


What's the Difference between Two Single-Quotes and One Double-Quote?

Question: As you would know, LaTeX uses ` for opening quotes and ' for closing quotes. Most fonts also allow the usage of " for closing doublequotes. My question is: what are the differences in typesetting, formatting, etx, between two 's and one "? Is it a meaningful difference like using dollar-signs against using backslash-notations? Or is it just a personal preference thing for the same function?
Comment: My editor automatically converts `"` to either `` or `''` (it keeps track).  This is occasionally a pain when you NEED a `"` (for pgfmath or filenames), in which case I have to copy and paste from another document.
Comment: @DavidRicherby are there other editors?  you can also just type a second `"` which undoes the smart quotes and enters a literal `"` in auctex
Comment: @JohnKormylo If your editor is Emacs, you can use ctrl-q to make it interpret the next character literally. If your editor isn't Emacs, you can probably type `\"` and then delete the slash.
Answer: The " is not supported LaTeX syntax, it happens to work in some font encodings. As it is not (supposed) to be used as character input it is often used as a shortcut character in many babel package and other language settings eg "- as a variant hyphenation construct not suppressing hyphenation of the following word.
If " does produce a double quote Then it (should) be a straight left-or-right quote, it is just an accident of the legacy TeX encodings that the right double quote was in that position. If you want single character input it is better to use the standard Unicode left and right double quote characters U+201C U+201D " "


How to create a label containing values from different layers in QGIS

Question: I have several layers which are stagged on each other. I need to create a label (or text-window / description, doesn't matter) which should contain values from different layers. Creating a regular label I can only choose attributes from this layer. Because the features have different nodes, it is not possible to just merge the layers.
Comment: Yes,but I can only select fields and values from the layer you are working on. I need to create a label / textwindow containing values from multiple layers.
Comment: I think it is not possible, because QGIS can not know where the "imported" feature is, therefore not choose the right value from the table. That's why I asked another question: how to split lines and merge the attributes
Answer: You can create a virtual layer that will compute the intersection between the layers and retrieve the desired values to be labeled. Then you would put a label on this virtual layer.
Here is an example between two line layers, but this approach can be generalized to other types.
Go to the menu Layer / Add layer / Add - Edit virtual layer and put the following definition:
SELECT a.myField nameA, b.myField nameB, st_intersection(a.geometry, b.geometry)
FROM myLayer1 a, myLayer2 b
WHERE st_intersects(a.geometry, b.geometry)

This will create a new layer. Label it using the formula nameA || nameB or any other one that would concatenate the information to be shown.
Comment: That is magnificent!
Comment: @KReisser no, you need to change `FROM a,b` to your layer names (`FROM myLayer1, myLayer2`) . `SELECT a.name` -> change `name` to your field name  (`SELECT a.myField nameA ...`)  (I have updated the sample code)
Comment: @Taras :-) Virtual layers are truly powerful! I believe they should be much more advertised
Comment: Exactly! Once @J.R gave me a hint and afterwards I started to use them by myself. It helps a lot!
Comment: Wow that looks promising. Thank you very much! I tried it but it says "Referenced table a in query not found" . what are the variables to be changed? nameA/nameB are my layer-names, what else?
Comment: thanks- I managed to use the query but the virtual layer is empty. therefore labelling is diabled.
Comment: since the lines are not intersecting but laying on top of each other, what would be a appropriate query?
Answer: Have a look at the refFunctions Plugin. It allows you to create a reference to another layer and you can specify the field you want to reference:
Setup:

Point layer named points with id and field1 fields
Polygon layer named poly with id field

to Create the label for the poly layer I used this:
concat("id", ' with other ID: ', geomcontains('points', 'id') ,' and name :' ,  geomcontains('points', 'field1'))

Where:

"id" is the ID field of poly
geomcontains is the function from refFunctions
'points' references my points layer and
'id' is the ID field of points

Be aware this creates problems when you have many features inside one feature of the other layer (see gif for reference)

Comment: Thank you, that seems helpful. But I need the label to be placed somewhere else, not on/near the feature, because it contains a lot of information. Usually I create a point-layer and link it to the layer with the values, where I create a point, the labels are displayed and are movable. But in this case I have two (or more) layers containing the requested values. Would that be possible with refFunctions?
Answer: attribute( get_feature( 'layer_wth_label_field','column_name_with_cross_value_within_that_layer',
attribute( $currentfeature, 'corresponding_column_within_labeled_layer_containing_cross_value' )),'column_containing_labeling_text')

which essentially does:

within a second layer (one containing text you want to appear on labels: 'layer_wth_label_field')
find the right record by:

2a) from current feature (layer 1) get the cross value (common between both tables/layers, here:  attribute( $currentfeature, 'corresponding_column_within_labeled_layer_containing_cross_value'
2b) find the corresponding record in the 2nd table/layer

for that record (in 2nd table) get the value from specific column
put it in the label of current feature

what is worth, it's works perfectly with labeling values from both geometry and non geometry layers, as the one I connected in my picture:

preview how it looks (tables and labeled feature itself)


Random eos account name with cleos

Question: Is there a way to generate a random EOS accountname or map to the public key? I remember at the beginning of the ICO, Block.one assigned a random generated name to your EOS public key. Is there a feature like that in cleos?
Answer: There's no feature like that in Cleos.
You have write your own function for generating random accountnames and afterwards you need to verify that the generated accountname is available.

Random eos account name with cleos


Are there any projects/applications using raiden network (or state channels in general) on ethereum?

Question: http://raiden.network/ - This is a promising project leveraging off-chain state networks. Are there any early adopters for this technology ?
I couldn't find any examples or sample applications on their github page.
Answer: Raiden hasn't shipped yet so there are no projects using it in production. IIUC Gnosis has been experimenting with it, among others.
Answer: We're working on state channels for our games (at Better Gaming).  we've got it working, in prototype form.  We're not using Raiden because they don't yet support arbitrary state and don't have a timeline on when it works.
Comment: Can you suggest any resources to start implementing state channels for a dapp ? Are there any sample implementations of it (other than raiden) ?


How often should I change the oil in my lawn mower

Question: I have just purchased a new lawn mower and am wondering about the maintenance.  I'm not very good at mechanical maintenance and without a small engine shop in my local home town I'm wondering what I can get away with.  The owners manual says to change the oil after the first five hours of use, but is this really required?  Will my new lawn mower stop operating of I don't do this first 5 hour oil change?
Comment: The oil change and general maint guidelines in the manual were written for a reason.  They didn't print the manual for the fun of it.  How much did that new mower cost?  If you don't mantain it, consider that you may have to buy a new one in a few years, or face expensive repairs.  Not to mention the aggravation of a mower that is difficult to start.
Answer: It (probably) won't suddenly stop and refuse to start again after 5 hours of use, but it's a good idea to follow the recommended cycle: the parts in new engines often haven't been milled perfectly smooth, so as your new engine turns those rough bits get knocked off or cut tracks for themselves, leaving little pieces of metal in the oil.  Unless you get rid of them by changing the oil, they can cause excessive wear and tear on the engine.
Depending on your lawnmower, you'll either be able to drain oil out of the bottom, or tip the mower over and drain it out the top from the same hole you pour the fresh oil into (the worst part of this is lifting and tilting the mower over the catcher pan, but it's a lot easier if you have someone to help).
Comment: When I bought a house, I bought a brand new mower and snow blower.  On the initial oil change for both, you could see little "sparkle" bits in the oil.  So yes, the initial oil change is important.  After that first one, once a season is the norm.  Maybe 2-3 times a season if you mow frequently, or it takes a long time to mow your yard.
Comment: I usually change mine annually and I cut a 1/2 acre in Florida every other week in the summer. But then again I use Mobil one and I have a cheap push mower.
Comment: After the initial change (which is essential on a new motor for the reasons described - and most simple lawnmowers have no filter) changing it right before it sits all winter is a good practice, at minimum - far better than at the start of the season, which would mean it sat all winter in the grotty oil from last year.
Answer: I also got a new mower recently and just changed the oil this weekend, having used it a few times since I got it (several hours at least).
The stuff that came out was truly done -- black and burned.  So it certainly needed it!
Follow the manual.  I'll probably change mine a few times during the season since I really hammer it with tall wet grass and weeds sometimes, causing it to stall and also get pretty hot.  It's easy to do, all you need is a pan to drain it into.  Make sure you don't overfill it when you add new oil in.
Make sure you use oil rated according to the manual (mine's SAE 30) since it can get pretty hot in a small engine without active cooling.


Wingpanel locale styling

Question: After the last update of the wingpanel yesterday the locale became a white colored text over a white background, and I don't find it "super sexy" like this. Is it possible to style it somehow, for example to keep the white text but to completely remove (make it transparent) the background?
Comment: Plus one. This white-on-white nonsense can't possibly be a conscious decision made by the design team. It's clearly a bug! Would you please report this to the devs?
Comment: Yes, probably you are right. I did that - https://github.com/elementary/wingpanel/issues/265
Answer: Found the solution :)

As admin, open /usr/share/themes/elementary/gtk-3.0/apps.css file.
Find the lines:

.composited-indicator .keyboard {
    background-color: #fff;

Change the background-color parameter to whatever you want (and then save and reboot).
Blue, for example, is #0099ff:

Comment: As mentioned in the quoted tread, icon padding property has ceased to work in wingpanel v2.2.6. (It doesn't work on my system either.)
Comment: it is not necessary to reboot, if you have elementary-tweaks just change the theme to another one, and return to elementary ) . What I recommend is to make `background-color:transparent` also `box-shadow:none` or just comment `/* box-shadow.... */` the box-shadow block. Thanks a lot!
Comment: Probably it is no longer valid, because after the last update it is again white background, with black text.. It is ok for now no matter that I prefer only text without background, but I want to know how do you found the css class used in the app.css? Some documentation somewhere?
Comment: On my PC (with all stock updates) keyboard indicator stays blue until now. Concerning its css property: I found it by myself accidentally, when searching for the way to shorten the distance between wingpanel icons. Here's the thread: https://github.com/mdh34/elementary-indicators/issues/1#issuecomment-412634500
Comment: Hmm.. I have changed in all the themes I use (including the default elementary theme you mention in your answer) the same property and it was fine until today, after a System Settings update. Now all the themes has a white background with black color, also changing the padding you mention above does not work... I believe that after this update the classes are changed.

Wingpanel locale styling


Why are scrambled eggs in the plural?

Question: Scrambled eggs don't keep the form of eggs, and yet they are used in the plural.
Are they countable? If so, how do you count them? One scrambled eggs and so on?
Comment: It is not at all "strange" to speak of "one scrambled egg".  The plural is used at other times simply because when one sees a mass of the substance it's difficult to determine how many ova may have been sacrificed to achieve that mass.
Comment: Because they are made from eggs, which are plural. Since they are plural, "one scrambled eggs" does not work. It's just like "mashed potatoes."
Comment: @sumelic what happens if you scramble only one egg?
Comment: @Mari-LouA: then you get "a scrambled **egg**" or "an egg scramble."
Comment: @sumelic so can I say "I made a scrambled egg on toast"? :) I wonder... the dish is called *scrambled eggs* regardless of how many eggs it contains.
Comment: @Mari-LouA: sure, if that is what you ate. Look here: https://www.google.com/search?q=%22a%20scrambled%20egg%22&tbm=bks&tbs=cdr:1,cd_min:1995,cd_max:2000&lr=lang_en&gws_rd=ssl
Answer: The plural is preferred: the google reports 233K results from "scrambled eggs are" and about 61K from "scrambled eggs is."  From Wikipedia

Scrambled eggs is a dish made from whites and yolks of eggs ....

From "How to Make Scrambled Eggs":

Scrambled eggs are an easy and popular dish for breakfast.

As an adjunct noun, the same lopsided preference obtains, "scrambled eggs recipe," "over scrambled egg recipe."
I guess it depends on how hungry you are when you're writing about scrambled eggs.
It's one egg, two eggs, no matter how you serve them.  From Spoonful of Promises: Stories & Recipes from a Well-Tempered Table by T. Susan Chang:

At length, I found myself with two egg variations that Noah would eat.
  Inevitably, they each took a half hour to make (yep, that's thirty
  times the amount of time it takes to make a scrambled egg).
Comment: The comparison of "scrambled eggs are" and "scrambled egg is" seems unhelpful because such a construction is more likely about the category as a whole. I think we'd all agree that "fried egg" is no less, and probably more, common than "fried eggs" but "fried eggs are" returns almost twice the results as "fried egg is"
Answer: It doesn't matter that they don't keep the form of eggs. They were "eggs" before they were scrambled, and the term "scrambled eggs" refers to the result of scrambling (multiple) eggs. Grammatical number doesn't have to correspond to the physical form of something: the phrase "a doughnut cut into fourths" is grammatically singular even though it refers to four pieces.
You can't say "one scrambled eggs," just as you can't say "one eggs." You can say "[one/a] scrambled egg" if you started out with one egg, and scrambled it. If you started out with multiple eggs, scrambled them, and want to refer to a single piece of the result, you can say "a serving of scrambled eggs" or "a portion of scrambled eggs."
Comment: @Mari-LouA: Normally I think one would say "two eggs, scrambled" if you wanted them separately. And otherwise, you would order by servings rather than by the number of eggs: "two servings of the scrambled eggs" or "two orders of the scrambled eggs."
Comment: What about an *egg omelette*? That's often made from two or more eggs.  (I'm teasing you!) Could I order "two scrambled eggs"? And how many eggs would be in "two scrambled eggs"?
Comment: @Mari-LouA: OK! To answer seriously, though, we can say an "egg omelette" because "egg" is being used there as a noun adjunct; deadrat's answer talks a little about this also. (Does anyone actually say "egg omelette" though? It seems redundant.)
Comment: @sumelic If you order "two eggs, scrambled," do not expect two separate piles to appear on your plate--just twice as much as if you ordered "one egg, scrambled."
Comment: @BrianDonovan: you're right. I'm not sure what I was thinking there!
Answer: Oxford Online Dictionary defines "scrambled egg" and "scrambled eggs" as a mass noun:

[MASS NOUN] 1 (also scrambled eggs) A dish of eggs prepared by beating
  them with a little liquid and then cooking and stirring gently.

I don't think it has anything to do with a number of eggs put into a plate/dish of scrambled egg(s). They are just one of many kinds of food that we eat. That's why it could be classified as a mass noun.
Mass noun is:
In linguistics, a mass noun, uncountable noun, or non-count noun is a noun with the syntactic property that any quantity of it is treated as an undifferentiated unit, rather than as something with discrete subsets. Non-count nouns are distinguished from count nouns.
[Wikipedia]
"Egg" is a countable noun. No matter how many eggs you put into scrambled egg(s), it becomes an uncountable noun. You have to use "a plate of" or "a dish of", "two plates of", etc. to count it.
The below Ngram Viewer shows no usage of "a plate/dish of scramble egg" and "a portion of scrambled eggs". "A plate of scrambled eggs" is much more often used than "a dish of scrambled eggs".

Note: There is always a question whether you could use "two scrambled eggs" in place of "two plates of scrambled egg(s). You could use the former, but it might be confusing because it could mean either "two plates of scrambled egg(s)" or "scrambled egg(s) with two eggs". It is clearer to use "two plates of scrambled egg(s) or "scrambled egg(s) with two eggs". Ngram Viewer shows "two scrambled eggs" is broadly used.
Comment: Did anyone suggest there would be use of "scramble egg"? I found some uses of "scramble**d** egg" on the Ngram viewer though. In terms of "portion," what I found is no hits for "a portion of scrambled eggs," but some hits for "portion of scrambled eggs."
Comment: @sumelic Dictionary suggested there is use of "scramble egg". I meant it is not always "scrambled eggs". Regarding "portion", you can click individual usages and see why.

Why are scrambled eggs in the plural?


How should I approach the scholarship committee for reconsideration if they have rejected my application?

Question: I applied for a scholarship at Ecole Polytechnique in France and received a rejection early this morning. I want the committee to reconsider my application but I can't find a good enough reason apart from saying that I will not be able to attend the institution without financial support. I have been admitted to another university (HKU) with a handsome scholarship and I was wondering if informing them about this might work. Any advice about this issue would be much appreciated.
Comment: Honestly, I doubt a committee would reconsider an application once the decision is made, even with the added information that you've been offered a scholarship from another institution.
Comment: The thing is that Ecole Polytechnique will run another admission cycle from March-April, and it will be awarding scholarships to students admitted in that cycle as well. So I am guessing that there vacancies available if only, they could give me a second chance....
Comment: If you don't have a good reason for reconsideration, it won't go anywhere. Most of the applicants need the scholarship to attend - you are not unique in this situation. After all, that is why they have scholarships.
Comment: @JonCuster thank you for your comment. The thing is that I feel that the scholarship committee believes that I can manage my education without the scholarship because they've asked for my financial details. However, the details are 2 years old and since then there have been changes in my family's financial position. Do you think that this is a good enough reason for them to reconsider me?
Answer: Give Yourself another Chance
You can conduct your second try during the next scholarship application cycle - and the time frame of a cycle varies between scholarship providers. Some scholarship providers have an all-year round application cycle, which means you can re-apply for a scholarship as soon as you hear of your unsuccessful application. On the other hand, the time period of other scholarship providers' application cycles is more limited, only allowing you to make a second application a year later.
Write an Appeal Letter
While it is recommended that the next application cycle would be the time you attempt your second try, it also wouldn't hurt to submit an appeal letter to the scholarship provider directly.
In your letter, reiterate that you are trying to apply for the scholarship a second time (even you got a scholarship with another institute but you prefer this one). Make them aware that you are not one to give up after a failed attempt, and are more eager than ever to receive the scholarship in question. Apart from your determination to reach your goals, this will also speak volumes about your courageous, indefatigable spirit.
All in all, it is important to allow your humility and sincerity to shine through in your letter, or in your interview if you are given a second chance. And if, in the end, you do not secure the scholarship of your dreams, don't be disheartened - work towards your career goal anyway. You can always do well in university and clinch a college scholarship, one that comes with no bond and essential financial support. There are many paths towards your end-goal and you should never put out the fire of your hope.
Comment: Is this based on data or at least your own experience? Because in my experience writing an appeal letter is somewhere between useless and actively hurtful, **especially** if the best reason you can find is *"but I really wanna have this scholarship"*. This comes dangerously close to wasting the committee's time. As for re-applying - this is certainly possible, but you should consider if the grounds on which you have been rejected this time will have changed or not.
Comment: Thank you very much for your reply. It's really encouraging, I'll get to working on the appeal letter.
Comment: @Supermario your welcome... No Pain No Gain ;)


Is CPU only task executer in microprocessor?

Question: I was wondering if are all tasks executed by the CPU (fetching, reading, writing, etc.)? Everything is controlled, manipulated or executed by the CPU?
Comment: Your question is very unclear, but offhand I would say the answer is "no."  Some processing of data occurs throughout your computer, not just in the CPU.
Comment: I'm sorry if you think my question is unclear but I'm pretty much greenhorn at understanding microprocessors and I don't have anyone else to ask about it.
Answer: When you really get down to it, the lines between the different parts get less useful, so asking if "X does everything" gets a bit tricky.
If you think about it, CPU stands for "Central Processing Unit."  It handles all of the processing which is centralized.  In some systems, that may be all you need.  If your computer consists of nothing but an ATtiny CPU and a bank of memory, then by definition all of the execution is done inside the CPU.  In these simple cases, everything is passive except for the CPU, which initiates all activity.
In more powerful computers, we see more decentralized activity.  More work gets done outside of the CPU.  For example, many computers offer DMA (Direct Memory Access) to permit peripherals to access memory without going through the CPU.  This can be a tremendous performance boost, so most computers have this in some form or another.  You could put the DMA engine on the die with the CPU, but it isn't always there, and it's typically thought of as separate from the CPU.
There's also the GPU (Graphics Processing Unit).  Modern GPUs are becoming more and more powerful every day, and they almost qualify as their own computer!
Even a harddrive may have some processing in today's world.  Many harddrives have a processing unit built into them which handles management of the position of the heads and may do some caching.
Comment: Even in the micro world you're likely to do processing directly on at least some of your peripherals.
Comment: "Even a harddrive may have some processing in today's world." – In fact, that's what "IDE" means: Integrated Drive Electronics, as opposed to the earlier drives that had no drive controller. ATA, SCSI, SATA, and everything else that came at the same time or after it fall into that category.


How important is a catchy first paragraph?

Question: Some novels start with a bang, with a ingeniously crafted opening paragraph or sentence that instantly catches the interest of the reader and starts the concept of the novel. How important is it to have such a start?
Answer: I won't buy a book without one.
When I browse a bookstore, I look at all the titles on the spine. Only if the title intrigues me or implies a story that might interest me, do I pull the book out far enough to view the cover. I don't judge the cover image, but I use it and any text on it to get a first rough idea of what the book is about. If this interests me, I pull the book out completely and read the blurb. If this contains things that I enjoy and nothing I dislike (e.g. angels), I open the book to the first page and read it. If this incites my curiosity, I leaf through the book to read some dialog. If the author handles dialog convincingly (it is always the weakest spot in any narrative writing and the most irritating turn off), I sit down and read the beginning few pages and turn on my smartphone to read Amazon reviews. If everything is still kosher, I buy the book.
Today, there are too many awful books on the market and every reader has wasted too much of their scarce time on bad reading experiences, so your book has to overcome a series of filters before it gets bought. Because time and attention are scarce commodities for anyone with money to buy a book, they don't give an individual book much opportunity to hook them.
If you fail at the first paragraph, you fail.
It doesn't mean though that your first paragraph must deliver the Big Bang. Although many how-to-write books recommend this, a death in the first sentence or the fate of the whole universe at stake are usually a sure sign of a boring, generic book. You don't have to outdo all the other books ever written, just create an image that stimulates the imagination.
What makes a great beginning will depend on your genre and reader age. Here is what I think is a good example for a Middle Grade fantasy (from Ursula K. Le Guin, A Wizard of Earthsea):

The island of Gont, a single mountain that lifts its peak a mile above the storm-racked Northeast Sea, is a land famous for wizards.
Comment: see how can i write an attention grabbing first line?http://writers.stackexchange.com/questions/107/how-can-i-write-an-attention-grabbing-first-line
Comment: one of the most famous SFF opening lines ever: *In a hole in the ground there lived a hobbit.*
Comment: The hook is vital, and try to  plunge the character ASAP into action, the "life" of your book hinges on the 1th line, the 1st  paragraph, the 1st page, the 1st scene, the 1st chapter, the 1st Act, the 1st half, the middle and then the end… less than optimal and you loose the reader.
Answer: Books today no longer begin "once upon a time..." there was such and such a hero, and such and such a heroine. So you do not want mostly "background" in your opening paragraph.
Instead, I was taught to "begin the story in the middle of the action." An example is the opening of my Revolutionary War novel.

"Outside a log cabin on the banks of the Pee Dee River, Charlotte Mouton saw a group of horseman riding in the distance toward her. They weren't wearing uniforms so they had to be American Patriots, not British Redcoats, or Tories, pro-British Americans who wore green. She wondered why they were headed north. The enemy was not here, but further south. And according to the rumors that had been spreading through the countryside like wildfire, these men had been winning their battles. That was saying a lot for a bunch of farmers whose patriotism and enthusiasm for war far exceeded their training and experience.
The year was 1780, and the American Revolution had been raging for four years. But the fighting had only recently come to South Carolina..."

Under the "once upon  a time" format, the most recent paragraph would have been the opening paragraph. But you can see how my "action" paragraph is more compelling. This becomes even more so, shortly, when we meet Charlotte's older brother and her future husband among these American soldiers.
Answer: Quote from Chekhov: "It seems to me that when you write a short story, you have to cut off both the beginning and the end. We writers do most of our lying in those spaces. You must write shorter, to make it as short as possible."
If you read most of Chekhov's stories, you'll probably find this is true. There's an essay that can answer all your questions called 'Overtures', written by Simon Leys, if you can find his book called the Halls of Uselessness. He writes how some authors, like Anthony Burgess in Earthly Powers, can write the most interesting things at first but completely fail to deliver. On the other hand some writers validate their first paragraphs like Melville in Moby Dick.
William Gass said that a better idea of finding out whether a book is good is flipping to pg 99. So I don't like the idea that it has to be the first paragraph that grips because some writers write in such a way where the foundations they stack very early on are almost imperceptible but when you reach the end it hits you like a trainwreck. I don't think people consider the opening of Madame Bovary to be very interesting, but Flaubert poured his whole self and years into perfecting that novel. Likewise some people won't be gripped by the opening of Proust's massive monster book, but its still a great classic of Literature, Time, Memory and Sensation. Somehow it works the same for endings. A story can end quietly but it can leave a sting that grows over time. Chekhov's The Lady and the Dog is sort of like this, and Kafka's famous The Castle doesn't even have an ending.


User Account Form Dropdown

Question: I have a Countries dropdown menu for signing up that i didn't have before. It used to just be a text field where they can input their own country. It works on the front end sign up form properly, but for the users who don't have the country selected from the new dropdown need to select a country. I have the dropdown on a front end profile form, however when the user "updates" their profile if they don't choose the country it just resets.
For example, I signed in and my country is set to USA and i go to my account to update my password, it resets what's selected on the countries dropdown.
I would like to show the County dropdown for the users who hasn't selected their countries and if the user already selected their country to just show the value they selected.
The code below is the code for the select.
{% set dropdownField = craft.fields.getFieldbyHandle('country') %}
Country
<select class="form-control" id="country" name="fields[country]">
    {% for option in dropdownField.settings.options %}
        <option value="{{ option.value }}" >{{ option.label }}</option>
    {% endfor %}
</select>

Answer: You need to check the currentUser country if it's the same as the option value -> select the option
<option {{ currentUser.country.value == option.value? 'selected' : '' }} value="{{ option.value }}" >{{ option.label }}</option>

User Account Form Dropdown


Should my air be cold when singing?

Question: I am a beginner singer, and during some singing classes I took the teacher showed me that when the air is coming from the diaphragm, it is a little cold. She showed me some exercises and I learned how to take out that cold air flow. But later at home, when singing, I noticed my air is not cold at all, even when I am completely sure I am using my diaphragm to take the air out. Am I doing something wrong or have some wrong info?
Answer: The "cool air" vs. "warm air" question is a valid one, but doesn't have anything to do with your diaphragm.
Diaphragmatic breathing is all about supporting your breath and airstream properly. The issue here is that when your lungs expand, they need room to do so, and expanding down into negative space created by your diaphragm will allow the diaphragm to do its job when you need to exhale. The alternative would be to expand out into your upper chest, where the musculature is not designed to move air in and out of your body. I disagree that you cannot control your diaphragm -- it may not be a directly controlled muscle, but I can certainly feel and influence where my air is going when I inhale--and this takes practice.
When a voice teacher is talking about cool air or warm air, they are probably (at least if they have any hope of making sense) talking about your oral cavity.
Try breathing on your hands as if to warm them up. Now, try blowing across across a spoon of hot soup to cool it down. Bingo: instant warm air/cool air. Now, do the same while paying attention to the shape of your oral cavity, in particular with regard to the placement of your soft palate. You should notice that the soft palate is very high when blowing "cool air". That is the point of this exercise in the context of training a voice--to raise the soft palate.
Comment: @jjmusicnotes I read your answer first and decided it did not sufficiently answer the question. You did not talk about the soft palate, and in particular how the hot air and cold air metaphors apply to the physiology of singing. You also only explained the mechanics of proper diaphragmatic breathing, whereas my aim was to address why this is an issue for vocal technique in the first place.
Comment: To the control of the diaphragm point... I'm sure we agree that we have conscious control over breathing in and out, yes? Is the lung a muscle?
Comment: Holding your breath by holding your diaprhagm in a certian position (so air could travel in/out your lungs and isn't blocked, but doens't because you're holding still) = controlling your diaphragm. Breathing  = controlling your diaphragm. Coughing = controlling your diaphragm.
Comment: With due respect, you basically just re-worded my answer and posted as your own.  I will re-iterate that you **cannot** control your diaphragm just like you cannot control your liver or your stomach.  If you believe you can control your diaphragm, then you would be able to make it move independently of your lungs, which is impossible. You cannot feel your diaphragm - what you are feeling are your expanding lungs. At best, "using" your diaphragm is a visualization exercise to help musicians picture filling their lungs completely with air, taking large, open breaths.
Answer: You can't control you're diaphragm; it moves involuntarily. Your teacher has given you incorrect information, which I will outline and correct below.
Also, air cannot "come from the diaphragm".  That is physiologically impossible.  Your air comes from your lungs; nowhere else.  Your diaphragm is a muscular membrane that sits below your lungs and above your stomach.  When you inhale, the diaphragm is pulled downward creating negative pressure in your lungs, causing them to expand and intake air.  The opposite process happens for exhaling.  So, all the air that you have comes from your lungs.  You can't choose where it comes from.
Quality of tone production depends on how well your vocal cords resonate. Cold vocal cords do not resonate just like cold hands make it hard to play an instrument.  Therefore passing cold air through your vocal cords is actually the opposite of what you want.  This is one reason why people say, "I need to go warm up."
Comment: I feel like you are confusing a pedagogical approach with a literal thought, as well as what is meant by 'cold'.  It sounds like this teacher was trying to give guidance as to how to encourage singing with strong breath support.  Everyone knows that air goes to the lungs... but trying to find a way of feeling proper breath support is hard, so we use terms and feelings to help students understand and gain confirmation that they are doing it correct.  I'm guessing the 'cold air' (not cold vocal chords) is indicative of quickly taking air in and resulting from evaporation of saliva.
Answer: I don't think there is any kind of problem with air.

All human beings same kind of diaphragm and the heat absorbed by the air      inhaled is completely dependent on your body temperature.
so I don't think you need to worry about it.
All you need to do is practice on regular basis

Should my air be cold when singing?