Speeding up SQL spatial query gives spatial index error?

Question: I am trying to split polylines by points which have a small buffer around them. Currently I have over 370,000 lines and 320,000 nodes and the query is running really slowly (I've left it for 3 days and it still hasn't completed). I have tried forcing a spatial index using with (Index(SI_tempPD)) but I get the following error:

"The query processor could not produce a query plan for a query with a spatial index hint. Reason: Could not find required binary spatial method in a condition. Try removing the index hints or removing SET FORCEPLAN."

Below is the snippet of code that I'm trying to run when I get the error:
BEGIN INSERT INTO TempLines ( [linenum] ,[ogr_geometry] )
SELECT lines.[linenum] ,lines.[ogr_geometry].STDifference(points.[ogr_geometry].STBuffer(0.005))
AS ogr_geometry FROM dbo.TemplineData AS lines with(Index(SI_tempPD)) INNER JOIN dbo.[TemplineNodes]
 AS points ON lines.[ogr_geometry].STIntersection(points.[ogr_geometry]).STDistance(points.[ogr_geometry]) < 1
WHERE (lines.[linenum] <> points.[linenum]) END

Is there anyway i can speed up the query?
I also have a clustered primary key.  The execution plan shows that a filter takes up 36% of the cost and the insert takes up 64%
I'm using SQL Server 2008 (SQL server Management studio 10.50.1600.1)
Comment: You also asked this on [StackOverflow](http://stackoverflow.com/questions/28340208/sql-spatial-stintersection-spatial-index) -- in general, I believe cross-posting on multiple Stack Exchange sites is discouraged.
Answer: You must follow the rules. If your query does not hit every point in Microsoft's list, the spatial index will not be used by the query.
See https://msdn.microsoft.com/en-us/library/ff929109.aspx
One thing you are doing wrong: You must include in your WHERE clause a test that either excludes distances calculations that return null or has blah.STDistance(blah) < somenumber. It must be the first condition in the where clause. Putting it in the JOIN ON clause won't work.


What does 五牛更象 mean?

Question: In January 2021, China's Shaanxi Provincial Department of Culture and Tourism and China Cultural Center in Sydney jointly held an exhibition titled "五牛更象—陕西非遗印象展"at the China Cultural Center in Sydney. I haven't found any explanation for this phrase 五牛更象 online or in a dictionary. Does it possibly mean that five oxes are as good as an elephant (in power)?
Answer:
展览以中国传统生肖"牛"的形象为导引,分为"巧夺天工"、"秦韵天籁"、"秦人匠心"、"关中记忆"、"魅力体验"等五大版块

Guided by the image of the "ox" in the traditional Chinese zodiac, the exhibition is divided into five major sections, namely:

"Ingenious Craftsmanship"

"Qin's Sound and Music"

"Qin People's Ingenuity"

"Guanzhong Memory"

"Charming Experience"

五牛 refers to the five sections of the exhibition, each of the section is represented by an image of an ox (something like a mascot)
The exhibition was held in January 2021, near the end of the year of the rat in the Chinese Zodiac. The upcoming Lunar new year would be the year of the ox in February next month.
"五牛更象" was the title of the exhibition. It should literally mean "Five oxen (five sections of the exhibition) replacing the current symbol of Zodiac year. However, the subtitle of the exhibition is 陕西非遗印象展, therefore, 更象 strongly implies 更新印象 (renew impression)
It is not a common phrase but a once-off title of an exhibition. "五牛更象 -- 陕西非遗印象展" can be translated as "Five Oxen Renew Impression -- Shaanxi Intangible Cultural Heritage Impression Exhibition"
Comment: Thanks, so you mean the five oxen are the five sections provided in the exhibition? I need a little time to digest this.In 万象更新, it is the outlook that is changed, but here it is 五牛 to be changed, a little confusing.
Answer: 五牛更象 is the name of the exhibition of the ancient artworks that took place in Sydney to promote understanding and induce the interest of Austrians about the Chinese calture.
The central topic of the artworks was "牛", and the exhibition included five representative types of artworks of Qin Dynasty - 泥塑,皮影,刺绣,陶瓷,字畫等, to demonstrate the phenomenon (象/現象) of delicate changes (更/變化/變換) in expression between different artworks in delivering/expressing the same subject of the ancient Chinese Arts.

What does 五牛更象 mean?


cauchy sequence and uniformly continuous functions

Question:
 Which among is the correct choice .and please explain it.
Answer: a_n =1/n makes{a_n} as Cauchy sequence
f(x)=1/x^3 is uniformly continuous in (1,4) which is not a Cauchy sequence. Also , y_n = 1/ ( 1+( a_n)^2 = n^2/(n^2+ 1)(n^6) = n^8/(n^2+1)~n^6.
Hence y_n is also not a Cauchy sequence . so neither {x_n} nor {y_n } be a Cauchy sequence in R.
Answer: I assume "R" and "N" here mean $\mathbb{R}$ and $\mathbb{N}$?
In which a case a sequence is Cauchy iff it converges to some $p \in \mathbb{R}$ (without necessarily direct knowledge the value of $p$)
So just fix some $\{a_n\}$ convergent, $f(x)$ uniformly continuous for which $\{x_n\}, \{y_n\}$ do not converge.


Oil- or water-based polyurethane to refinish stair banister?

Question: I didn't know that water-based polyurethane was available as an alternative to oil-based until I saw it today at the store. I am refinishing a vintage stair banister and some surrounding trim. I wonder if I can expect equal (or better) outcomes if I use that or should go with the good old that has proven in the past in similar applications.
Comment: What's the "oil-based-paint" tag for?
Comment: @MonkeyZeus don't be pedantic
Comment: I'm not, the tag is misleading for anyone that likes to target and answer questions about oil-based-paint. Might not be a huge issue on DIY but it's a huge faux pas on Stack Overflow.
Comment: There is no `oil based poly` tag
Comment: At 300 rep you can [create new tags](https://diy.stackexchange.com/help/privileges/create-tags) yourself. Don't let my pedanticism stop you :-)
Comment: the biggest difference is the yellowing look of oil-based. the other considerations are situational or minor.
Answer: I've been prejudiced toward oil based polys for years, but having used water based polys on some projects that weren't all the important, I've been impressed.   Water based is much less toxic, easier to clean up, more environmentally friendly and actually does a pretty good job. Seems to dry quicker and more solidly than oil based.  It also seems to sand easily between coats.  Being water based, it does tend to raise the grain on the first coat, but that's easily sanded down with fine sandpaper.  I won't be using oil based poly anymore.
Answer: Because you used the word "vintage" I assume you care a little about the historic value and/or appearance of this, and while it's very much a matter of taste, I'd make a few recommendations:

Water-based is much easier to work with and, unless it's for a floor, kitchen table, or such, I don't like using oil-based.
Oil-based has a different look that you might find more "historical", and even more so if you use laquer or shellac instead of poly.
Experiment on an inconspicuous area if you can.
Join the Facebook Group "Historic Home Renovations".  Post pictures there of your existing woodwork.  Ask the question. The group is full of people who've done this many times and will recommend very specific products and brands (which is generally frowned on here).
Answer: I don't recall where I read this but oil-based polyurethane tends to build up gunk as the years go on. This is from humidity and people touching the finished product.
Apply 2 coats of oil first and then 1-2 coats of water for a durable gunk-free finish. I recently did this for some handrails and it came out great! Never apply in reverse; don't put oil poly on top of water poly.
Oil poly has always been revered as more durable so this gives you the best of both worlds.
Oil poly is useful for bringing out an amber glow in unstained wood.
The only downside of using just water poly is that if you don't stain the wood beforehand then it just has a cold and lifeless finish.
I refinished a bedroom floor 2 years ago and used 4 coats of water poly after staining and I really have no concerns about its durability.
Comment: @amphibient oil-based or water-based stain? If water-based then your only option is water-based poly, fyi. Yes, staining would seal up some of the pores. Apply the first coat of poly, let it dry, touch it and judge for yourself.
Comment: Your comment about the cold finish is probably dependent on wood species. I've been using water-based satin poly on some white oak, and it comes out absolutely beautiful. When I used the same on pine, I would agree, it did not great.
Comment: @PhilippNagel "Beauty is in the eye of the beholder" https://www.familyhandyman.com/article/water-based-vs-oil-based-polyurethane-floor-finish/
Comment: That's a lot of coats, how about 1 oil, 1 water?
Comment: @amphibient That's totally up to you. If the wood is thirsty then the first coat of oil will just get absorbed into the wood and you won't have a protective layer of poly until the second coat. Also if the grain raises then you'll want to sand it down lightly (220 grit) and re-apply. If your poly is riddled with bubbles then you'll want to lightly sand them down and re-apply. One coat of water poly will probably be fine if you do the oil properly. Judge the project as it progresses. Sounds like you're new to wood staining.
Comment: @MonkeyZeus I stained the wood, will that reduce the porosity?
Comment: @MonkeyZeus I used regular varathane that gave me a mild buzz when applying so I'm assuming oil but the can doesn't specify
Comment: @amphibient The new water stains have a distinct label and cost more so you would know if it was water: https://www.varathanemasters.com/-/media/DigitalEncyclopedia/Product/RustoleumUSA/CBG/varathane/water-based-stain/356435_0919_IWC_32oz_Varathane_WoodStain_Classic_WB_DarkWalnut_480x480.ashx but yes, the mild buzz is consistent with oil-based.
Answer: If I have a choice I will always choose the water-based sealer over the oil-based one. Years ago when water-based polyurethane entered the market it may have not preformed as well compared to it's counterpart.
I've found it can't be differentiated from oil once it has cured. The sheen's are exactly the same.
There is less toxic VOC's from water-based sealer.
Water-based sealers dry quicker thereby allowing more coats in less time.
There easier to apply because their less viscous. They "level" better so brush strokes are less noticeable.
Lastly, they clean-up with soap and water. There's no need to wash your hands with petroleum-based cleaner.
Comment: Use a barrier cream and things don't stick to your hands anyway - a professionals trick...


Excel Prefixcharacter in C# with OLEDB causing "Data type mismatch in criteria expression" error on UPDATE

Question: When updating an Excel file using OLEDB from C# I get the error "Data type mismatch in criteria expression" if the original file has a hidden PrefixCharacter (apostrophe in my case).  If I remove the apostrophe from the cells in the original file, my application works as expected and the data is updated without any errors.  Any suggestions on how to remedy this problem other than manually removing the PrefixCharacter before processing the file?
Answer: A few months ago I was having problems with OLEDB/Excel automation as well: then I happened to find EPPlus http://epplus.codeplex.com/, and since then I haven't used OLEDB or Interop with Excel.
It doesn't require Excel to be installed, but it only works with the Open Office Xml format (xlsx), if that's not a limitation for you I would recommend it.
PS: I found it here on SO back in December when I was having similar (and other) issues with Excel Create Excel (.XLS and .XLSX) file from C#.


Meaning of "send as sms when imessage is unavailable"?

Question: I want the option to "send as sms when imessage is unavailable" to turn off. But if it's on, does that mean it sends as SMS when imessage is unavailable on MY end (the sending end), the receiving end, or both? Example: while I had this option on, if I texted a friend whose phone was on airplane mode or off, it would go through as sms and not imessage. With this option off, if I imessage someone and their phone is on airplane mode/off, would it send as SMS because imessage is available on my end? Or keep it as an undelivered imessage because imessage is unavailable on their end??
Answer: The option to "send as sms when imessage is unavailable" refers to the sender side, meaning that if the sender is not connected to iMessage (i.e. offline), the message will be sent to the receiver as a SMS.
Example:
Sender is not connected to the internet / have bad internet connection and cannot connect to iMessage server, then their message sending to a registered iMessage receiver will be sent as SMS instead.
iMessage will not be used at all if the receiver is not an iMessage user.
iMessage will be sent if the sender has connection to iMessage server but the receiver does not have connection to iMessage. The receiver will receive the message the next time they connect to the iMessage server (when their connection is back).
Answer: This option means when a user with iMessage doesn't have an Internet connection or iMessage is disabled.
For example:
One day while chatting with a friend via iMessage your friend goes into a tunel and disconnects from the Internet, your iPhone detects that your friend is off-line. If the option "send as SMS when iMessage is unavailable" is enabled,
the messsage will be send as an SMS. If the option "send as SMS when iMessage is unavailable" is disabled, the message will only be sent as an iMessage when your friend comes back online.


Why does my Hoya seeds?

Question: I want to get my seeds from flowers Hoya but do not know how.
Answer: You have to wait for seed pods to form  - these won't form at all if there are no pollinating insects (if the plant is indoors  year round, for instance). If the pods do  form, they take some time to ripen, and you have to wait for ripening to take place before collecting the seed. Further information on that here http://www.international-hoya.org/propogation.asp

Why does my Hoya seeds?


MacBook Air 13" 2014 Turned off randomly, won't turn back on

Question: I was using my 2014 MacBook Air 13" (A1466) and the screen suddenly went black and the fans spun up to full speed. I have not been able to turn it on ever since, even after resetting the SMC and PRAM. Nothing happens when the power button is pressed, the backlight/screen doesn't come on, the fans don't spin up either. When plugged in, the orange light on the charger comes on.  What can I do to try fix my MacBook?
Answer: I don't think there's much you can do except for contacting Apple Support. You can test if the issue is with your display by using Target Disk Mode and booting up off of your Mac. This allows your Mac to act as a hard disk. To boot in Target Disk Mode, press T on your Mac when it is turned off. Then, you will need another Mac. Use a ThunderBolt cable to connect the Macs, restart the second Mac (the working one), and press Option while it starts up. If you see your Mac that doesn't work in the Boot Menu of your Mac that does work, then your computer still partially works and you can recover your data. If it doesn't then again, your best option is to replace the Mac or contact Apple Support.
Comment: I unfortunately don't have another Mac on hand and this one doesn't have a thunderbolt port either way, thanks though.


Will a photographic image be ruined in print if I use HDR toning in RGB mode and then convert to CMYK?

Question: I'm working in Photoshop CS5 and would like to use HDR effects for print work.
Comment: Converting to CMYK is an issue independent of HDR. There will always be some form of shift in conversion. Do note, however, that a lot of pre-press shops and printers prefer the images stay in RGB format. Check with your printer before converting.
Answer: It really depends on what you mean by HDR toning. HDR refers to a method of representing image data using a larger range of numbers than is normally provided for by using typical RGB 24 bit color (8 bits per channel). 8-bit channel color has a limitation of 256 discreet integer values, and HDR is 16 or 32 bit floating point both of which provide for significantly larger ranges of values.
Note that the total black and total white values in HDR are going to be the same as the black and white in normal RGB, so the larger pool of values are used for finer gradation between black and white.
In order to do offset printing, you are probably going to be limited to 8-bits per channel, so you are not going to be providing true HDR no matter what.
Converting to CMYK will change the potential color gamut, but whether this "ruins" the result is really a personal judgement. If you have a decently calibrated monitor which simulates CMYK "close enough" to what you see with the finished printed product, then what you see in your HDR toned images will also be pretty close to what you receive in print.
Unless you have a specialized GPU and monitor, all HDR images you see on your computer are not actually HDR, but rather calculated and immediately downsampled to 16-bit or 8-bit RGB. And if they are 16-bit RGB, you are probably seeing an 8-bit RGB representation of that because (again) your monitor probably only supports 8-bit per channel RGB.
Comment: Thanks Horatio. I'm not as tech-savvy as you but I think I got a sense of what you're saying there. I suppose, to explain myself more clearly, I would elaborate like this. Photoshop CS5 introduced and actual HDR window in its drop-down menu. However, this is only available in RGB mode. It has great presets that make for powerful effects. You can switch back to CMYK. I'm working on a Macbook Pro so I'm asking, should I expect the image to come out vastly different / distorted when printed?
Comment: there is a lot of uncertainty here without a calibrated monitor. What you see, regardless of mode is an 8-bit RGB image because this is the only thing that your monitor can display. All other modes: CMYK, greyscale, RGB-16Bpp, HDR is simulated. If you send a true HDR image for print work, and the printer's equipment does not need to downsample it, you might see a difference from what you expected, but otherwise the image is going to be printed downsampled. Again, if you have a calibrated monitor, you will probably get what you expect.
Comment: note also that you can probably get your printer to pull a 4x6 proof from a test file you provide fairly cheaply (or free if the sales guy is trying to woo you)


What is the correct way of logging in through services from android?

Question: I currently have an app in development where I use services 3 on drupal 7 to login to my site. I do this by simply passing in the username and password parameters to a json object and use httppost to post them to service endpoint. Using the response I grab the cookie and store it in sharedpreferences on android which is used in all the following requests. I have this cookie set to be used for several days so the user wont require login again. Do I have any reason to be concerned about the security of this (I dont store any passwords) and if so what are the extra steps I can take and how to beef up the security but still allow for users to remain logged in? I have played around with the oauth module a bit but it seems rather complicated to implement on both drupal side and android. If oauth is my best option what are the steps to take to implement it with drupal and android?
Answer: You can use Android AccountManager over https to be more secure.
Like this Drupal 8 Android app at https://github.com/onedrupal/One-Drupal-Android.
Answer: You should definitely be doing some sort of encrypted key exchange, otherwise someone could post the login info to their own server and respond with a positive result!
I've never used the module you're referring to, but Drupal bootstrap is VERY easy to set up.
Answer: I think logging in then using the session id as a key for authentication is ok there. However, to make it more secure, you should do all the API requests containing the session token over HTTPS.


Does Nexus 7 2013 have 3G support?

Question: Nexus 7 2013 has 4G support, but I can't find any information on 3G support. If I get a Nexus 7 4G model, can I use 3G?
Answer: The current New Nexus 7's only support wifi. They do not support any mobile data yet. But once they are released with mobile data support, you can count on them supporting older networks, like 3g (HSPA/HSPA+) as well as supporting 4g (LTE). LTE coverage is not wide enough for them to only support 4g.
Comment: At this very moment, Google offer nexus 7 4g model. Is it support old 3g network?
Comment: @mef_ NO, it doesn't.
Comment: I'm just guessing, but I'd be astonished if it _didn't_ support 3g, and 2g, and Edge.  I've never heard of a phone that didn't support the older, slower protocols.
Answer: Seems to support ONLY 4G.
Comparison of Nexus 7 2012 and 2013 versions.
Answer: Yes, it does support 2G (GSM/EDGE) and 3G (UMTS/HSPA+).
Source: https://support.google.com/nexus/answer/3248332

Nexus 7 (2013) Tech Specs (LTE)
North America and Japan:
GSM: 850/900/1800/1900 MHz
HSPA+: 850/900/1900/2100/AWS (1700/2100) MHz (Bands: 1/2/4/5/8)
LTE: 700/850/1700/1800/1900/2100 MHZ (Bands: 1/2/3/4/5/13/17)
Rest of World:
GSM: 850/900/1800/1900 MHz
HSPA+: 850/900/1900/2100/AWS (1700/2100) MHz (Bands: 1/2/4/5/8)
LTE: 800/850/1700/1800/1900/2100/2600 MHz (Bands: 1/2/3/4/5/7/20)

Note that it appears that there are two Nexus 7 2013 LTE models, which differ in LTE bands, but UMTS and GSM bands appear the same.

Does Nexus 7 2013 have 3G support?


Where can I find a list with beaches which include coordinates?

Question: I use World Weather Online marine API to get wave height of different beaches. This API provide data by coordinates and I need a list with coordinates of beaches.
Comment: Where (what beaches are you targeting)?
Comment: I am interested in US beaches
Answer: An all encompassing list of this information may be hard to find.  One option would be to compile your own list using a site like latlong.net or using something like Google Earth.  Just zoom in close and record the lng/lat coordinates.


Formal warning over late setup of AV equipment

Question: I was recently asked to setup AV equipment the following morning by my line manager as I was leaving the office. I expressed that I had no access to this building, but was informed that it would be open. The following morning it was locked! In-fact the building was opened by the requester, which therefore was late.
I was not impressed that I was there ready to set up the equipment and had no access. Two days later I received a key, one month later I'm put up for a formal warning for being late and disrespectful to the AV requester. I feel my line manager is to blame for this whole experience. But I'm the one with the warning! Have I been unfairly treated?
Comment: "I'm put up for a formal warning for being late and disrespectful" - *Were* you disrespectful? What did you say to the line manager after he was late?
Comment: "Have I been unfairly treated?" is a very opinion-charged question, which is difficult for us to answer with any authority.  After all, we only have one side of the story.  Perhaps refocus the question on a more objective goal, such as "how can I avoid being put in this situation again?" or "how can I appeal the formal warning?" (although that latter might fall into company-specific policy, not sure.)
Answer: Yes.   Go to your HR rep.   If you don't have a Human Resources rep, go to your boss.  If your boss doesn't fix it, go to his/her boss.    A formal written warning that stays on the record for something you were truly unable to avoid is wrong and can have negative career effects.
Having said that, we have your side of the story, and I don't mean to imply anything, but make sure you have your facts straight, and that you are not to blame for it in any way before you take it up the ladder.
Answer: Sorry to break this to you, you're in this position because it's partially your fault.

I expressed that I had no access to this building, but was informed that it would be open.

You were correct to mention about the access scenario, however, you accepted the "information" assuring you it will be available for you to access. That's where the problem starts. You are not suppose to "tailgate" whatever the reason might be (except in danger situation, which usually voids all other policies).. You could have told to make that "assurance" in writing (in a way that do not come off as harsh, rather, something like - "so that I can show that time to my boss that I worked" sort of argument).

If the exact reason in mentioned in the complain letter (being late on that day for that occasion), you're in luck. You can write a letter to HR / manager mentioning

The last moment request you received
The early arrival (if you've got any CCTV footage / punch-in time record, you can use that, if possible)
The dates when you were assigned access (later).

This will at least clear the scenario for you that you were not late. Once that is there, you can take this forward and mention that

you can only be late for something if you've been assigned something
and, you did not have access at "that" time, so the whole theory of "being late" does not hold.
Comment: Your tailgating argument doesn't make sense. My understanding is that the OP didn't have the ability to unlock the building first thing in the morning, not about regular entry access.
Comment: I don't see the OP's fault.  Requiring your manager to put everything they request of you in writing is inefficient and very likely will foster frustration in your manager.  It can lead to your manager feeling you mistrust him/her and create an adversarial relationship with one of the people you should least want to have that with.
Comment: @DavidK OK, you maybe right... Let me change.
Comment: @JohnSpiegel OK, my bad, I thought "line manager" is sort of "supervisor" and not direct manager. That said, I'm not asking to ask for an email for "everything". Only cases where things may go wrong, and/or something which is beyond the normal working territory.
Answer: As Keith mentions, we only know your story, but given what you've said, you were treated unfairly.  This reads like the requester was frustrated, you didn't respond in a fashion that made them happier--and perhaps there was nothing you could have said/done--and in that frustration they reported the situation.  It went up and came back down uncomfortably on your boss.  At this point, it reads as though your boss assigned the blame to you rather than supporting his team.
To the underlying issue, this is a huge red flag.  Your boss is more concerned with making him(?)self look good than advocating for his team.  Your boss gave you false information that put you in a bad situation then let you take the blame.  You are right to raise it to your boss, but you have to assess if the same boss who appears to have made you the scapegoat is going to take this as a challenge or do the right thing.  HR is an option, but it will likely come back to the boss.
Also, I'd suggest your replay the scenario and audit yourself.  How did you respond to the requester when the situation occurred?  I imagine you were both frustrated.  Did that show through in your actions?  That might have been why the write up happened.  But it should not have included access you were told to expect.


Is there a word for the "call of the closing door" / "closing opportunity"?

Question: "Vertigo" partially refers to the nausea caused by observing a void, or large drop, with the overtone of the "calling of the void".
Is there a similar word for capturing the feeling of strong pull towards deciding to "go for it", in the context of a soon-to-be-expired opportunity?
Comment: What is *naunesia* ?
Answer: I think the expression   seize the opportunity:   may convey the idea: (from TFD)

take advantage of an opportunity when offered.

My uncle offered me a trip to Europe, so I seized the opportunity.
Whenever you have a chance, you should seize the opportunity.

also the sayings:

leap at the opportunity (to do something) and leap at the chance (to do something);
jump at the chance (to do something); jump at the opportunity (to do something)

As for a term to define the sense of urgency to seize an opportunity : (from Wikipedia)

Fear of missing out or FOMO  is a form of social anxiety, whereby one is compulsively concerned that one might miss an opportunity for social interaction, a novel experience, profitable investment or other satisfying event.
Comment: Yes, seize the opportunity is really close. However, I want to convey the *wish* / urge to do, as opposed to the action of making the leap itself
Comment: You mean a word for the sense of urgency that makes you seize the opportunity?
Comment: Yes, that's what I'm looking for
Comment: +1 for FOMO. There's also 'taking the plunge', or you could say someone is 'itching' to do something.
Comment: Yes, 'seize the opportunity is really close.' and 'However, I want to convey the wish / urge to do, as opposed to the action of making the leap itself' do not construe.
Answer: The phrase "(it's) now or never" can convey the sense that you must do something now because you will not get another opportunity to do it. Some examples from recent news headlines:

"It's now or never": Britons scramble for residency in Spain and Portugal ahead of Brexit
My health scare made me think differently, coaching Barcelona became now or never
Production linked incentives: India's now or never manufacturing moment
"Now or never": Heritage group rallies to protect 100-year-old fire station in Welland
Comment: This is closer, probably because of the sense of immediacy conveyed. But does it describe the _urge_ itself, or just the evaluation of the situation obtaining?
Comment: @EdwinAshworth In some of the examples it's used to imply the motivation for a decision: Why are Britons scrambling for residency in Spain? Because they feel it's now or never.


How to stop recurring credit card charges?

Question: Suppose an individual is subscribed to a service that costs $3.00 per day. He uses his credit card to pay for this service. Also, suppose this individual wants to cancel his subscription but has forgotten his username and password for this service. He has tried contacting the merchant, but the merchant cannot locate his profile. What should this person do if doesn't want to keep being charged $3.00 per day?
Answer: A vendor accepting/taking ongoing payments should have the ability to find an account given the card number. Of course "should" doesn't always result in that actually happening.
The next step is to contact the card issuer, and give them the exact details. While I realize that one may have legitimate recurring billings on their card, this is the risk they take, that they may need to cancel the card and re-enter the new account with the other service providers. To be clear, the answer here is "you may need to cancel the card", but only after consulting with the issuer, and only as a last resort. They should be able/willing to block further charges.
Comment: Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackexchange.com/rooms/128141/discussion-on-answer-by-jtp-apologise-to-monica-how-to-stop-recurring-credit-c). Further comments on this answer will be removed with no notice.
Answer:
but the merchant cannot locate his profile

I'd say that's a justifiable reason to get your CC to reject new charges. Don't try to be evasive and cancel your credit card because if you stop paying attention to it then it can continue racking up charges from existing contracts.
If you were on a contract, 12 months for example, then the merchant can easily prove that these charges were agreed to by you.
Hopefully this means that the merchant got off their a$$ and located your profile so go ahead and re-contact the merchant.
Answer: This is obviously a sort of recurring payment and can be accumulated to a big amount, if not stopped. Even if the subscription is been stopped, the payment continues to get credited to the service provider's account. It will not be a deliberate case, the service provider, from where the subscriptions were made will not give any sort of attention to this. it is the sole responsibility of the cardholder to stop the payment.
In the case of the United States, Federal law provides enough provisions legally to withdraw your consent and you can put a halt to the recurring credit card-based payment. You can contact your card issuer over mail or phone or even by letter.  After giving the stop payment order, you can observe your bank account transactions and make sure the payment from that credit card has been stopped for that particular merchant.
In my limited knowledge, I don't think you have to cancel your credit card for this issue.


why did the extraction zone not save my soldier in xcom:EU?

Question: A mission went very badly. I my moved my last sane soldier back to the blue square near the plane and chose to abort mission. He was still KIA. Did I do something wrong?
Answer: Did you end the turn and see a prompt to leave the mission? The game should show you how many soldiers are evacuated and left behind.
Did choose to abort mission from the game menu? I do not know if the game is still supposed to respect soldiers being in evac zone, so it is either no, no one gets saved, or you may have misinterpreted evac zone boundaries and put the soldier right outside.
If you are sure the soldier was inside evac zone, and have aborted the mission via a special messagebox, this must be an unfortunate bug :-(
Comment: I had him in the zone but I did not end turn in fear of the enemy turn. I'll keep that in mind next time the mission falls apart, thanks.


How do I tell the size of my braking discs?

Question: Looking to replace my hydraulic disc brakes but intend to use the old discs. How do I tell the size of the discs to ensure I purchase the right brakes?
Comment: You need to match the mounting (6 bolt IS or Centerlock). As for telling the size, you can use a ruler to measure the diameter. Alternatively, I'm guessing these are the original brakes on the bike and you can look at the rotors spec'd OEM on the manufacturer's website. Or just walk into your LBS and ask them for a new rotor.
Comment: @Batman It seems the asker wants to keep their rotors and replace the callipers, whereas you seem to be advising about how to replace the rotors while keeping the callipers.
Answer: The disc that you are talking about is in fact called the rotor.
Rotor size is measured by diameter, ie. edge to edge through the centre. The size may also be etched on to the rotor which would be more accurate than measuring yourself. There are a number of common IS (International Standard) sizes of rotor from 140mm through to 203mm.
Callipers only come in one size but use various adapters/spacers to fit the rotor. Once you know what rotor you have you purchase a new brake set which may or may not include the adapter you need. Your current brake callipers would use the right size adapter for the rotor you are using, but may not be right for the brake you wish to purchase, companies have proprietary systems for attaching the calliper such as Avid's CPS which require special adapters or spacers.
Additionally there are two types of mounts for callipers post and IS. Most callipers are made to use post mounts while most frames still have IS mounts on the real dropout. An IS mount is like a fin with two holes in it while a post mount is two posts. IS adapters are used to allow the calliper to be fastened to the bike. Most recent forks are post mount.
Answer: It is usually marked at the rotor. Check that first.
Comment: Voting to leave - its a short answer but there's not a lot more to say.
Answer: As DWGKNZ says you could measure these. Alternatively, you could search online for your bike make/model & look at the specification. This would save you the time of taking the wheel off and measuring (and note front/back might be different sizes). This assumes that it has not been changed since you bought the bike.


how can I fix my Samsung Galaxy Y GT-S5360?

Question: All of my applications are forcing to close such as its home, messaging, play store services and others.I can't make changes or even open application drawer or home.I can only open my contacts and make a call.
Comment: If you don't know what being rooted is, then you probably aren't rooted. This means it is stock and would likely need a factory reset. Something likely became corrupted on the /data partition.
Comment: Is the device stock or rooted or a custom ROM? If it is stock, you will probably have to perform a factory reset. If it is a custom ROM or root, what were you doing before it happened?
Comment: i just uninstalled one application..then it automatically restarted and all of my applications are forcing to close except my contacts and call logs
Comment: What did you uninstall? And is the phone stock or rooted?
Comment: ..what do you mean rooted? i uninstalled cymera.. it's a kind of camera app
Comment: Factory reset will fix your phone for sure, there is no way of finding out what is going wrong without logs! Even with logs it is going to be hard to fix if it is the stock rom on an unrooted device.
Comment: factory reset did't work]
Comment: factory reset didn't work
Answer: As your device is stock, something likely became corrupted in the file system and a factory reset is about your only option. You will lose all your data, unless your phone will still communicate with a computer. If so, you may be able to use Kies to back up your data from the phone first.
To factory reset:

Enter recovery
Power off the device. Press and hold the volume up key and the home button while powering up the phone. Hold these keys until the Android recovery screen appears.
Use your volume keys to navigate to wipe cache partition. Press the power button to choose this option. This won't destroy your data and may allow it to boot normally. Select reboot system with the volume keys and press power. It will reboot and hopefully work. If it doesn't, follow the next step.
Enter recovery mode as described above. Select "wipe data/factory reset" with the volume keys and press power to select it. THIS WILL DELETE ALL DATA FROM YOUR DEVICE. BE SURE YOU BACKED UP ANYTHING IMPORTANT. Now reboot the system and it should be back to stock with everything working again.
If you used kies to backup your data, now you can restore it.


Can I see what I have already edited in a question?

Question: Here is my situation.  I started to edit a post a couple days ago and I clicked Save Edits, however the body did not meet the 6 characters changed guideline.  The edit was saved in a state with more than 0 but less than 6 characters changed.  I want to set the body back to the original state of 0 characters changed so that I can still change the title for that post which needs correcting but I have no idea what changed and I can see nothing which points out to me what I did change.  The body is very well stated and I cannot change 6 characters without putting words in the OP's mouth.  How do I see what I changed, or at least how do I restore the body so that I see exactly what the OP (or the last editor) wrote?
Comment: Do I have access to edit history if "You do not have edit privileges. Your edit will be placed in a queue until it is peer reviewed."
Comment: I'm not sure I understand. Are you saying that a *draft* was saved in this indeterminate state? If so, you should be able to get the original text from the edit history.
Comment: Why would it submit it as a genuine edit if it didn't meet the guidelines?  That doesn't make any sense.  Can you point me to the edit so I can reject it?
Comment: The question in question where I am stuck is http://stackoverflow.com/questions/1701853/javscript-how-do-i-get-timezone-codes-such-as-bst-gmt-cet-etc
Comment: I don't see any pending or accepted edits there. It looks like the text of both the question and the answer are the original text, so if you still want to change the title, edit away.
Comment: Ok, I just went ahead and made some random character changes to get past the 6 character body limit and it was accepted so this particular question has been solved.
Answer: You can either

Use another browser (say Chrome instead of Firefox), or
Clear cookies for the browser you are using (only for domain stackoverflow.com, if possible)
Comment: Does clearing the cookies clear the edit draft text?
Comment: No, that does not help the situation any. I logged in to Chrome (which I don't really use) instead of IE and I get the same error message. I then also tried Firefox.  Something else is remembering my previous action


Is the constant signal $x(t)=1$ bandwidth limited?

Question: A quick question I was asked by a friend for homework.
We have an LTI system and we needed an example for reconstruction and such...
Anyway, he asked me if the constant signal is bandwidth limited.
Since the Fourier Transform of a constant is $\delta(\omega)$ with a constant.
And for $\omega=0$ we will receive $\infty$ and for others, $0$
I think it is not because the signal is $\infty$, although bandwidth limited talks about $\omega$ axis only and there it is limited.
Will be happy to know, thanks!.
Answer:
Is the constant signal $x(t)=1$ band-width limited?

Yes.
For mathematical proof, the trick is that the Dirac delta function is defined only under integration, and you need to start from its Fourier transform, which is well-defined,
$$
f_\delta(t)=\mathscr{F}(\delta(\omega))=\int_{-\infty}^{+\infty} \delta(\omega)  e^{-j \omega t} d\omega
= e^{-j \omega t} |_{w=0} = 1
$$
Then, by the Fourier inversion theorem $F_1(\omega)=\mathscr{F}(f_\delta(t))=c \delta(\omega)$, with $c$ being a constant.
The question is how $X(\omega) = F_1(\omega)$ is used.
From the engineering perspective, you can only observe that constant signal $x(t)$ through a bandlimited system with response $H(\omega)$. Therefore, in most cases including LTI systems, the observed signal $y(t)$ has spectrum $Y(\omega=0)= c H(0)$ and $Y(\omega \neq 0)=0$, which can be proved by writing down the Fourier transform of the convolution and can also be loosely thought as $H(\omega) \times c\delta(\omega)$, that satisfies the bandlimited signal definition.
There is no problem of infinite power at $0$. You can do sampling, discrete fourier transform, system analysis and many more signal processing stuffs with such $y(t)$ that represents perfectly $x(t)$.
Answer: A signal is considered bandwidth-limited if its Fourier Transform (FT) is non-zero only within a finite range of frequencies. For a signal to be perfectly bandwidth-limited, its FT should exist and be zero beyond a certain frequency. This concept is crucial in understanding signal reconstruction, particularly when discussing the Nyquist-Shannon sampling theorem, which provides a criterion for perfectly reconstructing a bandwidth-limited signal from its samples.
When considering a constant signal, say $x(t) = C$ where $C$ is a constant, the Fourier Transform of this signal is indeed a Dirac delta function $\delta(\omega)$ at $\omega = 0$. This result suggests that the signal contains energy only at zero frequency. In other words, its spectral content is "limited" to a single point at $\omega = 0$.
However, there is a particular issue with your under standing of $\delta(\omega)$:
The Dirac delta function, $\delta(\omega)$ is not a function in the traditional sense of the term. The statement:

And for $\omega=0$ we will receive $\infty$ and for others, $0$

is wholly incorrect. The most rigorous definition of the Dirac delta is as follows:
$$\int_{-\infty}^{\infty}f(x)g(x)dx = f(0) \tag{1}$$
where any function, $g(x)$, satisfying the above Inner Product definition is an impulse. Hence, it is not unique. It can take tons of values at points other than $x=0$ and still satisfy eqn. $(1)$ as the area underneath a single point in a Riemann integral is $0$. So a better wording would be to say that its area is concentrated at $x=0$ rather than saying "And for $\omega=0$ we will receive $\infty$ and for others, $0$".
Comment: @BenShaines no, you din't get that right. Ahsan nowhere says that boundedness in the Y axis is relevant to whether it's bandlimited. Ahsan says that the concetration around $\omega=0$ is what counts for bandlimitation.
Comment: Hi, thanks for the explanation. Regarding the bandwidth, so you say the signal is indeed bandwidth-limited, but not perfected since its Fourier transform is not bounded from $Y$ axis. Did I understand correctly?......... Regarding the energy, yea...... regarding the incorrect, I understand what you say, but basically, according to definition, it is $\infty$, so I really am troubled  now :\...............
Comment: Oh I see, thanks! sorry for the confusion


The amount of potential energy at the height of h

Question: When we lift an object upwards with a constant velocity for a distance of $ h $ the work that we've done is $mgh$ and the work done by the force of gravity is $-mgh$. So the net work on the object is zero and it doesn't gain any energy. how its potential energy will be converted to kinetic energy when we drop that object while it hasn't gained any energy?
Answer: The total work done on the object is the change in kinetic energy:
$W_{total} = \Delta E_K$*
While the gravitational potential energy of the object is:
$U_G = mgh$
So, although it costs energy to lift the object up, the total work done on it is $0$ because both at the beginning and at the end it has no kinetic energy ($v_{i,f}=0 \rightarrow E_{K_{i,f}}=0 $).
However, that doesn't mean that:

it doesn't gain any energy.

The work done on the object was converted to potential energy:  $\Delta E = \Delta mgh$, and when the object is dropped the potential energy is converted back to kinetic energy.
*That's not the definition of work, but the total work done on the object.
Comment: Work in this context is done against the object's weight under gravity, which is a conservative force, and is equal to the difference in **potential** energies between the start and end points, not a difference in kinetic energy.
Comment: @JamesCowley That's exactly what I said. It's equal to the difference in the potential energy, or in other words to the change in mechanical energy if there is no any other force.
Comment: You said "work is a change in kinetic energy" which can be interpreted to mean that's the definition of work, which it isn't. It so happens that in this case the difference in potential energy is equal to the difference in kinetic energy but that's not its definition.
Comment: @JamesCowley you're right. I edited my answer to fit. I hope it's better now.
Answer:
So the net work on the object is zero and it doesn't gain any energy.

The object obviously did gain energy. The object's potential energy increased by $mgh$, and its kinetic energy didn't change. So what's going on? Is the work-energy principle wrong?
The answer is no, the work-energy principle is not wrong. The work energy principle merely says that the net work on an object is equal to its change in kinetic energy. It says nothing (yet) about the relationship between net work and the change in mechanical energy. To get that, you need to invoke conservation of energy.
The object isn't an isolated system; you acted on it by lifting it from the floor to the table. Since the object isn't an isolated system, it is invalid to conclude that net work being zero means no change in energy. You transferred energy to the object. In other words,
$$\Delta E = \Delta KE + \Delta PE = W_\text{net} + \Delta PE = W_\text{ext}$$
where $W_\text{ext}$ is the work done by you on the object.
If you redraw the system boundary to include you, the object, the Earth, and the table, the act of lifting the object from the floor to the table becomes internal. This is an isolated system. Assuming for the moment that your body burns glycogen perfectly (i.e., ignoring thermodynamics), the work-energy principle combined with conservation of energy says that there is no change in mechanical energy with this enlarged system boundary. Now you can say that no net change in kinetic energy and no net change in total energy means no net change in potential energy. Potential energy is now gravitational potential energy of the object plus the chemical potential energy of those stored glycogens. You burnt some glycogens to lift the object. Taking thermodynamics into account means burning more glycogens to account for the energy transferred to the object and the inefficiency of your muscles. Energy always balances.
Answer: Gravitational weight is a conservative force so work done against it is entirely equal to the change in potential between the start and end points (in the absence of dissipative forces like friction). The internal energy of the mass does not change as it is moved upwards and your assessment of the energy considerations is correct.
Consider alternatively the forces before conversion to work:
The weight of the object is $F_g = mg$
Since you're raising the mass at a constant velocity, the force you apply to lift it is equal and opposite to the above, i.e. $F_l = -F_g = -mg$
This produces zero net force on the mass and so zero net work. It continues to move at constant velocity and its internal energy does not increase.
When you stop applying your lifting force $F_l$ the mass experiences only its weight $F_g$, producing a non-zero resultant force, which then performs work on the mass as it moves from the area of high potential to the area of low potential (i.e. falls downwards).
The work done by this force up to a given moment in its fall is $W_{fall} = F_g \Delta h$ (where $\Delta h$ is the distance the object as fallen since being released), and is equal to the kinetic energy of the object at that exact moment.
Answer: Gravity doesn't do -mgh work on the object while it is lifted, gravity converts the potential energy gained while lifting the object (mgh) into kinetic energy (1/2 mv^2) after it's dropped.


Is Primecoin mining competitive?

Question: Meaning, if more people mine Primecoin, does it get harder to mine? From what I understand, it shouldn't, but I want to be sure.
Answer: Primecoin mining is doubly competitive (in the sense you described). In fact, the amount you will mine with given power is inversely proportional to the cube of the total network compute power.
As in Bitcoin, a difficulty parameter adjusts based on the mining rate to achieve a desired block frequency. Not only that, but the mint rate is inversely proportional to the (square of the) difficulty. Unlike Bitcoin which has a fixed schedule, which at worst can be slightly accelerated with increasing mining power, in Primecoin the total number of coins that will ever be generated will decrease with increasing competition.
Comment: Can you explain how the minting algorithm works a bit more please?
Comment: @Shamoon: You mean the part where the greater the difficulty, the less the amount minted per block? I think it's simply that in each block, the new generated coins are defined as constant / difficulty ^ 2.

Is Primecoin mining competitive?


How to write files in c# as an administrator?

Question: I have c# program which writes an xml file to "C:" disk. I published my program as one click package because it's for test purpose only. But the problem is the one click package doesn't have "run as admin" option. So how can I solve this problem ? Any idea ?
Answer: The correct solution is not to force administrator elevation to bypass the built-in operating system security.
The correct solution is to fix the broken program. Even though it's just a test program, it should be written correctly.
See this SO question and the answers for more details. Even though it deals with the Program Files folder instead of the root, the underlying problem and solutions are identical.
Answer: I don't know if this works with One Click Deployment, but you could try to include an Manifest with your executable to request that the application is run with higher privileges.
See Create and Embed an Application Manifest (UAC).


Can quantum computers be used to solve P = NP

Question: The P versus NP problem is a major unsolved problem in computer science. It asks whether every problem whose solution can be quickly verified can also be solved quickly. It is one of the seven Millennium Prize Problems selected by the Clay Mathematics Institute, each of which carries a US$1,000,000 prize for the first correct solution. My question is, can a quantum computer be used to solve P = NP?
Comment: Please see https://www.cs.virginia.edu/~robins/The_Limits_of_Quantum_Computers.pdf here
Comment: see https://cs.stackexchange.com/q/73864/26286
Answer: I see maybe four (4) ways to interpret the question.

The first asks whether we can use a quantum computer to efficiently solve $\mathsf{NP}$ problems.  The class of problems efficiently solvable by a quantum computer is called $\mathsf{BQP}$, and so the question would ask whether $\mathsf{NP}\subseteq\mathsf{BQP}$.  As is indicted in the comments, quantum computers are not known to efficiently solve arbitrary $\mathsf{NP}$ problems, and are suspected not to be able to.

The second asks whether a proof that $\mathsf{NP}\subseteq\mathsf{BQP}$ would suffice as a proof that $\mathsf{P}=\mathsf{NP}$.  Although $\mathsf{P}\subseteq\mathsf{BQP}$, such a containment does not necessarily follow.  For example, there may be problems in $\mathsf{BQP}$ that are not in $\mathsf{P}$ or even in $\mathsf{NP}$ - a famous candidate being related to knot theory.  I don't think you'd win the Clay \$1M for such a containment. (You might get other riches, but that's a different story).

The third asks whether a proof that $\mathsf{NP}\not\subseteq\mathsf{BQP}$ would suffice as a proof that $\mathsf{P}\ne\mathsf{NP}$.  However, even this does not follow.

The fourth interpretation asks whether a quantum computer could provide any leverage in answering the question of if the classical complexity class $\mathsf{P}$ is equal to $\mathsf{NP}$.  That is, could one pose the $\mathsf{P}$ vs. $\mathsf{NP}$ problem as a a problem to be fed through a quantum computer?  Although this may be interesting, I doubt one could envision a way to ask such a finite question.

The "standard model" that many people believe is that $\mathsf{P}\subsetneq\mathsf{NP}$, and further both $\mathsf{BQP}\not\subseteq\mathsf{NP}$ and $\mathsf{NP}\not\subseteq\mathsf{BQP}$ - that is, $\mathsf{NP}$ and $\mathsf{BQP}$ are incomparable.  However, we are likely far away from proving any.
Answer: Maybe.
Grovers algorithm can definitely be used to reduce the time complexity of NP complete problems to $O(\sqrt{2^n})$ ; which isn't polynomial but is a lot faster. But the relationship between BQP and NP is unknown. For all we know $PH \subseteq BQP$ could be true.
It's thought to be unlikely but we cannot rule it out and in my opinion its useless to speculate without a proof.
Comment: Welcome to QCSE. What evidence do you have that BQP is in NP? I think many people believe that there are problems in NP that are not in BQP, such as 3SAT, while there are many problems in BQP that are not in NP, such as calculating the Jones polynomial. That is, the two classes may indeed be incomparable.
Comment: It is very fun and reasonable to speculate about the relation between BQP and NP.  In particular this has led to a couple of recent breakthroughs.  For example I really like [this](https://www.quantamagazine.org/graduate-student-solves-quantum-verification-problem-20181008/) Quanta magazine article on Mahadev's approach to classical verification of BQP proofs, and also [this](https://www.quantamagazine.org/finally-a-problem-that-only-quantum-computers-will-ever-be-able-to-solve-20180621/) article on Raz and Tal's breakthrough on whether BQP$\subseteq$PH.
Comment: @Mark S My mistake. There are BQP problems outside NP. But we really don't know much about BQP. For all we know $NP ⊆ BQP$ or even PH⊆BQP. could be true. More research needs to be done as Quantum computing is very new. It's not ruled out that we find an NP complete problem in BQP. Or we find a problem outside of NP in BQP. But to my knowledge, all current exclusive BQP problems are known to be in NP but not NP complete. But in my opinion its somewhat useless to speculate without a proof. We have been wrong about math before. And there is no reason to believe we couldn't be again.
Comment: @Mark S I meant not to assume the relationship between BQP and NP without a proof. Asking that question can lead us too other results, but it should not be done idlely. Math has given us some big surprises before and there is no reason to think it won't do so again. See the negative answer to the Entscheidungsproblem. That was a big surprise at the time. Again not saying that it is or isn't. I'm saying its useless to assume either way without a proof.
Comment: One concept: nonlinear quantum mechanics. It seems we still have no experimental evidence it's possible at all.
Comment: Well, we also don't have any experimental evidence of time travel or superluminal communication or perpetual motion…


When do Extension Methods break?

Question: We are currently discussing whether Extension methods in .NET are bad or not. Or under what circumstances Extension methods can introduce hard to find bugs or in any other way behave unexpectedly.
We came up with:

Writing an extension method for types that are not under your control (e.g. extending DirectoryInfo with GetTotalSize(), etc...) is bad, because the owner of the API could introduce a method that hides our extension - and might have different edge cases. For example testing for null in an extension method will automatically translate into a NullReferenceException if the extension method is no longer used due to hiding.

Question:

Are there any other dangerous situations than "hiding" that we are not thinking of?

Edit:
Another very dangerous situation.
Suppose you have an extension method:
namespace Example.ExtensionMethods
{
    public static class Extension
    {
        public static int Conflict(this TestMe obj)
        {
            return -1;
        }
    }
}

And use it:
namespace Example.ExtensionMethods.Conflict.Test
{
    [TestFixture]
    public class ConflictExtensionTest
    {
        [Test]
        public void ConflictTest()
        {
            TestMe me = new TestMe();
            int result = me.Conflict();
            Assert.That(result, Is.EqualTo(-1));
        }
    }
}

Notice that the namespace where you use it is longer.
Now you reference a dll with this:
namespace Example.ExtensionMethods.Conflict
{
    public static class ConflictExtension
    {
        public static int Conflict(this TestMe obj)
        {
            return 1;
        }
    }
}

And your Test will fail! It will compile without a compiler error. It will simply fail. Without you even having to specify "using Example.ExtensionMethods.Conflict". The compiler will walk the namespace name and find Example.ExtensionMethods.Conflict.ConflictExtension before Example.ExtensionMethods.Extension and will use that without ever complaining about ambiguous extension methods. Oh the horror!
Comment: I had to try out an example of a new member hiding an extension method without a peep from the compiler before I would believe it! I think D got this right with its notion of "overload sets".
Answer: Some curiosities:

extension methods might be called on null instances; this might be confusing (but sometimes useful)
the "hiding" issue is a biggie if they have different intent
equally, you might get a different extension method with the same name from 2 different namespaces; if you only have one of the two namespaces, this could lead to inconsistent behaviour (depending on which)...
...but if somebody adds a similar (same signature) extension method in a second namespace that your code uses, it will break at compile time (ambiguous)

(edit) And of course, there is the "Nullable<T>/new()" bomb (see here)...
Answer: I disagree, the whole point of extension methods is to add your members to black boxed classes. Like everything else there are pitfalls, you must be mindful in naming, implementation and understand the pecking order of the methods.
Comment: The argument could be made that static helper classes are just as useful in that particular scenario - and far less dangerous.
Comment: @Tobias In the end  that's what it compiles too, a static class. If an extension method and a instance method have the same name the compiler has to make a decision. There is an elegance to extension methods.
Answer: One breakage we've just found in the MoreLINQ project: if you write a generic extension method, it's impossible to make sure it will work with all types. We've got a method with this signature:
public static IEnumerable<T> Concat<T>(this T head, IEnumerable<T> tail)

You can't use that with:
"foo".Concat(new [] { "tail" });

because of the string.Concat method...
Comment: Often it will actually be better to call the extension method statically
Answer: I've used Ruby on Rails for almost as long as I've used C#.  Ruby allows you to do something similar to the new extension methods.  There are, of course, potential problems if someone named the method the same, but the advantages of being able to add methods to a closed class far outweigh the potential dissadvantage (which would probably be caused by bad design or poor planning).
Answer: One thing you can do to make sure extension methods don't conflict with other methods (extension or otherwise) is to use FxCop with rules such as Prevent Duplicate Extension Method Signatures.
Answer: What .Net calls extension methods are also a limited form a MonkeyPatching (try to ignore the php rant in there).
That should give you some material for your discussion.
Answer: First of all I believe your wording is a bit misleading. I take it you're talking about "types" and not "objects".
Secondly, the big advantage of extension methods is that you can add features to type you don't control. If you control the type, why not just modify the type instead of relying on extension methods?
Comment: thanks for the object -> type geek grammar error.

The advantages are well understood. We are looking for dangers.
Answer: We took the attitude in my team that Extension Methods are so useful that you can't realistically ban them, but so dangerous (principally because of the hiding issue) that you have to be a bit cautious. So we decided that all Extension Method names have to be prefixed with X (so we have a bunch of XInit...() methods to initialise controls in useful ways, for instance). That way a) the likelihood of a naming collision is reduced and b) the programmer knows he is using an Extension Method and not a class method.

When do Extension Methods break?


What is the complex conjugate of two fermionic fields coupled? $(\bar{\psi} \chi)^{\ast} =$ ____?

Question: Suppose $\psi$ and $\chi$ are fermionic fields, and suppose I want to calculate the hermitian conjugate of the operator $\bar{\psi} \chi$
$$
h.c.\ \mathrm{of}\ \bar{\psi} \chi = (\bar{\psi} \chi)^{\ast}
$$
I recently asked a question here which states that fermion components anti-commute (since they are Grassman-valued). This leads me to calculate
$$
(\bar{\psi} \chi)^{\ast} = (\psi^{\dagger} \gamma^0 \chi)^{\ast} = (\psi_{a}^{\ast} \gamma^0_{ab} \chi_{b})^{\ast} = \psi_{a} \gamma^{0\ast}_{ab} \chi_{b}^{\ast} =! - \chi_{b}^{\ast} \gamma^{0\ast}_{ab} \psi_{a} = - \chi^{\dagger} \gamma^{0\dagger} \psi = - \bar{\chi}\psi
$$
where I have used $\gamma^{0\dagger} =\gamma^0$, and also I've used the anti-commutation of fermion components where the "!" is. This seems to suggest that
$$
\bar{\psi} \chi + h.c.= \bar{\psi} \chi - \bar{\chi} \psi
$$
which doesn't seem correct to me, because swapping $\chi \to e_{R}$ and $\psi \to e_{L}$ I know should yield $\bar{e}_{R}e_{L} + h.c. = \bar{e}_{R}e_{L} + \bar{e}_{L}e_{R}$ (see equation (56) of this document, of this document, for example).
Comment: Related: https://physics.stackexchange.com/q/695933/2451 and links therein.
Answer: $$
(\psi_{a}^{\ast} \gamma^0_{ab} \chi_{b})^{\ast} = \psi_{a} \gamma^{0\ast}_{ab} \chi_{b}^{\ast}
$$
is not correct. Rather
$$
(\psi_{a}^{\ast} \gamma^0_{ab} \chi_{b})^{\ast} =\chi_{b}^{\ast} \gamma^{0\ast}_{ab} \psi_{a}= - \psi_{a} \gamma^{0\ast}_{ab} \chi_{b}^{\ast}
$$
Note that the Hermitian is defined as
$$
(AB)^\dagger = B^\dagger A^\dagger
$$
Note that there is no minus sign even if both $A$ and $B$ are Grassmann-valued.
See related post here.
Comment: @Greg.Paul, I am with you. The difference seems ad hoc and arbitrary to me too! But most mainstream physicists seem to be OK with it.
Comment: Okay from your link I'm concluding that for Grassman-valued objects we have $(AB)^{\dagger} =B^{\dagger}A^{\dagger}$ and $(AB)^{T} = - B^{T} A^{T}$. Is there a simple explanation why the difference? The link https://physics.stackexchange.com/q/388079/ has an explanation for $(AB)^{T} =-B^T A^T$, but why would this same procedure not end up in $(AB)^\dagger = -B^{\dagger}A^{\dagger}$? (I am having trouble following the logic of your provided link)


How can I see how many processor cores are working?

Question: I have quad-core processor system. I was using Windows before installing Ubuntu. Windows by-default was using 1 core* and I could change that with msconfig. How can I do this in Ubuntu or is it necessary?
Windows was using one core for booting.
Comment: I feel it's important to note that Windows wasn't only using one core. The entry in MSConfig is talking about how many cores it should use in the booting process, and I'm fairly sure it's only useful to *limit* that number. I see no reason why it wouldn't use all of them by default.
Comment: Windows uses all cores by default. The startup option in msconfig is for limiting the number of processors. When limit is not enabled, textbox shows "1" which might look like the current running value, but it's not. It's merely the minimum you can type there.
Answer: Type:
lscpu

in the terminal and press ENTER.
Now you have the info on cores used in your Ubuntu installation.
Comment: Also - whatch out the line ex.: `Core(s) per socket:4`, it tells U the exact amount of Cores on the machine.
Answer: You can see the usage of your CPU cores using top command.

Open a Terminal.
Type top. You will see some information about tasks, memory etc.
Type 1 to show individual CPU usage. You will see something like:

To start a new process which should execute only in one core, you can use taskset command.
taskset -c 0 executable

To monitor the existing process's CPU affinity, you can use this command:
taskset -cp $(pgrep -f executable)

note that the executable identity you will pass to this command can be './executable' if you started it that way.
Comment: This is a good answer, because it makes use of the top command which we always use anyway. I also never knew about taskset.
Comment: [jalal@ivcgpu1 divided]$ taskset -cp $(pgrep -f executable)
taskset: invalid PID argument: '-cp'
Answer: As you have not specified your Desktop environment I will assume you are using Using Ubuntu
For a graphical way to check your cpu usage, search your system for an application called System monitor.
The Resources tab will show activity of each core

Whilst the Processes tab will show cpu usage for individual programmes.
Answer: htop tool provides graphs for cpu core(s) usage
install htop via terminal:
apt-get install htop

run htop via terminal:
htop

Comment: I recommend expanding this to explain how to use it for that purpose and to show what it looks like (when used this way).
Comment: You have not even mentioned how to install it, as it doesn't come with the system.
Comment: Nice complement to `top`!
Answer: Sensors does this too, but it also tells you the temperature the cores are running at, very cool.
Type sensors in the terminal and it will tell you if you already have it installed, once it's installed you just write sensors


How does the expanding universe affect quantum fields?

Question: The universe is expanding. It then seems logical to say that the QM fields are expanding as the universe expands. My question is how does this happen? When I consider an expanding field it forces me to consider the actual properties of the field. Are the QM fields becoming less dense or are these fields only mathematical constructs that enable predicts to be made. If the fields are not only mathematical then does their expansion require the creation of new field "stuff" to fill in the new space being created. QM mathematics is way out of my skill level so an answer that respects my curiosity and understands my limitations is appreciated.
Comment: There's a good discussion of this in Birrell & Davies, in which a plane-wave solution evolves in a universe with $a^2=A+B\tanh\rho\eta$.
Answer: Photons are quantum particles you get when the electromagnetic field is quantized. So consider the photons which make up the cosmic background radiation.  They were generated when the mean temperature was about 3,000 K, but now represent a temperature of about 2.7 K. They didn't "cool off", but instead their wavelengths increased with the cosmic expansion, which can be easily calculated as 1100 = 3,000 K/ 2.7 K, which is the expansion since the cosmos cooled below the hydrogen ionization level.
No fancy math is required, just experimental results.
Comment: Lest anyone overgeneralize this valid example, it gets a lot more subtle when you talk about bound systems such as a hydrogen atom. Spacetime curvature does theoretically have an effect on a hydrogen atom, but the effect is many orders of magnitude too small to be detectable.
Comment: As explained in the movie, Annie Hall: "Brooklyn is not expanding."  Obviously, Brooklyn is a bound system. :-)
Comment: @freecharly: photons are the quantized fields associated with the electromagnetic field.  As such, they are ideal exemplars of other unbound quantum fields.
Comment: @Lambda: all measurements of the speed of light are consistent with it being a universal value.  For more discussion, see http://math.ucr.edu/home/baez/physics/Relativity/SpeedOfLight/speed_of_light.html
Comment: So how does the expansion of the universe affect quantum fields? The photons are just electromagnetic waves. What about the other quantum fields?
Comment: As an afterthought, has there been any professional work done to see if the speed of light is related to rate of expansion? Seems like there could be a relationship.


Why are spins initially coherent after 90 degree pulse in NMR?

Question: In NMR we apply a 90 degree radio frequency pulse to the sample. This causes magnetization vector to fall into transverse plane. Then the relaxation of initial phase coherence occurs. Why are the spins initially coherent?
Answer: The spins are originally all aligned because they are all aligned with the magnetic field. So when you rotate all the spins 90º they are still all aligned but now at 90º to the magnetic field.
The spins lose coherence because they precess in the transverse plane at different rates so while they start aligned they become effectively randomly distributed in the transverse plane.
Comment: @Leonid [we need to continue this in the chat room](https://chat.stackexchange.com/rooms/71/the-h-bar)
Comment: Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackexchange.com/rooms/74388/discussion-on-answer-by-john-rennie-why-are-spins-initially-coherent-after-90-de).
Answer: I know this is kinda old but I find the answer of John is actually contradicting what I learned. My intuition was as well, that the loss of phase coherence is due to spins precessing around $B_0$ at different speeds. However, why would it then be, that large molecules like proteins or polymers show quicker $T_2$-relaxation, which is observable in broad lines? The common explanation for that is that big molecules have a slower tumbling motion, which in turn causes a broader range of frequencies emitted that are utilized by the dephasing relaxation mechanism (see fig. 8-1).
Now, this is only the why is coherence lost part and doesn't answer the original question of why phase coherence occurs in the first place. First and foremost, I can't tell you much more than 'because of quantum mechanics'. I can tell you however of why to my knowledge, John's answer is not only oversimplified, but wrong: Spin-$\frac{1}{2}$ particles (e.g. protons, the most common nucleus used for NMR) have two, and only two options of orienting themselves in a magnetic field. You do change the field slightly by your pulse, but your $B_0$ is way stronger and not turned off during the pulse. The only way I know to turn off $B_0$ is quenching, and for technical reasons it seems impossible to do otherwise.
So your spin, being forced into the two states, can only ever change between those, when EM radiation of suitable frequency comes along. Dictated by quantum mechanics, you cannot just rotate a spin by an arbitrary angle. There is flip the spin or nothing at all. The one and only way that John is right under these circumstances (and then still misleading for calling it a rotation), is when the angle between the spins and $B_0$ is $45^\circ$. I cannot find anything on this angle right now, but I am pretty confident that it's not $45^\circ$.


Scala type inference for existential types and type members

Question: The following piece of code does not compile :
trait A[F] {
  def find(x: Int): F
  def fill(f: F): Unit
}

object TestA {
  def test[T <: A[F] forSome { type F }](t: T) =
    t.fill(t.find(0))
}

It returns the following compilation error :
test.scala:8: error: type mismatch;
 found   : (some other)F(in type T)
 required: F(in type T)
    t.fill(t.find(0))
                 ^

However the following code complies just fine :
trait B[F] {
  type R = F
  def find(x: Int): R
  def fill(f: R): Unit
}

object TestB {
  def test[T <: B[F] forSome { type F }](t: T) =
    t.fill(t.find(0))
}

I have two questions here :

I expect the fist piece of code to compile. Why does it not?
If there is a good reason why first piece of code does not compile, I would expect the second to not compile either, for the same reason. How then, does it compile successfully?

Is either of these a bug?
Answer: I don't know why the compiler differentiates the two pieces of code. Basically, the code doesn't compile because the type returned by find and the type expected by fill don't have to be the same F, at least if find and fill were called on two different objects.
You could make the first piece of code to compile with:
def test[T <: A[F], F](t: T) =
  t.fill(t.find(0))

And you could make the second piece of code not to compile with:
def test[T <: B[F] forSome { type F }](t: T, u: T) =
  t.fill(u.find(0))

This should be rather a comment than an answer, but I don't have 50 reputation yet.
Answer: To understand what's happening, let's look at simpler versions of TestA.test and TestB.test.
object TestA {
  def test1(a: A[String]) = {
    val s: String = a.find(0)
    a.fill(s)
  }
}

object TestB {
  def test1(b: B[String]) = {
    val r: b.R = b.find(0)
    b.fill(r)
  }
}

Notice how the type of the intermediate value s refers to String, while the type of the intermediate value r does not.
object TestA {
  def test2(a: A[F] forSome {type F}) = {
    val s: F forSome {type F} = a.find(0)

    // type mismatch;
    //   found   : s.type (with underlying type F forSome { type F })
    //   required: F
    a.fill(s)
  }
}

object TestB {
  def test2(b: B[F] forSome {type F}) = {
    val r: b.R = b.find(0)
    b.fill(r)
  }
}

Once we throw in the existentials, we end up with an intermediate value s whose type is equivalent to Any, and which thus isn't a valid input for a.fill. The intermediate type for r, however, is still b.R, and so it is still an appropriate input for b.fill. The reason its type is still b.R is because b.R doesn't refer to F, and so according to the simplification rules for existential types, b.R forSome {type F} is equivalent to b.R, in the same way that Int forSome {type F} is equivalent to Int.

Is either of these a bug?

Well, there is certainly a bug somewhere (as of scalac 2.11.7), because the following does not type check.
object TestB {
  def test3(b: B[F] forSome {type F}) = {
    val r: b.R forSome {type F} = b.find(0)

    // type mismatch;
    //   found   : F
    //   required: b.R
    //     (which expands to)  F
    b.fill(r)
  }
}

So either I'm wrong to think that b.R does not refer to F, in which case b.R forSome {type F} is not equivalent to b.R and your TestB.test should not type check but it does, or b.R forSome {type F} is equivalalent to b.R, in which case my TestB.test3 should type check but it doesn't.
I'm quite convinced that the bug is with the latter, because the error even occurs when the existential quantification has nothing to do with b.R, as in the following example.
object TestB {
  def test4(b: B[F] forSome {type F}) = {
    val r: b.R forSome {val x: Int} = b.find(0)

    // type mismatch;
    //   found   : F
    //   required: b.R
    //     (which expands to)  F
    b.fill(r)
  }
}


Mathematical CNOT interpretation

Question: I used to think that CNOT flips amplitudes of the target qubit with the chance of $b^2$ where $b$ is the $|1\rangle$ amplitude of the control qubit. This yields that the final(after CNOT) state of the target qubit will be :
$$
\sqrt{a_1^2 a_2^2 + b_1^2 b_2^2} \big|0 \big\rangle + \sqrt{a_1^2 b_2^2 + b_1^2 a_2^2} \big|1 \big\rangle
$$
(the intuition is that with probability $a^2$ there is no flip, and with probability $b^2$ flip occurs)
But in fact, after two sequential applies of such a formula on the target qubit, such a qubit will not end up at the initial state. So either the upper interpretation is wrong or I've blundered the math somewhere.
If my interpretation is incorrect, could you please provide a correct one? If it is correct, help me please to derive it in probability terms and to understand how CNOT unitary matrix makes it work.
Answer: For a single CNOT operation, the simplest approach is to think in terms of Boolean logic.  Mathematically, this is usually represented by modular addition, which gives the action of CNOT as
$$\vert A, B \rangle \rightarrow \vert A, A \oplus B \rangle,$$
where $\vert A, B \rangle$ is the tensor product of $\vert A \rangle$ and $\vert B \rangle$, and $\oplus$ is addition mod 2.  If this seems foreign to you, just write out the $2 \times 2$ truth table and you'll see that there's nothing complicated going on here (except possibly some unfamiliar notation).  It's also easy to see that $A \oplus A \oplus B = B$, giving the expected outcome after sequential application.
Another approach is to use the tools from linear algebra and represent CNOT as a unitary transformation.  Since CNOT is a two-qubit operation, the dimension of the transformation is $2^2=4$, giving
$$\vert A, B \rangle \rightarrow U_{CNOT}\vert A,B \rangle, \;\;\; U_{CNOT}=\begin{bmatrix} 1&0&0&0\\0&1&0&0\\0&0&0&1\\0&0&1&0 \end{bmatrix}.$$
This is also well worth working this out by hand if there's any confusion as to why it works, noting that $U_{CNOT}{}^2=I$.
One of the problematic assumptions implicit in the OP equation is that $\vert A \rangle$ and $\vert B \rangle$ are separable after CNOT, which is not generally true.  In other words, if $\vert A \rangle$ and $\vert B \rangle$ are entangled after CNOT, they can no longer be represented as a linear combination of pure states.  At this point density matrices become relevant to avoid dealing with exponentially large vectors after a series of multi-qubit gates.
Edit in response to comment:
Taken to its logical end, your interpretation leads to a classical correlation between measurement outcomes of the two qubit states.  Bell and CHSH experiments have shown beyond doubt that entangled qubit states are not classically correlated.
So at least in cases when CNOT creates entanglement, your interpretation is inconsistent with experiment.  Unfortunately, after a century of debate on the subject, it's still not clear what the correct interpretation is (or even if such an interpretation exists).  Even more unfortunately there are numerous plausible interpretations that are consistent with experiment.
Comment: If after CNOT qubits |A⟩ and |B⟩ could be entangled then does it mean that (my)probability interpretation is not correct? Cause you certainly can not get it by simply swapping amplitudes of target qubit with arbitrary prob(prob of control qubit to be in **1** state). If so, what is a correct one?
Comment: Your interpretation is not consistent with experiment, which is as close as physics gets to labeling an interpretation as incorrect.  I edited my post to add clarification, as it's a bit unwieldy to fit into a comment.
Comment: The problem is that even in case when CNOT is not generating an entangled state, my formula still does work only for the first time CNOT is invoked(second time applied, it does not reverse the state to the initial one). You mean that CNOT is just an operation that is doing (abab->abba) transform and there is no sense/intuition behind it, have I understood you correctly? As for boolean representation, I am not quite sure how xor is defined for the amplitude vector if it is not schematic. I am seeking concrete understanding here, so schematic representation can't help here I guess.
Comment: Under the interpretation you stated there would be no general expectation that a second application of CNOT would return the circuit to its initial state.  Your essentially trying to apply a bit flip with probability $p$ twice, which does not generally return an initial state.
Comment: @quantumtweak Regarding your question, I'm afraid you have misunderstood me.  There is both intuition and sense behind what's happening in the CNOT gate.  Gaining that intuition begins by accepting and understanding the postulates of quantum mechanics.  If you're seeking a concrete understanding, I strongly suggest you work through [Nielsen and Chuang](https://www.amazon.com/Quantum-Computation-Information-10th-Anniversary/dp/1107002176) carefully.  Speaking from personal experience, you will have the understanding you're looking for before you reach the end.

Mathematical CNOT interpretation


How to get new textures without sacrificing the vanilla ones?

Question: I saw a command block contraption adding a bunch of new blocks mechanics, etc.
I wonder, is it possible to add new textures without getting rid of the vanilla ones?
Answer: Kind of.
What you can't do is create new blocks with a custom texture without replacing a vanilla one.
What you can do however is creating block models using custom textures for specific ITEMS and display those with the help of ArmorStands holding them/wearing it on their head.
You can make them look like regular blocks and have an almost unlimited amount of them, since every damage value of every item can be used to make it look differently as well as depending on the Unbreaking tag you can double these amounts. So a single diamond hoe can hold over 2000 different models (which would cause a lot of lag though).
Comment: you can make custom slabs (as long as you are able to occupy the block below) by using the custom textures explained above and an invisible noAI shulker riding the armorstand. Koder has a pretty good video about this here:
https://www.youtube.com/watch?v=Y5zow9d66N0
he uses fallingsand, but you should be able to extract what you need from that.

as far as custom liquids go: no, you can't create custom liquids. You may be able to get close, but not without a LOT of commands and textures.
Comment: Sure, but what if I want to make a custom texture for a slab - in this case you can't use barriers and invisible armour stands.

And what about custom liquids?


When malloc returns, what does 8-byte alignment mean?

Question: In libc's malloc(x), the function is said to return a pointer to a memory region of at least x bytes and the pointer is aligned to 8 bytes. What does this alignment mean? THank you.
Answer: It means that the pointed address mod 8 is 0:
<code>pointer % 8 == 0
</code>
This can be important for low level operations where it may impact correctness or efficiency. See also this answer.
Comment: One would care about byte alignment in order to ensure the CPU can read the memory address efficiently. Non-aligned memory blocks cause bus errors. See the Unaligned Access section here -> http://en.wikipedia.org/wiki/Segmentation_fault#Bus_error
Answer: It means that the memory starts on an address that is a multiple of 8.
As for why you would even care:  For memory that's not aligned, the CPU sometimes requires two accesses to read it all.  In some cases, it won't even try and will just throw an error.  The mention of "aligned to 8 bytes" is so that the caller knows whether it'll have to do any fudging of the pointer or not.
(Usually, you won't care -- the compiler takes care of most of the alignment issues for you.  But the info's there in case you need it for some reason.)
Answer: Memory alignment describes the modulus of the addresses. So 8 byte alignment means that he addresses are multiples of eight.
This was critical on many older systems where addresses needed to be aligned on a 'word' boundary, often a multiple of four bytes or two bytes.  If it wasn't properly aligned the program crashed with an 'alignment error'.
More recent machines fix this problem by loading from any address, but often that means that it takes  few more cycles to load the data.


How can I power an Arduino in a 3-phase environment?

Question: I am working on a project which uses an Arduino board. Currently I am testing my device using 2-phase power and it works fine.  I want to use that device in agriculture fields where 3-phase power is available instead. How can I do this?
Comment: You do not want to connect your arduino to mains voltage, do you? So your question is probably about the powers supply you are using. As there is no arduino branded PSU you will have to give us more information about  that PSU and your local mains voltages. Otherwise it will be deleted.
Comment: Typically low wattage accessory equipment in 3-phase systems is supplied by just two of the three wire phases, but you will need a power supply rated for the unusual voltage which results.
Answer: The very short answer is that the Arduino board itself is designed to be powered by low-voltage DC (but you almost certainly already know this). So what you're really asking, I think, is "can you use the mains power supply that converts mains AC to DC on a three-phase supply?"
The answer to that is a guarded yes. You will need to confirm that you are connecting to a single phase (basically what you were doing in testing) and that the voltage is appropriate for your power adapter.
The abridged version of the gory details follows…
Three-phase supplies are almost always used for motor or other power applications – for a low power device like an Arduino (or even lighting or small appliances) you don't typically need three-phase. What is usually done is to take the power supply for those devices either from phase-to-neutral or phase-to-phase – depending on the configuration of the three-phase supply.
Wikipedia has an article on three-phase power that explains the common connection schemes (Y or star where the three phases are wired to a common point, and delta where they are wired in a triangle). What is significant is that you will typically get a high and a low voltage depending on how you connect to a three-phase system. For example in the US a common Y three-phase service will give you 120 V phase-to-neutral and 208 V phase-to-phase.
A true 3-phase (as in needs to connect to all three phases) low-voltage power supply will probably be quite expensive. But you also don't need one. Unless you are building an "industrial" device all you need is a "normal" low-voltage power supply that is designed for the voltage that you'll be connecting it to.
All you need to do is to confirm the voltage that you'll be using and check that your power supply is rated for it. Many low voltage supplies are designed to be "universal" and you'll see a rating like 100-240 V, 50-60 Hz. That's likely to work on most three-phase supplies as long as the connection isn't phase-to-phase in a part of the world where the high voltage is in the 400 V range.
Comment: 3-phase transformers are not cheap in general and low-voltage 3-phase transformers are *very* niche since taking such a small amount of power from 1 or 2 phases won't affect PF very much.
Comment: There are a lot of 3-phase PSU. But in fact not many provide a voltage suitable for an arduino. Example: [http://www.pulspower.com/index.php?reqNav=product&objectId=21], which is a device using explicitely two phases of a three phase system, not from a two phase system. The manufacturer also has real 3-phase PSUs, but only with Vout beginning with 24V.
Comment: I'll correct what I wrote. Supplies like that exist, but if you're just doing something small with an Arduino are way bigger (and probably way more expensive) than what is required. The one you linked to is capable of providing 8 A at 12 V DC and is designed for mounting in a control enclosure. I'd expect you're paying a premium for that too. So it really depends on what you need – if you're looking for industrial grade gear, then that is a good example of what is available, but if you're just looking to provide power for an Arduino in a 3-phase environment, you can get by with less.
Comment: The one I linked is in the wild for about 100 € without VAT. Which is a pretty good price considering the specs. But that won't help our friend with tapping the powerline running over the rice field. (This could explain, why he has no neutral). :P
Comment: €100 is not a bad price, but still way more that you would **have** to spend to power an Arduino in a three phase environment. It really depends on what the goal is… But for prototyping I'd be tempted to spend less – at least to start with.


What is ASP.NET vNext?

Question: Can anybody tell me what is ASP.NET vNext?
Every new version on .Net is something like .NET 1.0, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0 then why this version is not something like ASP.NET 6.0?
Comment: This is for ASP.NET MVC. MVC versions 3,4,5 and this is the version 6. [Learn about what's coming next with ASP.NET](http://www.asp.net/vnext/overview/aspnet-vnext)
Comment: Generally a new yet-to-be-released version is popularly called v.Next or vNext. Not necessarily ASP.Net.
Answer: vNext is just the name given to product in the pre-release mode, like c# vNext which will apparently be released as  C# 6.0, maybe ASP.NET vNext will have a numbering when it releases.

What is ASP.NET vNext?

Microsoft ASP.NET vNext is a smaller and efficient framework as a result of rebuilding the libraries from ground up.
What's new in vNext

Cloud-optimized versions of MVC, Web API, Web Pages, SignalR, and Entity Framework.
MVC, Web API, and Web Pages will be merged into one framework, called MVC 6.
MVC 6 has no dependency on System.Web. The result is a leaner framework, with faster startup time and lower memory consumption.
vNext is host agnostic. You can host your app in IIS, or self-host in a custom process.
Dependency injection is built into the framework. Use your preferred IoC container to register dependencies.
vNext uses the Roslyn compiler to compile code dynamically. You will be able to edit a code file, refresh the browser, and see the changes without rebuilding the project.
vNext is open source and cross platform.

More information:

Overview on asp.net
Getting started with ASP.NET vNext
Blogpost by Scott Hanselman
Blogpost by David Fowler
Contributing to ASP.NET vNext
Sample ASP.NET vNext applications
Comment: damn microsoft just call it n.V. or NV or nV or n.v. or nv, for next version.
Answer: ASP.NET vNext is the next version of ASP.NET, but it hasn't shipped yet, so it is not an official version. "vNext" is just a working title.
Comment: When its scheduled to be released?
Answer: ASP.NET vNext was the code-name for the next generation of ASP.NET, whose official name is ASP.NET 5. As of now ASP.NET 5 is not yet finished and documentation about can be found at http://asp.net/vnext.
ASP.NET 5 is not just an evolution of the previous version(s), it is rebuilt from the ground. Existing ASP.NET applications will run on ASP.NET 5 without modifications, but to take advantage of the new features, such applications will have to be ported to the new version.
Here's a little excerpt of what http://asp.net has to say about ASP.NET 5:

ASP.NET 5 is a lean .NET stack for building modern web apps. We built it from the ground up to provide an optimized development framework for apps that are either deployed to the cloud or run on-premises. It consists of modular components with minimal overhead, so you retain flexibility while constructing your solutions.
ASP.NET 5 includes the following features:

New flexible and cross-platform runtime
New modular HTTP request pipeline
Cloud-ready environment configuration
Unified programming model that combines MVC, Web API, and Web Pages
Ability to see changes without re-building the project
Side-by-side versioning of the .NET Framework
Ability to self-host or host on IIS
New tools in Visual Studio 2015
Open source in GitHub

The changes we made for ASP.NET 5 were based on customer requests and feedback. These changes simplify development, hosting, and maintenance, and are targeted to modern web apps.
Your legacy apps will run on the new version of the ASP.NET without any modifications. However, to take advantage of the new features in ASP.NET 5, you will need to port your existing code to the new framework. You will find many similarities between ASP.NET 5 and earlier versions of ASP.NET, so porting code involves fixing particular issues rather than re-writing the app.

What is ASP.NET vNext?


How can I save changes in a NEF file made with Capture NX2?

Question: Here is my problem: I am trying to work around D600 notorious oil spots by using a dust off ref photo. Simple: open RAW file in Capture NX2, load the ref photo and get the spots clean. Next, I want to further process this clean photo with other software, say Photoshop or Photomatrix. I open the "clean photo" and voila, magic, the spots are still there.  Naturally, I tried to Save/Save As the NEF file after processing with Capture NX2 with the same result. Incidentally when I do a "Save As" all the options are inactive (grey out).
So there is this bizarre dichotomy: the same file has no spots in Capture NX2 (or View NX2) and spots in Photoshop. Has anybody found a solution (assuming that there is another person who cares about it)? Of course, you can save the file in TIFF of JPEG but that is NOT the solution I am looking for. Many thanks!
Comment: It's very likely that Capture NX2 is saving the dust-off data as additional data in the NEF (rather than altering the original sensor data) and that non-Nikon processors simply don't know how to link the two. If the external processors can't read the data, then saving off as a 16-bit TIFF may be your only option to get consolidated data to your tool of choice.
Comment: Thank you very much for taking the time to answer my question. However, this is akin to asking the question:"Is it any way to improve my car gas mileage without buying a hybrid?" and getting the answer: "Yes, buy a hybrid".
Comment: That's because in the case of RAW file processing, most applications only apply the data to the image in a way another application can "see" it when you export the file as something other than a RAW file. They do this so that any adjustments you make to the image are saved as a set of instructions that are non=destructive to the original data.
Answer: Almost all RAW convertors save the adjustments you make to a file as a set of instructions in a form only the program you used to make the adjustments with can understand. They do it that way so that the original data from the RAW file is not destructively altered. In the case of Nikon, the demosaicing algorithms Nikon uses are proprietary. Other applications that can convert .nef files are reverse engineered using their own proprietary algorithms.
In general the things that are "baked in" when a RAW file is converted to TIFF or JPEG are things like: White Balance, Exposure, Contrast, and Highlight and Shadow curves. If you go ahead and do these basic adjustments before exporting a file as a 16-bit TIFF then you can apply different adjustments from other applications at that point in your workflow without sacrificing much, if any, quality compared to applying those tools to an unconverted RAW file. In the case of an image with a  wide dynamic range that you want to work with in Photomatix, you can export separate dark, medium, and light versions of the same image as TIFF files and combine them in Photomatix just as you would a set of bracketed exposures.
Comment: I don't understand why people mark this as answer. The shot answer is "it cannot be done" or "we don't know". You don't achieve anything by "baking in" except for getting a huge TIFF file. When you open that file with Photoshop you lose all the initial adjustments that you can quickly make with a raw file. To say nothing about the substantial increase in the processing time when you stitch a large number of files for a panorama. The best workaround is to work with the original raw file and then to use the heal tool to remove the spots. I know that but I was looking for a more elegant solution.
Comment: Even though the TIFF file may be larger (due to the way the data in a TIFF file is arranged), the RAW file has been demosaiced and in the process some information in the RAW file has been discarded. Further, you made no mention of desired file sizes, processing times, or stitching multiple photos together in your original question. **If you make adjustments to a RAW file with an application and export the results as a TIFF, other applications *will* see the changes you made prior to exporting the TIFF, not the original file.** If they do not, it is because your RAW convertor does not apply...
Comment: ... the changes before exporting the TIFF. I've never used an application that exported RAW files a s TIFFs without applying the adjustments included in the sidecar file, but I have also never used Nikon's software to process RAW files.