Using Co-variates in Item Response Theory 3PL model?

Question: I am using Item Response theory(IRT) using 3 Parameter Logistic Model(3PL) for Logic test. After training the model, I use the posterior means of the item parameters , β and γ to estimate person trait  during the adaptive test.
I want to introduce co-variates i.e. age, gender etc in the model for estimating ability of the person using Latent regression. But I am not able to find any research for introducing co-variates in the IRT model.
Any guidance would be much appreciated.
Answer: Using latent regression and person covariates is common in IRT; especially in large-scale assessments such as PISA. In PISA (and all others) plausible values are drawn from individuals posterior distributions in order to calculate population statistics containing measurement error components (for starters, see Wu, 2005, The role of plausible values in large-scale surveys).
A good start for latent regression in adaptive testing can be Chapter 1 in Elements of Adaptive Testing; look out for the topic "initial empirical prior".
Answer: There are several software packages that can accommodate such a model. To name a few, you have flexMIRT (commercial), mirt (R package), and flirt (R package). Two resources I would recommend are the article below, and the flexMIRT manual (which is helpful even if you use different software).
References
Jeon, M., & Rijmen, F. (2016). A modular approach for item response theory modeling with the R package flirt. Behavior research methods, 48(2), 742-755.


display two different currencies in two columns into a datagridview

Question: I am working on an existing piece of software and I have an object with some data members. Two of them are currencies (double). I need to display them into a datagridview. I know that the right solution will be create a currency object and overload the ToString() method. However I cannot change (or at least it will take me a lot of re-testing) the existing object.
I have change the format value in the DefaultCellStyle and the result is almost what I want.
myCol.DefaultCellStyle.Format = "C2"; display $23.56

I would like to customize the currency symbol as well.
Any ideas?
EDIT
I think I have found the solution:
myCol.DefaultCellStyle.FormatProvider = CultureInfo.GetCultureInfo("de-DE"); //display the euro symbol

Comment: You should put your solution in as an answer and accept it if it indeed answers your question best.
Answer: I think you should format the value by code using a different NumberFormatInfo for the additional column, in there you can specify a different currency symbol.
Answer: You solution will output something like

123,123.00€

If you want it looks like

€123,123.00

you can work on the CellFormatting event, and put the currency symbol in front.
private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
    if (e.ColumnIndex == 0 && e.RowIndex != this.dataGridView1.NewRowIndex) //set your columnindex accordingly..
    {
        double d = double.Parse(e.Value.ToString());
        e.Value = string.Format(CultureInfo.CreateSpecificCulture("de-DE"), "{0:C}", d);
    }

}

BTW: Decimal is a better choice for money type object.


Partition relation at successor cardinal

Question: Is it consistent that there are regular cardinals $\kappa < \lambda$, such that $\lambda$ is a successor cardinal and for every coloring $d\colon[\lambda]^2\to\kappa$ there is some $A\subseteq\lambda$ of cardinality $\lambda$ and $\eta < \kappa$ such that $\forall x,y\in A$, $d(x,y)< \eta$?
Answer: If $\lambda\nrightarrow[\lambda]^2_\lambda$ then there is no such $\kappa<\lambda$:  modify the coloring that witnesses this by defining it to be $0$ on pairs of ordinals sent to values above $\kappa$. (The original coloring takes on all values on any unbounded subset of $\lambda$, hence the modified coloring takes on all values below $\kappa$ on such a set.)
This rules out $\lambda$ being successor of regular (in fact, it rules out $\lambda$ having a non-reflecting stationary set by a result of Todorcevic).
For successor of singular, the question of whether $\lambda\nrightarrow[\lambda]^2_\lambda$  can fail is open.
Edit #1:
What you ask follows if $\lambda$ is a Jonsson successor of singular, as the failure of your condition at successor of singular gives a Jonsson algebra.
Edit #2:
If you demand that your condition applies to colorings of finite subsets of $\lambda$, then you end up with something equivalent to $\lambda$ being Jonsson.
Comment: Going to quit with the edits for the night, but I'm pretty sure you condition (for a given successor of singular $\lambda$) is equivalent to $\lambda\rightarrow[\lambda]^2_\lambda$.  Will flesh out the argument tomorrow.
Comment: Not quiet as easy as I hoped.  Still think it's true, but will require some work to get a proof.  Will work on it.


How to link subdomains to main domain to get SEO benefit

Question: How can I link subdomains to my main domain to get the SEO benefit? I've seen examples using all sorts of clever redirects and PHP where you get the subdomain's content on the main site...but what I want is for the subdomain to be linked with the main domain; I don't mind it sitting by itself, but I'd just like to get the SEO benefit of it. I'm aware that Google see subdomains as separate domains but can change / help them to be seen more as one site?
Comment: Subdomains are not seen as separate domains.
Comment: All links benefit the page they are linking to, but a subdomain is considered to be part of the main domain/website.
Comment: really ? does it not see them as separate domains on a backlink level ie. if i get a link to my sub domain it wont benefit the main domain..
Answer: See Do subdomains help/hurt SEO?
Here what Google's Matt Cutts has to say about sub-domains vs folders

My personal preference on subdomains vs. subdirectories is that I usually prefer the convenience of subdirectories for most of my content. A subdomain can be useful to separate out content that is completely different. Google uses subdomains for distinct products such news.google.com or maps.google.com, for example. If you're a newer webmaster or SEO, I'd recommend using subdirectories until you start to feel pretty confident with the architecture of your site. At that point, you'll be better equipped to make the right decision for your own site.

Here is what Rand Fishkin from SEOMoz says about sub-domains vs folders

Subdomains SOMETIMES inherit and pass link/trust/quality/ranking metrics between one another
Subfolders ALWAYS inherit and pass link/trust/quality/ranking metrics across the same subdomain

Google will automatically treat the subdomain as part of the main domain if it thinks they are part of the same site and run by the same person or company.  Here are some signals that you can use to make it easy for Google to see that they are part of the same site and run by the same person:

Interlink the main site and the subdomain.    Separate sites don't typically interlink.
Use the same copyright statement on both.
Use the same "about" page and privacy policy links in the footer.
Register both in Google Webmaster Tools.   This shows that the same author has access to both.
Get HTTPS certificates for each of them (or use the same wild card certificate)
Answer: Since March 2014 Google no longer sees subdomains as part of the main domain. Essentially they treat each subdomain as a seperate website. As far as I know you can't get the SEO benefits of your subdomains to your main domain, other than having some referring links between them.
Answer: It will be regarded as cheat by search engine that if the same site has various subdomains.
Comment: For example Wikipedia...
Answer: You have to just create hyperlink with your keyword in sub domain page and give link of main page. You must have to keep limit up to 1-2 links from sub domain to main page because more linking seems spamming and it will definitely detect by Search engine.


How do I change the bitrate field of an mp3 file?

Question: I have some music files which have somehow the wrong bitrate settings (32 instead of 320). Yes they are really 320bps, the file size and show exactly that. So this means no Apple Music availability. I tried changing the values in the iTunes XML file, but that did nothing, as kind-of expected. Other programs also show the wrong bitrate or none at all. Searching for 32 in a Hex-Editor of that file was useless as well.
Answer: Sorry but if the file has been encoded at the wrong bitrate, then they'll need to be re-encoded i.e. you'll need to rip them from a CD again. The bitrate refers to the amount of data that is used to store a second of audio. There is no way to increase this, in any meaningful way, once it's been created.
However if the file are encoded with Variable Bit Rate (VBR) encoding there does seem to be a common problem where the bitrate is misreported. If I'm reading things correctly it's because software like iTunes just looks at the bitrate of the first chunk of the file (which might just be silence or something simply resulting in a low bitrate encoding) and report that as the bitrate even though subsequent chunks might have completely different (higher) rates. There does appear to be a tool to fix this called vbrfix. However there doesn't seem to be an easy to get this tool for Macs.
If you are relatively confident with using the Terminal you could try the following:

Download http://http.debian.net/debian/pool/main/v/vbrfix/vbrfix_0.24+dfsg.orig.tar.xz
Decompress the file with something like The Unarchiver (macOS native Årchive Utility won't know what to make of it)
Open a Terminal window and cd to the path of the unarchived files
Run ./configure and then make to compile the vbrfixc binary
Assuming the binary compiles successfully cd into the "vbrfixc" folder and you should find the vbrfixc binary.
Run it with ./vbrfixc -log input.mp3 output.mp3.

If the file is a VBR MP3 file this will attempt to fix it by placing a blank chunk at the beginning of the file with a bitrate that is more representative of the entire file.
Comment: As I said, only the descriptive value is low. They are 100% NOT 32kpbs. You can do the math yourself, 8.5MB over 4:25min. I need some command line tool to change this in the mp3 header.
Comment: @TomK Are these VBR files?
Comment: @tomk If these are VBR files there might be a solution. I've updated my answer. Give it a try and let us know how you get on.
Comment: @TomK A 4:25 320 Kbps mp3 would have a size of 10.6 MB - so it's neither 320...


what are some examples of a monster (nietzsche monster and the abyss)

Question: "Whoever fights monsters should see to it that in the process he does not become a monster. And when you look long into an abyss, the abyss also looks into you." (Beyond Good and Evil, 146)
Comment: Same question here: [What did Nietzsche mean by monsters and the abyss?](https://philosophy.stackexchange.com/q/19805/5154)
Comment: Does this answer your question? [What did Nietzsche mean by monsters and the abyss?](https://philosophy.stackexchange.com/questions/19805/what-did-nietzsche-mean-by-monsters-and-the-abyss)
Comment: A monster? Here? In my experience, what is most monsterous is complete undiluted self interest. Who are we to judge the overman? But then, if we are under them, who are we to judge anyone?
Answer: The monster is a monster largely because of the lengths it will go to in order to defeat or harm the good.
This risks leading the good into a position in which it must fight on the same terms in order to have a chance of winning (or merely surviving).
When this happens, it can become more and more difficult to distinguish the efforts of the good from the efforts of the monster.
Take the example of an enemy who is willing to kill. When faced with such an enemy, a good person may be drawn into a situation in which they must acknowledge the need to kill in return (or to kill pre-emptively), lest they be defeated.
Perhaps this is what Nietzsche meant when he said:

when you look long into an abyss, the abyss also looks into you

Did he mean that when you look into the nature of the monster who is willing to destroy, that the willingness to destroy finds itself within you? Was he pointing out that the person who takes a knife to a gun fight is likely doomed, and so the threat of a gun (the monster) necessitates the threat and possible use of a gun (or something stronger) in response? Was he pointing out that the use of a gun, ordinarily deemed monstrous by the good, often becomes necessary upon confronting the monster for whom the use of a gun is mundane?
I can't provide a definitive answer as to Nietzsche's intent, but this seems a reasonable interpretation to draw in the absence of any material describing his motives for the quote.
The 'abyss' speaks of a psychological state; an awareness, upon using the gun, that the monster lies not only in front of you, but within you. So, when you ask for 'examples of a monster', you are limited perhaps only by the strength of your imagination, for monsters are many and varied. The monsters of your own psyche may well be lying in wait for you to stumble upon them, perhaps during some attempt to be the vanquishing, vengeful hero, perhaps merely in your unexamined desire to be such a person.
Comment: there's an interesting germ of a great answer here, thanks
Comment: Can't help thinking about WW2 here... But I think the quote is more of a personal nature. At any rate, if one overcomes internal forces, it goes better dealing with the external.
Answer: Nietzsche talks about the dragon 'Thou Shalt', as the opponent that requires a lion-nature to face in his metamorphoses. Discussed here, along with the Monster Theory interpretation if what Nietzsche was up to:
What did Nietzsche mean by monsters and the abyss?
As a friend of Wagner there can be no doubt Nietzsche knew about the dragon Fafnir, who had been a human until slaying his father to take the cursed ring Andvaranaut which could be used to find gold, and became a dragon to guard this and the hoard taken from his father.
As a philologist he would undoubtedly have been familiar with Python, who was slain by Apollo and buried in a cave under the Omphalos marking the centre of the world, and who's fumes are said to have inspired the Pythia, the Oracle at Delphi.
Comment: Python is inspiring a lot of people these days. It beats looking in to that empty black screen.


How do I create a workflow that actually works in Visio?

Question: I have created a test workflow in Visio and ran the check document query and it returns it as OK. I export to Sharepoint designer and try an run the query and get an error. Does the query all have to be logical for it to work correctly?
Answer: The actions have to be pretty simple from Visio.  Once a workflow is imported from Visio to spd, it can't be moved back.
In a boot camp I was told the idea behind starting with a visio workflow is to give a business high level design first.  Plus you can see the Visio workflow on sp as it executes.
Answer: Visio does not configure the actions. it only lays out the logic path. Once you import into SPD you need to configure the actions to make the workflow functional. You can export back to Visio, but you will lose any configurations you have added in SPD.


best wardrobe for a time traveler

Question: I am a (male) time traveler who would like to pack a single suitcase with enough outfits to be inconspicuous in as many (past) eras as possible.  What should I pack?
Comment: Bow ties are cool.
Answer: Religious clothes. They're traditionally very simple and because they're tied to religious tradition, the styles don't really change much. Wear the clothes of an imam, or a Buddhist monk, or a Catholic priest, or an Orthodox priest… preferably of an archaic style. People in the 21st century would question 17th century formalwear, but probably not the clothes in a style of an ancient monk or priest – they would assume you're very pious and traditional, not a time traveller. As a time traveller, you'll want to pack monk robes – or other religious garments – from whichever cultures you're most likely to visit.
Warning: Be at least a little knowledgeable on whatever religion you're impersonating, otherwise the guise will slip very easily. If you're pretending to be an imam and you drink alcohol, or you're pretending to be a Catholic priest and you start thinking about hooking up with that barmaid... well, the local culture will be very confused. (Well. I hope it would confuse them, and not make them avert their eyes. I guess it depends on how much the people trust the clergy/religious leaders in the area.)
But the benefits here outweigh the costs of a little learning. While you'll want to take the religious clothes of numerous regions and cultures, which may be rather tight, you'll be able to wear them across a wide range of time periods. You'll also be able to fade into the background. Except when people start coming to you asking for personal advice, which may ruin the timelines, so be careful.
Comment: "they would assume you're very pious and traditional, not a time traveller." I once saw an adaptation of P.D. James's "Death in Holy Orders." One of the main characters was a novice Anglican monk, and from his rough, plain robe, I thought at first it was set in the distant past.
Answer: How big is that suitcase? And do you have to cope with different climates and regions?

A leather jacket. Something like that has been along for a long time. No zippers ...
A collarless shirt.
Plain leather shoes, plus leather sandals.
A pair of blue jeans, can be worn after 1880 or so, and/or white/bleached cotton dungarees.
Leather trousers, for the time before jeans.
A tunic and trousers.
A cape or cloak, if there is still room in the suitcase.

That should be a start in moderately European regions.
Comment: What's "moderatly European" mean?  To me dungarees is synonymous with *jeans*, so can you elaborate?
Comment: @JDługosz, to me proper jeans are blue, while dungarees may be other colors. Moderately European means Europe plus areas influenced by it. This wardrobe might work in South America in 1850, for example, but not for China in 100 BC.
Comment: I tried wikipedia, [and got this page](https://en.wikipedia.org/wiki/Dungaree) which is interesting in its implication.
Comment: OK, swap "dungarees" for "off-white cotton trousers".
Comment: @o.m. The GURPS _Time Travel_ book had a similar list of clothing to blend into different times and places, and a longer list of items to bring. "... plain boots, denim jeans, cotton shirt and leather jacket will not be _too_ conspicuous for the last few hundred years ..."
I would add, avoid plastic buttons.
Comment: @user24353, I know that list, but I was also thinking of Asprin/Evans and some other novels, and I was trying to stay within one suitcase.
Answer: You could theoretically get away with a bathrobe.  Bathrobe-style clothes/bathrobes have been around forever, so you could just wear that.  But on a serious note, I would pack the following:
1 black Tshirt
1 pair of jeans
1 cloak/tunic
1 pair of sandals
1 pair of burlap pants
10 pounds of bacon jerky (HEY, you can't live without bacon...)
Answer: If you have time travel, wouldn't you expect to have other advanced technology?
A suit made from shape-shifting programmable matter would be able to appear as any clothing needed.

best wardrobe for a time traveler


Does constraint for speed of Electric and magnetic fields violates Conservation of momentum or Newton's third law?

Question: I'm just a beginner so bear with me. Consider two frames at rest wrt to each other separated by distance enough for light to take a minute or so. At a given instant we create two large dipoles by some method. Electric field will start to travel at the time of creation at speed of light. But before electric field reaches frame 1, we reunite the dipole in frame 1. so when electric field reaches from frame 2 to frame 1, there'll be no effect on it, since net charge is zero. But electric field from frame 1 when reaches, creates force on dipole of frame 2. So in reality what happens? Is conservation of momentum violated? Or law of equal and opposite forces???
Comment: I think this is due to the fact that fields can carry away momentum. Not sure :/
Comment: +1 to John McVirgo. Momentum conservation is always true, but law of equal and opposite forces is concept of Newtonian physics where it is assumed that light travels at infinite speed.
Comment: Related: http://physics.stackexchange.com/q/7218/2451
Answer: Action equals reaction isn't generally true in electrodynamics such as the simple case of magnetic forces acting upon moving charges, whereas the conservation of momentum holds in all areas of physics. There is momentum associated with the electromagnetic field which must be added to that of the momentum of the charges it acts upon to get the total momentum of the electrodynamic system.
Comment: Thanks a lot. So how exactly does the momentum is carried by emw? through some quantum particles? And what about conservation of energy in the above problem?
Comment: @aman according to quantum theory electromagnetic radiation is made up of massless particles called photons which possess momentum $p = E/c$ where $E$ is energy, and $c$ is the speed of light. An object initially at rest will recoil upon emitting radiation to conserve momentum. The linear momentum carried by electromagnetic radiation is given by $\epsilon_0(E\times B)$
Answer: Although the total momentum of any electromagnetic system is conserved, once you take into account the momentum stored in the field, as John McVirgo points out, the action-reaction law only really holds in electrostatics.
In fact, you don't even need the finite propagation speed of the field as in your example. Consider two equal positive charges moving towards the origin along the positive $x$ and $y$ axes. Then they experience magnetic fields in the positive and negative $z$ directions, respectively, and therefore magnetic forces in the positive $y$ and positive $x$ directions, resp., and these cannot cancel each other out. In a full description, this motion induces crossed electric and magnetic fields throughout space, which store the momentum not accounted for by the non-cancelling forces on the charges.
Comment: Thanks a lot. So how exactly does the momentum is carried by emw? through some quantum particles? And what about conservation of energy in the above problem?
Comment: How exactly the EM field carries momentum depends on how exactly you describe the field. If you insist on the field being made up of photons, then each photon of well-defined direction $\hat{n}$ and wavelength $\lambda=:2\pi/k$ carries momentum $\mathbf{p}=\hbar k \hat{n}$. If you're within a classical description, then the field has a [momentum density](http://en.wikipedia.org/wiki/Electromagnetic_stress%E2%80%93energy_tensor) $\mathbf{g}=\frac{1}{4\pi c}\mathbf{E}\times\mathbf{B}$.
Comment: If we consider photons, they have energy. does that means a charged particle continuously emits energy? Its energy decreases continuously?
Comment: It is only accelerated charges that can emit photons/radiate (classical) EM energy. This applies in principle to electrons circling an atom, so they would spiral into the nucleus within a picosecond (which doesn't happen!). Thus for bound electrons Bohr and later Schrödinger and Dirac developed quantum mechanics, which predicts that bound electrons only emit photons when changing between different energy levels in an atom. These photons then have energy equal to the difference between the two levels (and of course the associated momentum, which imparts a recoil on the atom).


Car overheats once AC is turned on

Question: I have a 2005 model of Sienna with 154,000 miles. The car overheats once I switch on the AC over a short distance.  With AC off the car runs smoothly. The mechanic has washed the radiator but the problem persists.  Mechanic suggested we change the radiator from single cell to double cell. Please what do I do to solve the problem.. Thanks
Comment: Does the car overheat if it's moving at highway speed still? (With the ac on)
Answer: First when the engine is cool check the coolant level.
If the car behaves normaly without ac then the thermostat should be alright.
Check for flow in the radiator: Start the car when cold run the car at idle till the fan comes on, the hose comming out of the bottom of the radiator should be getting hot quite quickly now. If not I suggest flushing the radiator.
If the ac actually works, and the radiator is not clogged. I would suggest the following: Have a second person with you and run the car, like normal till the cooling fan comes on (Make sure it does). Then drive the car with the ac until the temp is just slightly higher than normal (don't let it overheat). Pop the hood and have the second person go out and check to make sure that both the main and secondary ac fan, is coming on. If not check the appropriate fuses and plugs. If they are both coming on or there is only one. Suggest motor/radiator flush.
Comment: Is there a distinction between a radiator flush and a motor flush? Or are they one and the same thing? I was about to ask the same question you answered before I decided to check if it has been asked before!
Comment: Radiator flush only means doing the radiator. Engine flush means just the engine. A cooling system flush should mean both and heater core.

Car overheats once AC is turned on


which address do i send my eos tokens to on metamask? contract address or ethereum address?

Question: I recently created an ethereum account using metamask and registered a public/private eos key pair on it. I bought some eos on an exchange and i am not sure which address to send my eos to. Do i send it to the contract address or ethereum address of my account?
Answer: Send it to your main ethereum address not a contract address.
Answer: You need to send the tokens to the account in which you want them and where you can access them, so it should be an account to which you have the password or the private key.
Note that different wallets do recognize some tokens by default, but not all, of course. If your wallet does not recognize the EOS token, you should add the token to the wallet before you transfer any tokens. For this you need the contract address of the token.


Schottky diodes question. Which will power the board? Battery or USB?

Question: Given this diagram, where Vcc is a 3.3V supply powering an Arduino, if I were to connect both a USB and a battery at the same time, which will be used to power the board and why?
Comment: The cathodes of both diodes always are at the same voltage. Consider what this implies about the current through the diodes.
Comment: Whichever one has a higher voltage will power the board. When the voltages are close, there will be some sharing. In other words, the transition will be gradual, not an instant switch-over.
Answer: That depends on the voltage on the battery.
If the battery voltage is greater than VBUS.5V plus a diode forward drop then D2 will be forward biased and D1 will be reverse biased. The battery will be driving the regulator and the USB will be effectively disconnected.
If the battery is less than VBUS.5V minus a diode forward the converse is true. D2 well be reverse biased and D1 will be forward biased. The USB will be driving and the battery will be effectively disconnected. However is will receive the diodes leakage current as a charge current.
Anywhere in between and the current will be divided between them in a ratio that depends on the forward voltage across their respective diodes.
Comment: @user7252850, see this question http://electronics.stackexchange.com/questions/294974/why-is-the-diode-forward-voltage-constant/294987#294987
Comment: This is because the higher the voltage the faster the current? Also, what do you mean by forward and reversed biased?
Comment: wouldn't current still be going through both diodes?


What video resolution is best?

Question: I shot video's on my Samsung Galaxy S7 Edge (in vertical mode, not landscape) and paid no mind to what the video resolution was. I then converted the mp4 videos to avi and burnt them to dvd disc but when i watch the video's on my widescreen tv the top and the bottom of the video is out of shot. I tried altering the aspect ratio on my tv but it made no difference. Now i have a program on my laptop that converts video's to all formats, It works great but i have no idea what resolution to convert them to so all of the video is on the tv screen & not just the middle! Please can someone help me? What resolution is best to watch phone-made video's on a widescreen tv? Thanks.
Comment: Andi, you should really watch this video (it's not a serious video, but it's message is absolutely correct, human eyes are horizontal and thefore video should be too). In the future, just never make vertical video's. youtube.com/watch?v=Bt9zSfinwFA . You mightl need some video-editing software to fix the video. Do you have some software? If not, I will try and find a free solution.
Comment: Check the resolution of your TV and try to crop to that one, or at least to a resolution with the same ratio.
Answer: The answer is that there is no proper solution to make your video look good. It went wrong during the shooting of the video. In the future, never film vertically and you should have no problems at all.
There are three options:

You can stretch the video (which looks bad)
You crop the video, getting rid of part of the top and/or part of the bottom of the video (you already effectively did this and it didn't give you what you wanted)
Project part of the video to the sides of the screen. Then you have the full vertical video in the middle (horizontally) of the screen. This video shows how you can do it, but you'd need software: https://www.youtube.com/watch?v=LdCLQ2DQ0NY

As for the resolution, match the vertical resolution and horizontal resolution of the final video to that of the DVD standard(720x480 for PAL or 720x576 for NTSC) If your player can play both standards, use the one matching your TV bast (assuming a widescreen TV, that'll be PAL). You can choose to fill up the side of the video with black until you match the resolution, or like I said before with a blurred version of part of the video (example image below).
Comment: Fine, except that DVD resolution is either 720x480 NTSC or 720x576 PAL, so that ought to be your maximum resolution, whatever resolution the screen is.
Comment: Good point, I'll change my answer accordingly.
Comment: You forgot: turn the video and the TV ☺

What video resolution is best?


Youtube media thumbnail size

Question: I want to control the thumbnail image size for my media entities of type video.
The thumbnail image size being fetched by the media module from Youtube has 480 x 360px.
I want to use the 1280x720 images. Is there a way for me to control this?
Comment: Which module are you using?
Comment: Drupal's core media module.
Comment: This takes core patching. See the answer below.
Answer: Drupal core issue regarding this problem:  https://www.drupal.org/project/drupal/issues/3042423
After patching, I would implement the new hook_oembed_resource_data_alter:
function MY_MODULE_oembed_resource_data_alter(array &$data, $url) {
  if (strpos($url, 'youtube.com/oembed') !== FALSE) {
    $thumbnailUrl = str_replace('hqdefault', 'maxresdefault', $data['thumbnail_url']);
    $data['thumbnail_url'] = $thumbnailUrl;
  }
}

Then I would also run an update hook to update the existing thumbnails:
function MY_MODULE_update_N(&$sandbox) {
  /** @var \Drupal\media\MediaStorage $mediaStorage */
  $mediaStorage = \Drupal::entityTypeManager()->getStorage('media');
  if (!isset($sandbox['progress'])) {
    $result = $mediaStorage->getQuery()->condition('bundle', 'video');
    $mediaItems = $result->execute();
    $max = count($mediaItems) - 1;
    $sandbox['progress'] = 0;
    $sandbox['mediaItems'] = array_values($mediaItems);
    $sandbox['max'] = $max;
  }
  $progress = $sandbox['progress'];
  /** @var \Drupal\media\MediaInterface $media */
  $media = $mediaStorage->load($sandbox['mediaItems'][$progress]);
  if (!$media->get('thumbnail')->isEmpty()) {
    $media->get('thumbnail')->delete();
  }
  $media->updateQueuedThumbnail();
  $media->save();
  $sandbox['progress']++;
  $sandbox['#finished'] = empty($sandbox['max']) ? 1 : $sandbox['progress'] / $sandbox['max'];
}

Comment: While this approach works nicely, it has one major drawback. Your code in `MY_MODULE_oembed_resource_data_alter` forces all thumbnails to be obtained in `maxresdefault` quality. However, the reality is that not all videos from youtube have thumbnails available in this format. When a remote video is created which doesn't have a high quality thumbnail, no thumb is generated at all (although lower quality thumbnails do exist). I worked around this limitation by grabbing the hightest available, to choose from:  'maxresdefault', 'sddefault', 'hqdefault', 'mqdefault', 'default'.
Answer: Building on José Trindade's answer, here's my solution that uses Guzzle to find the highest resolution that YouTube actually provides for a given video:
use GuzzleHttp\Client as GuzzleClient;

/**
 * Implements hook_oembed_resource_data_alter().
 *
 * This tries to fetch the highest available YouTube video thumbnail by sending
 * requests via Guzzle for the various formats from highest to lowest, using the
 * first one that doesn't return a 404.
 *
 * @param array &$data
 *   The oEmbed data, parsed into an array.
 *
 * @param string $url
 *   The oEmbed URL that $data was retrieved from.
 *
 * @see https://www.drupal.org/project/drupal/issues/3042423
 *   This hook won't be invoked unless this Drupal core patch is applied.
 */
function YOUR_MODULE_oembed_resource_data_alter(array &$data, $url) {
  if (
    $data['provider_name'] === 'YouTube' &&
    strpos($data['thumbnail_url'], 'hqdefault.jpg') !== false
  ) {
    // Array of thumbnail sizes above 'hqdefault' to try, started with the
    // largest size.
    //
    // @see https://stackoverflow.com/a/20542029
    $thumbnailTypes = [
      'maxresdefault' => [
        'width'   => 1920,
        'height'  => 1080,
      ],
      'sddefault' => [
        'width'   => 640,
        'height'  => 480,
      ],
    ];

    $client = new GuzzleClient();

    foreach ($thumbnailTypes as $thumbnailName => $thumbnailDimensions) {
      // Replace 'hqdefault' in the thumbnail URL with the current type we're
      // testing for.
      $testThumbnailURL = str_replace(
        'hqdefault',
        $thumbnailName,
        $data['thumbnail_url']
      );

      // We need to wrap the request in a try {} catch {} because Guzzle will
      // throw an exception on a 404.
      try {
        $response = $client->request('GET', $testThumbnailURL);

      // Got an exception? Skip to the next thumbnail size, assuming this
      // returned a 404 or ran into some other error.
      } catch (Exception $exception) {
        continue;
      }

      // If this was a 200 response, update the thumbnail URL and dimensions
      // with the higher resolution and break out of the loop.
      if ($response->getStatusCode() === 200) {
        $data['thumbnail_url']    = $testThumbnailURL;
        $data['thumbnail_width']  = $thumbnailDimensions['width'];
        $data['thumbnail_height'] = $thumbnailDimensions['height'];

        break;
      }
    }
  }
}

Don't forget to replace YOUR_MODULE with the name of your custom module.
Comment: Thanks for this solution. The `maxresdefault` isn't always fullHD, so I would recommend using `getimagesize()` to test for the dimensions of the image returned by Guzzle.
Answer: Thanks to Jose Trinidad and Ambient.Impact for their answers, they helped me a lot. To get the Jose's update-function to work in my project though I had to set the bundle to 'remote_video' instead of only video:
    $result = $mediaStorage->getQuery()->condition('bundle', 'remote_video');
I think the video bundle refers to normally uploaded videos

Youtube media thumbnail size


Resurrection of my MacBook Pro

Question: My MacBook Pro was pronounced "dead on arrival" by the Apple Genius after sustaining injuries from liquid that had been spilled in my brief case. Despite the purchase of a new MacBook Pro Retina I find myself unable to completely detach from the MacBook that drowned in a pool of sweetened iced tea while under my watch. Is there a financially practical solution for resurrecting my MacBook Pro with the 17 inch display and solid state hard drive? It's been stored in my closet and has never started since the fatal accident.
Comment: Well, I understand and feel with you. Now it depends what kind of surgeon are you. Short of making a little Frankenstein we could go and replace many parts to bring it back to life (at cost).
Comment: You should be able to part out the dead MBP and at least take out it's SSD which is sealed is probably working fine. My guess is the sugar in the tea did a number on the exposed motherboard and all the small connections so that piece is probably not worth messing with.
Comment: Consider giving it a proper burial with honers and Eulogy, but do not use Cremation.
Comment: @Buscar 웃--Buscar, I have difficulty with the concept that it cannot be revived and am hoping to hear from someone who has encountered a similar disaster and found a remedy. I apparently suffer from Mac separation anxiety evident by the fact I've maintained and use upon occasion, my first Mac G4 that was purchased in 2006. If only my Macs could talk....
Comment: @Buscar웃 and Richard-Since you've mentioned Frankenstein, I will certainly consider weighing the good against the bad and the ugly. When you refer to removing the dead and broken parts in an attempt to bring what is dead back to life, I feel strangely haunted with images of my ex-husband which is enough to cause me to rethink the horror of resurrecting what is hopelessly broken and nonfunctional. Perhaps I'll ask that my Mac be blessed and sprinkled with holy water before wrapping it in a shroud and burying it in an unmarked grave in a cemetery known as Giglia.
Answer: Sorry to say...the only solution is...
Comment: It was a good run, my MacBook Pro and me. But I cannot look back at my seventeen inch Mac, when I've replaced it with Retina technology.

Resurrection of my MacBook Pro


Cairo dock with what desktop panel

Question: I'm using Cairo-Dock 2.4 on Ubuntu 11.10 with the Gnome Classic UI. Is there any other desktop UI I can use that will allow me to just have Cairo-Dock as the main/only panel?  I just need an all-in-one simple panel.
Answer: Cairo dock can be "logged into" replacing the gnome-session, this would be a custom Cairo Dock session.
<code>sudo add-apt-repository ppa:cairo-dock-team/ppa
sudo apt-get update
sudo apt-get install cairo-dock cairo-dock-plug-ins
</code>
http://www.webupd8.org/2011/09/cairo-dock-240-released-with-custom.html
Comment: Yea that's what I figured. The problem with this was that the "menu" bar still appeared on the top of the desktop. (This bar doesn't really serve a purpose). However, I found a fix to that; using advanced settings, I disabled the option to "have file manager handle the desktop." Thanks though. I think I'm sticking to this custom Cairo session.
Answer: I use KDE. It's so much more easy and customizable than Gnome. It allows you to have complete control over the panels (removing, resizing, etc.), so that's what I would recommend (Kubuntu). Just open software center, install kubuntu-desktop (you have to click "show hidden files" to be able to see it, and then you can have a desktop with only cairo-dock. Install "lancelot" for Cairo-Dock, to have a menu, and I think that's all you need.
I tried doing this with Gnome before, but after I disabled the Ubuntu Unity plugin in Compiz-Config, I still had an ugly bar at the top with File, View, Edit, and a whole bunch of other junky stuff. Too bad, because I was actually enjoying CCSM more than Kwin, but in the end, I think moving was a good decision--you won't regret it! In fact, you can even user Compiz as your window manager instead of Kwin if you want, although I've never found a need for that.
However, I do have to admit, although I did try pretty hard and researched quite a bit, there still might be a way that I don't know about, so if you don't want to give up Gnome, then keep searching.
Comment: After a little tinkering around, I found this dock called Cinnamon. It's very similar to the Windows task-bar and it is very simplistic and customizable. Somehow, while toggling the "Have file manager handle the desktop" option in advanced settings, that "ugly top bar" disappeared.
Answer: Off Topic of Cairo-
Docky with Cardapio Mini mode

http://www.webupd8.org/2010/11/cardapio-menu-update-brings-docky.html
Comment: Hmm can you run this in its own session?
Comment: I do not believe Docky has that ability yet, Good question.

Cairo dock with what desktop panel


What are the rules for racing on airport runways?

Question: What are the adverse affects of burnout rubber left on the runways for airplanes?
Comment: Are you talking about loose FOD chunks of rubber, or rubber embedded in the pavement? Your question and the title ask two different questions. The "rules" probably vary by airport and really doesn't have an answer.
Comment: http://racetherunway.com/ why not ask the organisers of this event? I've met some of them a few months ago, they were nice enough people.
Comment: How about [landing on the raceway](https://youtu.be/a0uSgPUeAOY?t=24m31s)
Answer: The adverse effect is once the layer of rubber gets too thick it starts to degrade braking performance, especially wet braking because the rubber is filling in the surface irregularities that help channel water out from under the tire.  Aircraft wheels will hydroplane at much lower speeds and with less water depth.  Airports remove excess rubber from touchdown zones once it gets beyond a specified thickness.
I would expect that the rubber from spinning car tires would be no worse than the rubber that builds up on touchdown zones on heavily used runways.  If an airport is closing a runway to use for drag racing, it can't be a very busy airport, but in theory a really heavy rubber build up could be a concern if infrequent high performance aircraft like business jets use it, you know, when no drag racing is going on.  That would be up to the airport operator what to do about it.
Comment: which is precisely why runways are tested for traction regularly and cleaned as needed.


IIS7 running classic ASP website consumming COM+ components for distributed transactions

Question: We've recently came across a problem while migrating our web application from Windows Server 2003 and IIS6 to Windows Server 2008 Standard 32 bit and IIS7.
The web application is a classic ASP application which is using a number of legacy COM+ components for some database operations. The database server is an Oracle 10g DB running on Linux and the Oracle client is also 10g.
The problem is that when trying to do an inset/update/delete within a transaction it throws an exception saying that the transaction cannot be enlist in the specified transaction coordinator. Read queries are OK. DML commands are also working fine if the COM+ components are configured to not require a transaction but that's not really an option for our system.
I know the MSDTC is configured correctly and so are the COM+ components both in terms of security settings and opened ports(firewall turned off completely) because on the same server we also have a windows service using the same COM+ components and that one is working fine. I even went as far as to give rights and permissions to almost every user account on this server for both MSDTC and the COM+ components so whatever the identity of the thread that is running the code in IIS I'd say it should be pretty much covered by that.
Have been trying to get to the bottom of this for a few days now and all we could find on the internet were things that we already cover, like DTC configuration and firewall issues. Not sure what else to try particularly since the windows service application is running just fine in the same server setup.
Answer: Maybe this would help
Comment: thanks for the link, I have checked and double checked all that and the configuration looks good. It has to since the windows service using the same COM+ components, same oracle client, same database etc is running just fine. The only problem is with the ASP application


Connecting to local hosted applications from google app engine (for java)?

Question: I was wondering if its possible to to connect (thro' SSO) to a locally (in my env) hosted application from a java web application running on google app engine. Assume I have an application based on a tool/framework which cannot be moved on to the app engine due to the app engines various restrictions. Is it feasible keep this application in house while building any extensions I need onto a application running on the app engine? So I enter thro' the main application on the app engine, do a SSO to my local app for any features I need from this app, but use the rest of the features from the main application on the engine itself.
I see that there are solns where force.com integrates with google app engine (exposing webservices). Likewise I thought it might be possible to connect to local apps at a screen level using SSO.
Answer: Yes - you can use Secure Data Connector to access your internal services from an App Engine app.


X feet long/high versus (a/an) x-foot [noun]

Question: Why in this picture
are the length and height of a plane given as x feet long and y feet high but the wingspan is described as a z-foot wingspan? Are they the same units? How can I choose which one to use?
Comment: There are two reasons why this is as shown. The first is that the part-of-speech of the length and height are not the same as the wingspan. The other is habit when describing plane dimensions. He could have just adhered to semantic parallelism when noting all of the dimensions.
Comment: Note that it's not "63 feet height". It's "63 feet **tall**".
Comment: It's always ***a six-foot man*** (which not everyone hyphenates), never ***a six-feet man***. But with the slightly difference construction [*I'm six feet tall,*](https://www.google.com/search?q=%22I%27m+six+feet+tall%22&btnG=Search+Books&tbm=bks&tbo=1&gws_rd=ssl) well over 10% of native speakers (including me) normally say [*I'm six **foot** tall*](https://www.google.com/search?q=%22I%27m+six+foot+tall%22&btnG=Search+Books&tbm=bks&tbo=1&gws_rd=ssl) (neither of those are ever hyphenated in the written form).
Answer:
In Standard English, foot and feet have their own rules when they are
  used in combination with numbers to form expressions for units of
  measure: a four-foot plank, but not a four feet plank; also correct is
  a plank four feet long (or, less frequently, four foot long). When
  foot is combined with numbers greater than one to refer to simple
  distance, however, only the plural feet is used: a ledge 20 feet (not
  foot) away. At that speed, a car moves 88 feet (not foot) in a second.

Usage note at entry for foot in The American Heritage dictionary.
Comment: Just to add that Northern BrE would also often colloquially say '6 foot tall' to describe someone's height, or 6 foot under etc.
Comment: Corpus of Contemporary American English: 3 instances of "six foot under"; 184 of "six feet under". 19 "six foot tall"; 427 "six feet tall".


Take down the helicopter in Just Cause

Question: I'm playing Just Cause 2, but can't figure out how I should take down the helicopter in the mission where I need to protect the technichian. Any help?
Answer: I've found the most useful way to be hooking to the helicopter and throwing the pilot out. This gets rid of the helicopter problem really quickly, and it gives you a mighty weapon against the rest of the enemies.
Comment: Yeah I always do that aswell, grapple, pull the pilot out then laughing evilly I start shooting stuff with the helicopter.
Comment: True. I always try to hijack the helicopter, it's like 2 birds with a stone - you save the technician, and get a travel+ammo combo too. :D
Answer: Faction takeover missions, the ones that require you to protect a technician while trying he goes about hacking into the site's systems, usually end with a 'boss battle', where the site's commander comes attacking in a helicopter or armored vehicle.
At this point, look around for a mounted minigun, which can be detached by tapping the jump key (default: Space), so that you can aim upwards at the helicopter. This is the best option, as the minigun is extremely powerful and has unlimited ammo. If you can't find one, then you just have to make use with whatever is at hand. There should be a lot of dead guards around the area whose machine guns should be useful in taking down the helicopter. If you have the time (which you usually wouldn't), you can also look around to see if there's a helicopter nearby which you can use.
Comment: Even detached, miniguns have unlimited ammo and are amazing. Miniguns are the solution to so, so many problems that you might encounter in JC2.
Comment: @kanarifugl As mentioned, you can detach the minigun by pressing space
Comment: @Nolonar No, that's not true, both from personal experience and the wiki
Comment: I do indeed have a mounted minigun, but the helicopter is flying too high so I can't point on the helicopter with the minigun.
Comment: Once detached, I believe the minigun's ammo becomes limited, so it's best to only detach it when absolutely necessary. On a semi-related note: if all else fail, you could always try to grapple onto the helicopter and attempt to hijack it.

Take down the helicopter in Just Cause


What does the hornet do on the ivy blossoms?

Question: We've got blooming ivy growing around a tree. Since several weeks lots of hornets have been whirring in the foliage and I wonder whether they want to feed on insects that are lured by the blossoms or whether they come for anything they get from the ivy plant.
Answer: Hornets, just like wasp in general, hunt insects to feed their larvae but feed themselves with carbohydrates like nectar (or lemonade). So it is quite probable that the hornets are feeding on the nectar of your ivy. wikipedia


How is the electrostatic potential energy stored in the electric fields?

Question: Potential Energy between two point charges is calculated as follows: First you bring a test charge from infinity to a point then you write the force between them, then you write the variation of work done with the force and you integrate it. The Work Done by external agent is stored in the form of potential energy in electric field. How is that stored in an electric field? Electric field is such an abstract concept while potential isn't.
Answer: "How is that stored in an electric field?". I don't think we can give a picture of how it is stored. We can come up with analogies: Maxwell himself compared the energy stored in an electric field with that stored in an elastic substance under stress.
The key thing is that if we assume that the energy of the electric field per unit volume is given by $$u=\tfrac12 \epsilon_0 E^2$$ then we get consistent results for the energy stored in a charged capacitor (check this out if you're not familiar!) and for the work done changing the separation of charges and so on.


Poor images in DataGridView

Question: I've written a little application to do something similar to outlook, looking at .msg files on the hard drive.
I am using a dataGridView to show the messages in a folder, and I want to display a little icon in the left hand column to indicate a message file (or a different icon for calendar/contact/etc).
I have copied a little mail item image and saved as a gif.
But when I load the image into the datagridview it looks bad - it's more or less correct but poor quality.  See image - at the top left just above my application is the image file as displayed by IE (or any other editor) and below is my application where the same image file displays poorly.
I have tried zoom/stretch/normal but they all look about the same.
Any ideas?
Thanks
Oh- just realised I'm not alowed to post images. Well basically the bad version looks like the good version but scaled up a bit and not particularly well - fuzzy, some loss of colour fidelity etc.
Answer: OK I figured this out - very silly.
The problem was not with DataGridView but with the ImageList I was using to import the images.
Phil

Poor images in DataGridView


What exactly does the shield protect you from?

Question: I don't remember the shield power-up from the original temple run.  I try to pick it up like all power ups, but it tends to fade away without seeming to have done anything.  I assume it shields you from some traps, but I'd like to know the exact list.
Answer: I just played a few rounds to confirm:
The shield prevents death from all solid objects, including the rotating spike cylinder, and fire. It also prevents you from tripping on the tile piles that occassionally block either side of the path, and from tripping during mistimed jumps where you fall short and hit the incoming ledge. All of these objects, once hit, deactivate the shield.
When in the mining tunnel, the shield DOES NOT prevent you from tilting your mine cart into the tunnels blocked with boulders (the boost does).
The shield does not save you from falls, water hazards, or broken mine track.
The first Temple Run also included a power-up with the same properties but was called Invisibilty.
Comment: And the shield will deactivate after a given time. The duration can be permanently extended using coins in the power-up shop, and further extended using gems (though the gem augmentation is only temporary and must be recharged with more gems).
Comment: I just tripped with a shield on so Im gonna say that it doesn't protect you from tripping. If anything it gives you a false sense of security and I would say try and avoid it.
Comment: Do you remember what tripped you?
Answer: Follow-up for Invisibility
It has the same properties as Invisibility from the last game (Temple Run).
It saves you from:
1. All solid objects.
2. Fire.
After one hit, it deactivates.
It also deactivates if not used for a period of time.
Comment: Note that it also deactivates if not used for a period of time.


whatsapp web login process

Question: Is it possible to copy all session/login data of WhatsApp web from one browser to another so that I can use WhatsApp web on another browser without the need to scan QR code again? ,
Comment: I doubt they would allow you to do this as it'll be quite a big security loophole
Answer: Whatsapp has not provided such a feature yet, But you can use whatsapp web on the same browser again again till it's id is kept save in your whatsapp app. You have to scan QR code atleat once to access this feature. Later it may possible to launch OTP or other methods to access whatsapp web.

whatsapp web login process


What kind of guitar is used in Edenbridge's guitar solos?

Question: Edenbridge's guitar solos have a unique, almost peaceful sound to them. I am curious, what kind of guitar is used to play them?
Here is an example.
Answer: The sound in the track you linked to is not really dependent on the guitar - I can get that noise with a Les Paul, and Ibanez or a Charvel just as easily. What you will need is the right guitar effects. It sounds like they are using:

long reverb
digital delay
tube overdrive
compressor / noise gate
Comment: In the example video it sounds to me like it's being played on a guitar that has a humbucker in the neck position, given the darker harmonics compared to a bridge pickup (I get the same kind of vibe from John Petrucci's playing when he switches to the neck pickup).  But generally, yes, this sound is not difficult to attain.


How to reference AngularDart component attributes outside of component scope

Question:
I've been tasked with creating a webapp using AngularDart. I'm new to Dart and therefore AngularDart also, but have worked through the tutorials at https://angulardart.org/tutorial/.
I've read similar SO questions/answers (How to access a AngularDart components attribute (NgOneWay) outside of the component, eg. on the page it is in?) but given my limited knowledge I don't fully understand how to implement Brian's suggestion - or if indeed it relates to my question! Am I also right in thinking that Vink's suggestion is now irrelevant as @Controller's are now deprecated?
In short, I'm trying to figure out if the following is in fact achievable:

create a top-level <custom-component/> complete with attributes;
within <ng-view/> - and therefore nested components - access <custom-component/>'s attributes. More specifically, bind/listen for changes to these attributes and act accordingly.

For example, given the following

    <custom-component att1="val1" att2="val2"></custom-component>
    <ng-view></ng-view>

and on the assumption that <ng-view/> renders the following markup

    ...
    <other-component att1="{{customComponent.att1}}" att2="{{customComponent.att2}}"></other-component>
    <another-component att1="{{customComponent.att1}}" att2="{{customComponent.att2}}"></another-component>
    ...

is it possible to bind customComponent.<<attributeName>> to <other-component/> and <another-component/>?
Or, as is likely, am I misunderstanding the use of AngularDart's @Component/@Decorator?
Should the @att1 and @att2 attributes be moved from <custom-component/> to <ng-view/>?
Alternatively, should I look to architect a different solution altogether? My ultimate goal in this instance is to provide the user with att1/att2 select boxes (from yet another component) which in turn determine the rendered content within each of <other-component/> and <another-component/>.
Any and all suggestions welcome, I won't be offended if you dismiss any/all of the above!!!
My current development environment is as follows:

Dart SDK version 1.9.0-dev.8.0
angular 1.0.0

Many thanks, J
Answer: What you can do is to move the two components into the content(template) of a wrapper component and bind attributes of both components to fields of the wrapper element.
Usually a better way is to use events like shown in How to communicate between Angular DART controllers or Angular Dart component events (controllers have been merged with components since then)
Comment: thanks for the suggestion. I had read those articles but must not have understood. I'll take another look...
Comment: Just add a comment if you have specific questions.


What makes W1 (C80U) a tool steel compared to 1080 (C80) steel?

Question: I don't know why W1 is considered tool steel, if it's a carbon steel that has the same amount of carbon as 1080 steel. ISO calls it C80U, and 1080 C80, so they are very similar. So what makes C80U so special?
Answer: I doubt it is more than a name ,or call it 110 Class tool steel in US. I always wondered about the P 1 to 5 "tool steels" because they are ordinary low carbon low alloy steels.  One specific difference can be price; Something priced as a "tool steel" may have a different price from "AISI 1080 hot rolled ". I have not seen this in tool steels but I have seen it in pipe. When pricing 13 Cr pipe, two mills had substantially different prices ( same pipe). We found one mill called it alloy steel . The other mill called it "stainless steel" and added a much higher overhead to the basic cost of the pipe.


How do I sort digital photos and scans together in Lightroom 4?

Question: I have many images captured with a digital camera and many that I've scanned from negatives and stills. I use the Edit Capture Date... option to set the capture time of the scan. However, when I sort by capture date, the sorting is inconsistent between those that have the capture date in the EXIF data and those where I've set it manually (might be stored in EXIF as well). Any ideas about sorting these two types of images consistently?
Answer: You can use "Smart Collections" to automatically add images based on any field that you specify.
I suggest, tagging scanned prints as "negatives" or something and adding that to the Smart Collection using "Keywords"
Comment: I'd like to order the pictures in chronological order by capture date and have them be mixed in albums. I'm not sure how the use of smart collections helps. It's possible I'm not understanding you.


Why does radiation not need a medium to travel?

Question: I wanted to know how radiation moves in vacuum of space and why it doesn't need any medium ?
( Like sunlight reaching a planet )
Comment: See the following question on the Physics Stack Exchange: https://physics.stackexchange.com/q/19670
Comment: I'm not sure this question has an answer. Science has observed that electromagnetic radiation (including visible light) can travel through a vacuum, and we can use this observation to make predictions. In cases like this one, science doesn't really ask "why", since it would be like asking why do electrons and light display the wave-particle duality, why is matter made up of atoms, why is the nucleus of an atom made up of protons and neutrons, etc.
Comment: Why should it? Photons only travel in a vacuum. They alternate between photons and something else when traveling through a physical medium.
Comment: Your question will be likely closed here, but you've got your answer already. Next time try https://physics.stackexchange.com with pure physics problems.
Comment: I'm surprised people seem to be voting to close this based on it being Earth science. This is not a question about Earth science. It may not be on-topic here though.
Comment: @antispinwards - we only have limited canned close reasons, so often folks try to find the closest one to the reason they want.
Answer: Electric and magnetic fields can and do exist in a vacuum. Electromagnetic waves are just fluctuations in electric and magnetic fields. In a vacuum (meaning no charges or currents, which do require the presence of matter), then the solutions to Maxwell's equations are electromagnetic waves.
Answer: It's an interesting question which can get you quickly into deep physics.
The simple way to view it is the light being made up of photons, which can be viewed and act as particles. Then, when the photon interacts with another particle, phenomena occurs which make them look like oscillating - so from the wave domain - like interference for example. But this doesn't mean that before this interaction, while traveling through the empty space, there had to be some medium oscillating. Conversely, protons, electrons and others which we regularly look at as just particles also show wave behavior when interacting, which makes us a bit more comfortable about consistency in the building blocks of the universe.
The more complicated way to view it is to go further and find out how the photon or light wave "works" in more detail. There is one given answer that they are oscillations in the electric and magnetic fields. But then there's the question of what are the electric and magnetic fields and how do they go from point A to point B through nothing at all? And it quickly gets into quantum field theory and even the nature of spacetime.
I would say that it's safe to pack these quantum field mechanisms into the abstract notion of photon as particle, at least for a person which is not a theoretical physicist. Then theoretical physicists go into the quantum field bits, but these are themselves an abstraction over something else, it goes on and on.


A Term for a Character Trait

Question: This might be the wrong place or way to ask this question but I'll give it a shot. In Nathaniel Hawthorne's "Young Goodman Brown", the "protagonist" wakes up from a dream (or vision, maybe even reality) of all his religious towns folks members taking part in blatant evil deeds. The next morning, his perception of everyone changes to the point he (not exactly) distrusts everyone because of what he saw and eventually dies lonely due to his callous nature. Nathaniel made this in order to warn against this type of action or character trait but what is a term for this, this trait? This callous behavior due to an imperfect/changed perspective? Is it a combination of terms?
Comment: Afraid not about the English language and its usage. [psychology.se] maybe.
Comment: The 'protagonist' is acting *consistently* with his (faulty?) view of the townsfolk, but his *[hamartia](https://en.oxforddictionaries.com/definition/us/hamartia)* might have been presented as a *[tragedy](https://en.wikipedia.org/wiki/Tragedy)* (in the drama sense). I'm not sure this is exactly what you're after, though. Would you mind adding some extra information to your question to list the terms you've considered but rejected, and say why you rejected them? You can use the [edit] link to do this.
Comment: I'd probably say ask at a literature place, as they'll know the story better and are constantly analysing stories and their meaning.
Comment: This probably belongs on the Philosophy SE, and I'm afraid I haven't read the book (although now I would really like to). But I think the word for the character trait is **cynicism**.
Answer: How about misanthropy? = "a hatred or distrust of humankind" (Merriam-Webster).
Comment: Not exactly what I was looking for but a big step in the right direction and it will work. Thank you sir
Answer:
for the Cynic, conventions are often absurd and worthy of ridicule. The Cynics deride the attention paid to the Olympics, the "big thieves" who run the temples and are seen carrying away the "little thieves" who steal from them, politicians as well as the philosophers who attend their courts, fashion, and prayers for such things as fame and fortune.
cynicism (noun) ~ Believing that people are motivated purely by self-interest; distrustful of human sincerity or integrity.
...a cynical person is not necessarily either pessimistic or optimistic. The modern definition of the term focuses narrowly on human motivations. A cynic, according to Webster's Deluxe Unabridged Dictionary, is "a person who believes that people are motivated in all their actions entirely by selfishness."

A Term for a Character Trait


Performance testing of messaging system using Gatling

Question: I am looking to compare different message-queuing brokers like activeMQ, rabbitMQ and Kafka. Given that I'm new to this field, is it possible to test all of them using Gatling tool?
I am not sure that, what should be the process of performing these type of tests.
Is it like testing each of their source code with my script in Scala used by Gatling?
Answer: message queue performance can depend a lot on how you design the structures of your queues.
you should only really do a comparison when you have a representative schema that models the system you want to use. You wont learn much from trying to saturate queue.
you will also find that the queue client you use will effect performance as well as there a few different styles of client that suit lower or higher powered applications. This means using a tool to directly inject messages that isn't the same as the deployed system will give you different characteristics and may not be representative of the real world usage.
I would recommend a combination of modeling real input with real clients to ensure responsiveness (especially with react style clients) and use tools like gatlin to reach the prove the limits of the system e.g. throughput and concurrency.
Using both methods will give you a better understanding of how your application scales and how it feels for users.
Comment: depending on your application you might have multiple queues feeding each other, these will indeed have maximum lengths but also message will have TTL's and these will be set by clients and adjusted by listeners.
Comment: By "how you design the structures of your queues" you mean queue configuration? E.g., maximum message size Kafka broker can receive?


iPhone 4 Mail Usage Size Problem

Question: My email on iPhone 4 consumed 8 GB from usage.  I deleted all mail and the account and there's still 8 GB consumed.  I use STMP mail.  What else do I need to do?.
Comment: Did you empty your trash?
Answer: Did you restart the phone after you deleted the emails? If that doesn't work, try removing that particular email account, rebooting the phone and then re-adding it via
Settings App > Mail, Contacts & Calendar
Answer: The Apple Mail app likes to keep cache and data from your emails available offline. That is very helpful for viewing emails and their digital content when you dont have a strong signal, or have access to wifi.
There are some solutions that can help you out though:
Delete the mail account off of the iPhone. Then restart the iPhone and then re-add that email back to the iPhone.
Use the Gmail app for iPhone. The gmail app will keep the email size much lower than whats on your iPhone. The most I've seen the gmail app do for me is 400MB. Thats definitely a huge saving in contrast to 2.5GB.
Limit the amount of email that Gmail can allow the Apple Mail app to have access to. You will have to use the desktop to access this setting in gmail. You can log onto gmail.com, open the Settings page, click "Forwarding and POP/IMAP," and activate the "Limit IMAP folders to contain no more than this many messages" option. Set it to lets say "1000" and the Mail app won't be able to download more than the 1000 emails from your account. If you use multiple folders, then that 1000 emails applies to each folder.
These three should give you some options to test out and free up some of your storage that the Mail app is eating up.

iPhone 4 Mail Usage Size Problem


ICO: how to accept bitcoins, credit cards and fiat?

Question: A customer wants to launch an ICO which should accept contributions in Ethers, Bitcoins, and fiat via credit cards and wire transfer.
Anyone was able to solve this? I know that this isn't an Ethereum problem but it seems to be an issue for ICOs since most accept only Ethers.
Answer: Answer regarding FIAT - you can accept bank wire transfers with no problems. But a credit card is practically not possible since customer can initiate a refund within weeks after transaction.
Answer: Accepting currencies other than Ether is not impossible but requires a great deal of work.
It also requires a great deal of trust from your users/investors as you are bypassing the rules of your contract, so to speak.
Accepting Ether is easy and trustless since anyone can see the code of the contract and make sure that ehen they are sending eth the contract will assign them the corresponding amount of tokens.
Accepting anything else can be coded or done manually. Just process the payment, convert the currency to ether according to the current exchange rate and send that ether to the contract on behalf of the user (you must have them provide the Ethereum address they want to use).
I'm usually very wary of putting money on an ICO in anything other than ether. Nothing prevents them from getting the btc/usd and then not delivering my tokens.
And for the developer, this requires a lot of extra steps in terms of coding, regulatory measures, security,etc.


How does pledged PLEO delegates work?

Question: I have tried to look up the rules of the Democratic primary process. It seems that states have two sets of statewide pledged delegates: pledged at-large delegates and pledged PLEO delegates. What is the difference between those two?
Answer: The acronym PLEO stands for "Party Leader and Elected Official". Generally speaking, there are three types of delegates sent to the convention: normal delegates, who are chosen at the district level; at-large delegates, who are chosen state-wide; and PLEO delegates, who are like at-large delegates except they are hand-picked from the party leadership. The idea, ostensibly, is to give representation at the convention to local districts, the state as a a whole, and the party itself.
These delegates are all pledeged, meaning that they are expected to represent the choices and interests of the group that chose them. There are also automatic delegates (also called superdelegates) who are high muckety-mucks in the party: ranking DNC members, current or ex presidents, Democratic members of congress and Democratic governors, etc. These people are not pledged to support any particular candidate, but are free to use their best discretion.  See: Democratic delegate rules, 2020
Comment: Not as germane to the question, but it's perhaps worth noting that the superdelegtes do not get a vote in the first ballot at the convention this year.  They will only be invited to participate from the second ballot onwards.
Comment: Also worth noting that the DEMs changed their rules after 2016 in response to complaints that they had too many (unpledged) Superdelegates, who that year could vote in the first round.

How does pledged PLEO delegates work?


Ubuntu 16.04 LAMP MySQL dpkg install problems

Question: LAMP Ubuntu 16.04 MySQL server install problems
tried to set up LAMP system on Ubuntu 16.04 with the following instructions.
     howtoforge
     ubuntu_lamp_for_newbies
Apache and PHP installed and tested good.
MariaDB loaded and tested good, but could not get phpMyAdmin to work.
tried following LAMP installation instructions:
     digitalocean
     how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-16-04
tried removing and reloading.
     How install or uninstall half-installed mysql-client-5.6 on/from ubuntu 15.10?
     How install or uninstall half-installed mysql-client-5.6 on/from ubuntu 15.10?
 Richard Uijen has suggested: ( changed for server 5.7)

sudo apt-get --purge remove mysql*
sudo apt-get autoremove mysql*
sudo rm -rf /etc/mysql/
sudo rm -rf /var/lib/mysql/
sudo apt-get clean
sudo apt-get update
sudo apt-get install --reinstall mysql-server-5.7

Had package installation error ( messed up other package installs as well ), reported bug got previous issue reply with conflict be MySQL install and previous MariaDB install.
     https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1490071
     MySQL 5.6 refuses to install on systems that have had MariaDB 10.0 installed, preventing users from reverting to MySQL without manual
     intervention (aka mysql flag file system needs a redesign)
tried removing any references to both. (mariadb* and mysql* ) solved package error.
Tried reinstalling MySQL:
sudo apt-get install mysql-server

mysql-server is already the newest version (5.7.12-0ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up mysql-server-5.7 (5.7.12-0ubuntu1) ...
update-alternatives: error: alternative path /etc/mysql/mysql.cnf doesn't exist
dpkg: error processing package mysql-server-5.7 (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.7; however:
  Package mysql-server-5.7 is not configured yet.

dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured

No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                Errors were encountered while processing:
 mysql-server-5.7
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

current status:
mysql -u root -p

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

:systemctl status mysql.service
  mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: inactive (dead) (Result: exit-code) since Tue 2016-05-24 07:12:23 CDT; 2h 45min ago

 systemd[1]: Failed to start MySQL Community Server.

/etc/mysql does not exist.

At a loss now?
Comment: Maybe its a socket problem. Check out this post http://stackoverflow.com/a/8084959/2588576
Answer: I had this exact issue. Look in your /etc/mysql/ directory for a file with a "deb10flag" in the filename. (I can't remember exactly what the file  was named when I did this as it was a month ago.) I resolved it by removing the file with the debian10flag. This setting generated by the MariaDB installation (it sets the deb flag to version 10). I deleted /etc/mysql/ and cleaned out any trace of it from the bin. After doing all of that, there's a dependency issue with the mysql setup in the package repository. mysql-cli and mysql-server both depend on mysql-common. This is fixed (I think) by installing them in this order: (1) mysql-common, (2) mysql-cli, (3) mysql-server.
**I know this isn't clear. I'll reply with the exact steps that I used to fix   this (soon). But the issue concerns the deb10flag and the dependency issues.
https://askubuntu.com/a/766094/407584Same issue


WPF Style Hierarchy

Question: I have created a custom control, ColorToggleButton, which inherits ToggleButton.  In a corresponding .xaml file, a  for ColorToggleButton is specific via TargetType and BasedOn ToggleButton.

<ctl:ColorToggleButton Style={StaticResource SameContent} />

the old style seems to get wiped out completely and replaced with the new one.  I can  circumvent the problem by using BasedOn

<ctl:ColorToggleButton Style={StaticResource MyKey} />

but this seems counterintuitive to me, seeing as I wouldn't use the BasedOn attribute if I was applying styles to a normal ToggleButton or some other default control.  Is this the standard way of implementing your own controls?  Am I doing something horribly wrong?
Edit: The static constructor of ColorToggleButton is as follows:
static ColorToggleButton()
{
    DefaultStyleKeyProperty.OverrideMetadata(typeof(ColorToggleButton), new FrameworkPropertyMetadata(typeof(ColorToggleButton)));
}

Answer: In your control, did you provide static constructor with DefaultStyleKeyProperty override?
static ColorToggleButton()
{
            DefaultStyleKeyProperty.OverrideMetadata(typeof(ColorToggleButton), new FrameworkPropertyMetadata(typeof(ColorToggleButton)));
}

WPF Style Hierarchy


Why do you say "so do I"?

Question: Why is the order of the words in "so do I" or "nor do I" different from the normal order?
Comment: It's because they are auxiliary verbs. But you have accepted and upvoted a wrong answer.
Comment: The fact they are auxiliary verbs doesn't explain why _so do I_ is an acceptable English expression. Do you also say "When will I."? Also, you can just see which answer I accepted, not the ones I up-voted.
Comment: The use of "when" is a wh-movement, you can't extrapolate. "So do I" is the same as "When pigs fly, then do I go to work." There is an ellipsis in the "So do I.", so it's "When do you go to work?" "When pigs fly, then do I." is correct (although strangely elegant sounding).
Answer: With respect to information structure, this word order pattern seems to be equal to fronted adverbials, as in:

Into the room walked a man

The new information / focus follows the finite verb. Similarly, in "So do I", "so" refers to the proposition in the previous utterance, "do" is a dummy verb, and "I", the new information, comes last.
Comment: To add to this, for some reason these fronted bits generally need to express some kind of motion or have a spatial quality in order to be acceptable, e.g. "Down the hill rolled John", or "On the table lay an apple".  But something like "About the book talked John" is really not so good.  (This is not my own observation by the way; it's one of those quirks of English that come up from time to time in syntax discussions.)
Comment: Good catch on the similarity.
Comment: Is there any correlation with "off to bed I go" too?
Comment: I think this is wrong. See my answer for the rationale.
Comment: This is definitely wrong.
Answer: To agree with a positive statement:
We use so + auxiliary/modal verb + pronoun:
"I like tea without sugar.'
'So do I.'
To agree with a negative statement:
We use nor/neither + auxiliary/modal verb + pronoun:
"I don't like tea with sugar.'
'Nor do I.' or 'Neither do I.'
To disagree with a positive statement:
We use pronoun + auxiliary/modal verb + not (-n't):
"I like tea without sugar.'
'I don't.'
To disagree with a negative statement:
We use pronoun + auxiliary/modal verb:
"I don't like tea with sugar.'
'I do.'
Comment: That's a fine description, but doesn't explain why this is happening.
Comment: It is not a complete description either.  Also possible:

"I don't like tea with sugar."
"I don't either."

"I like tea with sugar."
"I do too."
Answer: @itrekkie:
I think you're on the right track.
Note that 'so' here has a different meaning from that it would have in the normal order ("I do so") - it means 'also', or 'as well' and it seems to me that it can have that meaning only when fronted. The fronting is clearly for emphasis, but that in itself is not enough to explain why the fronting is obligatory for that meaning.
"As do I" and "Nor do I" don't have "as" or "nor" displaced, but they still have the inversion, and it seems to be crucial to this "as well" meaning. You can say "As I do", but without that meaning; and for some people "Nor I do" exists, but it means "and I do not", rather than "I do not either".
"Do" is syntactically a full verb, but semantically it's a place holder. But it's not crucial here: "So have I" and "So am I" are normal.
Answer: This isn't related to the issue of fronted "adverbials" as @Arne's accepted answer suggests. Those "adverbials" are usually prepositional phrases, as in the example given, which come after intransitive verbs. They don't require an auxiliary verb, and they don't work with transitive verbs. Consider:

the plane flew over the fence --> over the fence flew the plane
the boy flew the plane over the fence --> *over the fence flew the plane the boy

You can, however, do the "nor flip" with transitive verbs, and it does require an auxiliary verb, for example:

nor will you see him again

You can do the same thing with a number of negative and limiting adverbs, and I think this is the pattern that nor belongs to.

never did I say such a thing
rarely is it on time
seldom can they be trusted

Although it is mostly like a conjunction now, nor began life as an adverb according to the OED. The first example with so doesn't fit this pattern well because so is neither negative nor limiting. Nevertheless, this is the closest fit I can see.
Comment: Your answer is about prepositional phrases, but _so do I_ is not a prepositional phrase; it doesn't explain why it would fits the same template.
Comment: How does what you say apply to _so do I_?
Comment: As I say at the end, it fits the template well. The only odd part is that it's hard to see why *so* should belong to the same group as *never, rarely, seldom,* etc.
Comment: No, the answer I'm arguing against is about prepositional phrases. I point out that the pattern works for clauses fronted by certain types of adverbs (*never, rarely, seldom,* etc.). I also point out that *nor* began life as an adverb. Finally, *so* is also, at times, an adverb, though not a limiting or negative one.
Comment: You wrote, "This isn't related to the issue of fronted _adverbials_ as @Arne's accepted answer suggests. Those _adverbials_ are usually prepositional phrases […]." _So do I_ is not a prepositional phrase.
Comment: And that is why it is not related to the issue of "fronted adverbials."
Comment: I see. Is it possible to have contrastive focus on nor, rarely etc. or do they have to be topical? My starting argument did not hold, but maybe the information structual properties were right?
Answer: What's going on here is the special role of auxiliary verbs:

"do, "have", "be", "can", "shall", "may", "must", "might", "will"

and tenses of these. And in addition, the archaic or unusual

"ought", "keep", "dare"

The main job of auxiliary verbs is to modify other verbs (when they stand alone, but that's a different meaning---like "to can" meaning to put stuff in cans), and they have the property that they are fronted in questions:

have you gone?
are you there?
can you say this?
shall we dance?
aughtn't you stay?
might we go?
may I be excused?
will we play?
must we play?

Also the archaic or idiomatic sounding:

Oughtn't you stay?
Kept you going to the mall?
Dare you believe this?
Need I say more?

The verbs are also fronted in various constructions that modify the verb

How quickly have you forgotten your promise.
Only thus can you see this ship.
In this manner shall we leave.
Thus ought you dance.
In this room will we play.
All this must you believe, and more.
Should I hold all this upon my shoulders, I will truly suffer.
In all my days, may I never see your likes again.
In the grandest fasion, so might we live.

The fronting property means that these verbs and modifiers which act to modify a second verb naturally occur before the subject, and then acquire their modifier meaning with the verb in ellipsis:

I see a boat
So do I.

exactly means "So do I see a boat". This is a grammatical sentence, just as

I see a goat.
So will I.

means "So will I see a goat". There is an ellipsis of the verb in this construction, leaving only the modifier.

I see a moat.
So should I.

Means "So should I see a moat." Again the ellipsis.

I can see a float.
So can I.

The motion is exactly the same as in the question. "Can I see a float?" and it doesn't work for verbs that are not auxiliaries, but where you introduce a "do". So

I ate the bread
So ate I.*

But

I ate the bread

If I'm hungry, so might I

I am allowed to go to the bathroom

So may I

I have to pee.

So must I.

These are all acting in the meaning of the verb ellipsis. The list above is the exhaustive collection of English things that appear before the subject.
Wikipedia gives the additional archaic or disfavored auxiliary verbs:

dare ("I dare go to the cave")
need ("I need eat this bread")
keep ("I keep going".)

So that the construction is "I dare go to the cave"/"So dare I", "I need drink the medicine"/"So need I" "I keep working"/"So keep I". But these are no good. The problem with these constructions is that modern English basically requires a preposition: "I dare to go to the cave", "I need to eat this bread", "I keep on going" (in the case of keep, the on is skipped) and then it's like "I walk to the cave"/"So do I", not "So walk I". This is explained here, and there are a few phrases that survive from the modal days of "dare", "need", and "keep":

"how dare he!" (Wikipedia)
"Dare you question me?"
"Need I stay out?"
"Need I go on?"
And as is his will, so keeps he all
So kept they going, past the mountains and the stream.
Comment: "Aught" is spelt "ought", and in modern English nearly always takes the infinitive with "to", at least in the affirmative. I would regard "thus ought you dance" as ungrammatical. "Keep" is not an auxiliary at all, as the term is usually understood, since it is followed by a participle."Dare I/he/they" and "Need I/you/he" are quite normal for many British speakers, including me, but not "So dare/need I".
Comment: @ColinFine: I agree with you, sorry for misspelling, but these are marginal cases. The "keep" occurs in this construction in many 16th century contexts, and should be considered archaic. "Ought to" is not auxiliary, but "thus ought you dance" is marginally acceptable to my ears, so I included it. I will edit to adress your concerns.
Answer: Explaining the surface behavior of this is easy, but describing why this is happening is a little harder. English generally has a SVO (Subject Object Verb) word order or syntax. The key concept here is that this word order is usually achieved through movement of words within the structure.
It's this structure I'm having trouble visualizing and this will require a lot more analysis to really figure out. If I had to bet, I'd say that first, this isn't an example of do-support insertion, that do here really is a verb, and that the so is its generated complement. Finally, instead of the regular movement to get our canonical word order, so is fronted (but why? again guessing, but to add emphasis to the agreement) to the position where I would normally move to, blocking its movement. do is tensed in its ordinary movement, and we end up with this strange word order.
Comment: "So" may be fronted syntactically, but as I pointed out in my answer, its meaning is quite different from the sentence with "so" unfronted.

Why do you say "so do I"?


usbOTG can I invert the D+ and D- diff pair?

Question: Can I invert the D+ and  D- in a USB OTG connection?, would it work? I know that in some protocols like PCIe you can do it, but Im not sure about usbOTG.
Comment: The signaling is still the same.
Comment: Yes there is some useful info there, but this is usbOTG so I believe that could be some changes.
Answer: The device on the other end of the USB OTG connection can still be a regualar USB 2.0 device.  Therefore, if you swap the D+ and D- signals, you will effectively be swapping the lines in the cable.
But just to explain here explicitly why this doesn't work, see the blurbs below from the OTG specification.  Basically, devices use pull-up or pull-down resistors on specific lines to identify themselves at initial connection time.  D+ and D- are therefore not identical in functionality and cannot be swapped.

5.1.6  Data Line Pull-down Resistance
When an A-device is idle or acting as Host, it shall activate pull-down resistors on both the D+ and D- lines. These resistors shall be within the range of 14.25 kΩ to 24.8 kΩ (RPD).  When an A-device is acting as a Peripheral, it shall disable the pull-down on the D+ line but shall not disable the pull-down on the D- line. The A-device is allowed to disable both pull-down resistors during the interval of a packet transmission, when acting as either Host or Peripheral.
5.1.7 Data Line Pull-up Resistance
When operating as a Peripheral, the A-device shall enable a pull-up (as defined in the USB 2.0 specification) attached to the D+ line. It is allowed to disable the pull-up resistor during the interval of a packet transmission.
Comment: Yes, It did't work, we were getting and error (there was a layout mistake),so we swapped the cables in an USB cable and then worked.
Answer: No, I'd say that in a generic case it wouldn't work. The end which is acting as the host would detect the other end to be a low-speed (1.5 Mbps) device and, if it supports low-speed communication at all, it will detect the other end to be a non-otg device and attempt to communicate with it at 1.5 MBps; the device end is expecting a 12 Mbps data packet or a high speed chirp and will not answer to the 1.5 Mbps enumeration attempt. And probably this is just one of many problems.


Copy an entire worksheet to a new worksheet in Excel 2010

Question: I have found similar questions that deal with copying an entire worksheet in one workbook and pasting it to another workbook, but I am interested in simply copying an entire worksheet and pasting it to a new worksheet -- in the same workbook.
I'm in the process of converting a 2003 .xls file to 2010 .xlsm and the old method used for copying and pasting between worksheets doesn't paste with the correct row heights. My initial workaround was to loop through each row and grab the row heights from the worksheet I am copying from, then loop through and insert those values for the row heights in the worksheet I am pasting to, but the problem with this approach is that the sheet contains buttons which generate new rows which changes the row numbering and the format of the sheet is such that all rows cannot just be one width.
What I would really like to be able to do is just simply copy the entire worksheet and paste it. Here is the code from the 2003 version:
ThisWorkbook.Worksheets("Master").Cells.Copy
newWorksheet.Paste

I'm surprised that converting to .xlsm is causing this to break now. Any suggestions or ideas would be great.
Answer: It is simpler just to run an exact copy like below to put the copy in as the last sheet
Sub Test()
Dim ws1 As Worksheet
Set ws1 = ThisWorkbook.Worksheets("Master")
ws1.Copy ThisWorkbook.Sheets(Sheets.Count)
End Sub

Answer: ThisWorkbook.Worksheets("Master").Sheet1.Cells.Copy _
    Destination:=newWorksheet.Cells

The above will copy the cells. If you really want to duplicate the entire sheet, then I'd go with @brettdj's answer.
Comment: I'd suggest copying the used range in preference to all cells.
Answer: ' Assume that the code name the worksheet is Sheet1

' Copy the sheet using code name and put in the end.
' Note: Using the code name lets the user rename the worksheet without breaking the VBA code
Sheet1.Copy After:=Sheets(Sheets.Count)

' Rename the copied sheet keeping the same name and appending a string " copied"
ActiveSheet.Name = Sheet1.Name & " copied"

Answer: I really liked @brettdj's code, but then I found that when I added additional code to edit the copy, it overwrote my original sheet instead. I've tweaked his answer so that further code pointed at ws1 will affect the new sheet rather than the original.
Sub Test()
    Dim ws1 as Worksheet
    ThisWorkbook.Worksheets("Master").Copy
    Set ws1 = ThisWorkbook.Worksheets("Master (2)")
End Sub

Answer: 'Make the excel file that runs the software the active workbook
ThisWorkbook.Activate

'The first sheet used as a temporary place to hold the data
ThisWorkbook.Worksheets(1).Cells.Copy

'Create a new Excel workbook
Dim NewCaseFile As Workbook
Dim strFileName As String

Set NewCaseFile = Workbooks.Add
With NewCaseFile
    Sheets(1).Select
    Cells(1, 1).Select
End With

ActiveSheet.Paste

Comment: BTW, you don't need to select the new workbook and sheet to paste, just use `NewCaseFile.Worksheets(1).Paste`.
Answer: If anyone has, like I do, an Estimating workbook with a default number of visible pricing sheets, a Summary and a larger number of hidden and 'protected' worksheets full of sensitive data but may need to create additional visible worksheets to arrive at a proper price, I have variant of the above responses that creates the said visible worksheets based on a protected hidden "Master".  I have used the code provided by @/jean-fran%c3%a7ois-corbett and @thanos-a in combination with simple VBA as shown below.
Sub sbInsertWorksheetAfter()
    'This adds a new visible worksheet after the last visible worksheet

    ThisWorkbook.Sheets.Add After:=Worksheets(Worksheets.Count)

    'This copies the content of the HIDDEN "Master" worksheet to the new VISIBLE ActiveSheet just created

    ThisWorkbook.Sheets("Master").Cells.Copy _
        Destination:=ActiveSheet.Cells

    'This gives the the new ActiveSheet a default name

    With ActiveSheet
        .Name = Sheet12.Name & " copied"
    End With

    'This changes the name of the ActiveSheet to the user's preference

    Dim sheetname As String

    With ActiveSheet
        sheetname = InputBox("Enter name of this Worksheet")
        .Name = sheetname
    End With

End Sub