Would a quality derailleur improve a cheap bike

Question: I bought my son a cheap mountain bike last week, it did 2 miles before the chain mashed up the drailleur. is it worth replacing with a better quality component. im a novice , but handy enough to upgrade. he loves the look of the bike but my question is , is it worth the effort..
Comment: The old chain was eaten up when the derailler was mangled. You'll need a new chain. If you've figured out how to put a new chain on a standard bike frame without breaking it, I'll give you a medal.
Comment: A replacement derailleur is actually non-trivial to install. First you need to make sure the hanger is not bent and is properly aligned. You have to make sure your replacement derailleur is the proper type. Then installing it can be tricky if you've never done it. You'll need a chain tool to install the new chain. Setting the proper shift cable tension and upper and lower limits on the derailleur can be tough if you've never done it. etc. It's not an easy job.
Comment: Do not underestimate the learning benefit of doing it. Once you have installed a dérailleur once, you will be able to tune the gears up and do other basic maintenance yourself, without spending big dollars at a shop for what should be a 5 minute job. You may need to buy some tools, but a basic bike maintenance tool box is quite cheap. Workshop quality is best - but for home handyman working on low to mid range bikes cheap tools get the job done provide care is taken.
Comment: @RoboKaren: you don't need to break the chain and re-connect it.  You can instead remove the bolts through the jockey wheels to disassemble the derailleur cage enough to get it around the chain and then reassemble by putting the bolts back in.  I replaced a derailleur this way as a child with little difficulty.
Comment: @RoboKaren Question does not state the chain was eaten up.
Comment: If you've jammed a derailleur before (especially in the rear axle), you know that it's likely that you've damaged the chain.
Comment: @RoboKaren And it does not say rear axle.  OP is explicitly asking about drailleur.
Answer: If your bicycle is a BSO (bicycle shaped object sold at discount mass retailers), then likely no. You'd spend $100+ labor on the derailleur and a new chain, but then the next week the brakes would fail,  the handlebar would come off, or the frame would crack. BSOs are money pits. Furthermore, it's unlikely you could just replace the derailleur, you'd have to also buy new shift levers or brifters, depending on what you're replacing it with. If the derailleur ate the chain, then it's likely that the derailleur hanger will also be bent or misaligned.  I'd use the return policy of the store to return the bike. It was clearly misassembled.
If your son's bike was a quality used bike (like a late 1980s hardtail Specialized Rockhoppper)  then it's likely that the "bones" are good and that upgrading some components would be worth your while. A better derailleur would lead to faster and smoother shifts. But you'd still run into the problem that by the time you get new derailleurs and shifters, you might have spent enough to buy a used 2000s Trek mountainbike. There's plenty of life in the older hardtails and many people prefer them to the newfangled things.

Update:  A store return isn't possible as it was bought off of the street and that the owner has £85 in sunk costs for a bike that would be about £130 new -- i.e., a little bit above a £50 BSO but not yet into the middle end. With £85 in sunk costs, I think you want to keep your repairs to under £25 given that you already spent a bit on a new tire and tube.
The likely thing that happened is that the old derailleur's high or low-limits were not set correctly. Thus when your son unknowingly shifted up or down (likely up), the chain skipped merrily off the rear sprockets into either axle (from the highest -- i.e., smallest-- gear) or the spokes (from the lowest). This then jammed the rear wheel, yanked the derailleur into bits, and it's lucky your son didn't have an accident.
First, you need to assess the damage. The rear derailleur is mostly probably bent/broken beyond repair (while tempting you cannot unbend it). Check the chain carefully, it is likely to have some bent or damaged links. Check the rear sprocket, are any of the cogs damaged? Check the spokes if the chain damaged them. Check the derailleur hanger, is it still straight? Check the front chain ring and derailleur, do they look good?
If you're lucky, the damage is just limited to the rear derailleur and to the chain. If the chain appears to have any damage at all, it's safer to get a new one (a bend in the chain or kink will cause chain suckage again).
The problem is finding a new derailleur. You want to keep the old shifters if possible to save money. There are two factors: one is the number of gears (7/8/9) on the rear and the second is the shifting mechanism. If you want to DIY, then you could purchase a new rear derailleur (assuming you have a 7-8 cassette on the rear, they go for around £10-20 for the cheapest models, but again make sure it's compatible with your shifters). Then look online for detailed instructions and be sure to set the hi/lo limits on your derailleur correctly -- and make sure your derailleur hanger is straight.
If you need a new chain, then you'll need to get a chain breaker tool as well, so budget that in. Other tools you may need will include a set of hex keys (allen wrenches), screwdrivers, adjustable wrench, bandaids (for skinned knuckles), pliers (to crimp the ferrule of the derailleur cable, don't forget to get some ferrule caps), and a BIG adjustable wrench if your derailleur hanger is bent.
Again, it's not trivial to install and adjust a rear derailleur correctly and not really a project for a brand new bike mechanic, especially when the test subject is your son.
Otherwise...
Find a local bike store that appears to have been around since the time of the Wright Brothers. The greasier the better.  Go to it with your tail between your legs and ask if they might have an old, used derailleur that will fit your bike. Do not wear nice clothes when you go. Bring your son and have him make puppy dog eyes.
If your store is anything like the place that I have downtown, then they can dig out an old, compatible derailleur from their parts bin for £3 (US$5) and might even put it on for you for a few quid more. Be sure to patronize them in the future.
Comment: I made schoolboy errors in buying this. I got it from eBay for 85 quid . The fella delivered it and in hindsight it was a bit shifty. I tried it around the block and it seemed good. I paid 85 and it turned out to retail at  130. ( another oversight) all the comment have been great. The chain didn't snap but I'm not sure about the hanger.  I've already replaced the back tyre and both inner tubes as he dragged it 2 miles backwoth a jammed back wheel.
Answer: I basically agree with @RoboKaren's answer, but wanted to add a couple of things that would take up too much space for a comment.

For starters, you say that the chain mashed up the derailleur. So the derailleur was actually the "victim" of the problem, not necessarily the cause. So while you might need to replace the derailleur, that is likely not the only thing that needs attention
To put things into perspective, you could (arguably) split a bike into four parts - frame, brakes, gears and wheels. You're talking about upgrading a single part (your derailleur) of a single part (your gearing). You're simply not going to turn a bad bike into a good bike with that degree of change.
you don't say how much you spent, but in general, for a limited budget, it makes more sense to get hold of a decent secondhand bike, than to buy something new. Of course, the trick here is being able to spot something "decent", although there are plenty of past questions on this site which may help, and will tell you what the red flags are. I don't know where you'd stand as regards a refund - 2 miles is a pretty strong argument that the bike was badly put together, at least - but if that opportunity arises.....it is worth looking into. You can always ask for advice here if you don't see your query covered already
Comment: Cheers for that advice. If the hanger is bent I would be wasting my time. Is there any way of knowing by eye. The range of derailleurs on the market is  massive, the bog standard tourney on it retails at a tenner. Your advice about symptoms rather that the course has halted my keenness to run out spending more. I've already spent more than if it would have been delivered in a box...
Comment: @george no, unfortunately you might be stuck if money is the issue. You can get a gauge to measure whether the hanger is bent (and to fix it), but that tool is a few tens of £/$ iirc. Your best bet might be to go into a shop and ask nicely if they could check it.


Is this question offensive? If so, what can I do to make it less offensive?

Question: Zanlock, a community member who has been around for a long time, has accused me of violating COC and being impolite when I asked this question. Can anyone give a 3rd party view on how this question may be impolite (if it is) and what I can do to rectify it?
Answer: I deleted those comments, it wasn't clear to me how any of the comments were attempting to help improve your post.
COC violations ideally get flagged and handled by moderators and/or community managers.
I am gonna take it out of the Hot Network Questions list. It's a good question, but as a moderator, I'd prefer not to advertise these kinds of questions. I think the site's better served by the regulars answering your question than people popping in to talk about what constitutes racism.
Comment: @luke no, I don't think it's offensive,  saying speech that looks racist as racist is OK in my book.  People ask the same thing about Jesus when he calls Samartians "dogs".
Comment: The question is "how do Mormons justify racist speech?" the implication is "Mormons justify racist speech"  I understand that raises hackles.  But it's not CoC material.
Comment: I appreciate the attention given to the question. ftr, The question came on my radar due to watching for posts with the "lds" tag.
Comment: tbh, I'd actually also question the necessity of the "racism" tag in general, but that's a topic for another day. The relevant point there being something like: How would a Catholic like it if a bunch of questions were here flagged with "pedophilia" tag? I'm pretty sure we're all against racism and pedophiles, but we can still have a dialogue that follows code of conduct when discussing those real but difficult issues.
Comment: I understand Peter. I got my upvotes and the question isn't gaining attention anymore. However, I still feel my question was not offensive, nor did it violate COC.
Comment: Also for the record, my first comment on the question was definitely intended to help improve the post. Quote: *The exclusions previously applied could be qualified differently than "doctrine". The word "racist" has a lot of other connotations associated with it such that a revised title of this question would be more polite. As it stands, it does not really fit well with the code of conduct.*
Comment: @zanlok again, I need to see what part of the Code of Conduct my question violates.
Answer: If the average person with little Biblical knowledge looked at certain things in the Bible or other Christian texts, we would expect them to label them as 'racist', 'sexist', etc. Prohibiting racial intermarriage is far from the only example, and Christians of all sorts would be used to getting questions on these topics. As long as the question is broadly respectful and seeks to give the denomination a chance to explain how their position or reading of the Bible shouldn't be seen as offensive, then I think it's fine. We'll deal differently with questions that look like they were asked in bad faith, but the question that started this discussion is fine.
Answer: One possibility is the use of the word "racist", which apparently means something different from what you and I thought it meant.
"Racist" has come to be closely related to "systemic racism", and applying it to other situations is now considered inappropriate or even racist.
In today's world, while anyone can be biased, racially prejudiced, etc., only white people can be racist.
That's not simply my white paranoia showing, it's become official policy in surprising places,
Government of Canada Anti-Racism Training Documents | PDF for instance.
One section lists "Myths and Facts":

Myth #1 — Reverse racism exists, BIPOC can be racist towards white people.

That is, it is not true that non-whites can be racist towards white people.
By definition it isn't possible.
Please always remember to be politically correct and to accept whatever the bullies tell you.
Comment: Well this response was more offensive than my original question :) (just kidding I laughed). I don't think anyone would say say that there is only systemic racism, just that its the most prevalent form of racism today. Either way, a word having connotations that don't fit my question doesn't mean my question contains those connotations. I was very clear about the kind of racism I was referring to.
Comment: Thanks for your input, Ray. The mainstream news media definitely discuss racism in the context of systemic racism - here's an [NPR](https://www.npr.org/2020/06/09/873375416/there-is-no-neutral-nice-white-people-can-still-be-complicit-in-a-racist-society) example. Things have become even more heated over that word in the USA during 2020 in most major cities with many protests some of which became riots. It is clearly a heavily charged word.
Answer: Yes.
Calling out a major religious organization of the world "racist" is offensive. How could it not be?
There is a claim in the attendant comments of that question that the Code of Conduct was read. The entire spirit of that code isn't being respected. It hardly seems appropriate to require others to explain to a user with over 1k reputation how to adequately interpret that policy for this community.

This Code of Conduct helps us build a community that is rooted in
kindness, collaboration, and mutual respect.

There are many examples that show a friendly post and an unfriendly post. It doesn't seem the OP is willing to accept any reasonable criticism about what would be a friendlier tone.
What can be done to make the question more friendly? That is a better question, and that's something that was attempted previously in the comments.

The #1 suggestion so far has been to simply select a word other than "racist" which is heavily charged right now. Seems easy enough. Why that course wasn't taken remains a mystery. Unless of course there is an unfriendly agenda at work.
Another suggestion is to refer to the proper name of the church in the question. If my assumption is correct about which church, that name has been official since 1938 and is "The Church of Jesus Christ of Latter-day Saints".
A final suggestion when asking questions and honorably striving to maintain a friendly tone, is to not insist on the last word in the comments. No one edited your question, the friendly thing to do is to adjust it yourself. The appearance thus far  to any others outside of the discussion would be to confirm it seems an unfriendly tone.
Comment: It's tradition to share the reason for a downvote? In the SE universe, better reasons to downvote than just disagreeing would hopefully be something like this answer doesn't address the question.
Comment: I know it's late, but I was reading through this and your first sentence gets it wrong. I never "accused" anyone. I asked how the LDS church defends a seemingly racist doctrine of its past. Taking offense to such things is silliness. CSE is all about asking difficult or convoluted questions about the nature of religious denominations and their doctrines. I was neutral with my language. I didn't attack. I just asked a question. I have respect for my Mormon brothers and sisters, even though I don't view them as Christians.
Comment: That being said, my apologies for not using "LDS". I use mormon not as an insult, but as an efficient term that is understood by everyone. I'm sorry if that offended you, it wasn't meant to be.
Comment: That last sentiment is appreciated. However, my feelings weren't involved; merely making statements about correctness and propriety. This issues were definitely not resolved and remains a problem. p.s. The correct term would actually be "Member of the Church of Jesus Christ of Latter-day Saints".
Comment: calling a US citizen "American" technically isn't the correct "term". The correct term would be "A citizen of the United States of America". Shorting that term, or using an acronym is not offensive nor incorrect, it's merely meant to be more efficient. The same goes for mormon or LDS. Even though those aren't the full terms, I use them. Not to be offensive, but to be efficient in my speech while getting the same message across. Some of my friends that are Members of the Church of Jesus Christ of Latter-day Saints (see how long that took?) are in total agreement with me here.
Comment: Luke, you sure seem bent on arguing. No, it's not right. You refuse to be educated about anything. The better analogy would be you're calling Americans as Gringos, which isn't correct. Sure, maybe they do it in Mexico, and sure maybe it's not offensive because who needs to waste time being offended. Also - it's not "correct". Calling racial groups or citizens is similar but also not adequate because a church is an institution precisely defined by itself and not others. Just drop it, dude. No one cares how many people you know. The correct and polite thing has already been shown to you.


resolving entities for xhtml lacking doctype declaration with Java SAX

Question: I am trying to parse the xhtml output from a Tika server. The xml inputstream (that I'm getting via an apache HttpClient) declares a namespace, but does not declare a dtd, the root looks like:

If I try to parse the input stream with SAX I run into errors if the xml stream contains entities
Exception in thread "main" org.xml.sax.SAXParseException; lineNumber: 47; columnNumber: 37; The entity "rsquo" was referenced, but not declared.

I've tried to force the parser to use a local copy of the xhtml 1.1 dtd
    class XhtmlResolver implements EntityResolver {
        public InputSource resolveEntity(String publicId, String systemId) {
            InputStream in = getClass().getResourceAsStream("src/main/java/com/w3c/xhtml/xhtml11.dtd");
            return new InputSource(in);
        }
    }

    SAXParserFactory factory = SAXParserFactory.newInstance();
    SAXParser saxParser = factory.newSAXParser();
    XMLReader reader = saxParser.getXMLReader();
    reader.setEntityResolver(new XhtmlResolver());
    reader.parse(new InputSource(inputStream));

but it's still not resolving the entities. I'm still getting an SAXParseException on any xhtml stream that has an entity in it. Can anyone help me out here?
Thanks!
Answer: You have not posted the code that actually gives the error. But in case of Tika it happens because Tika is expecting well-formed html but isn't getting one.
One common scenario where this happens is when nesting ContentHandlers as below:
 ContentHandler handler = new BodyContentHandler(new ToXMLContentHandler());

Just remove the above wrapper and use:
ContentHandler handler = new ToXMLContentHandler();

And everything should be fine.
If this is occurring in other code snippet just remember that it is because the input HTML is not well-formed.
Check JIRA issue for details.


Can a dark but warm environment put plants into dormancy?

Question: I bought a Juniper. During winter, can I make it undergo dormancy by putting it in a dark but warm (around 20 - 25 degree Celsius) location? Thanks.
Answer: No; the conditions you describe are highly likely to kill a Juniper - they expect to be cold for some of the year, and a protracted absence of light for a green plant spells death. I'm not sure what you mean by 'dormant', but dormancy occurs during winter when it's cold IF the plant is outdoors and thus exposed to winter conditions. Dormancy in that case refers to the plant not growing during the cold, dark days of winter.
Answer: No, the basic cause which triggers dormancy is because the speed of chemical reactions is strongly dependent on temperature.
If a plant is kept warm and in permanent darkness, it will attempt to keep growing until the lack of photosynthesis causes its "metabolism" to get out of balance, at which point it will start to die.


Does it count as academic dishonesty if I use the references of someone's assignment?

Question: I'm currently working on an essay topic that a mate of mine happened to have done before on another course. He gave me his reference list on some ideas that coincide with my topic and stance, but I'm afraid that if I use them it might count as academic dishonesty. Am I in the clear?
Answer: For purposes of homework it would be good to acknowledge the source to clear up any claim of misrepresentation.
I hope you actually read the referenced articles, however. Otherwise, I'd worry about the honesty of it. If you just copied the references without further exploration you are on very shaky ground. And if you didn't go beyond those references in a search then you haven't learned anything from the assignment. The professor would be justified in marking you down, of course.
Assignments aren't about producing results. They are about learning. If you bypass the learning step you are defeating yourself in the long run.
Moreover, if you are using the other person's work, generally, without citation, you are engaged in plagiarism.
Comment: @Felix: The bibliography is not a part of an academic paper for which there is a premise of originality: if the references you cite are authoritative and standard, if anything it could only be *worse* to cite other references.  You seem to perhaps be worried that a similar bibliography will alert your instructor to other similarities with your friend's paper.  But an expert reading the paper will see whatever similarities exist *in the paper itself*.  That's where you should worry about the originality and independence of your work.
Comment: Oh yes I did read all of the references. I intend to add more but I'm just scared that it may be seen as academic dishonesty since a highly similar reference list might raise suspicion.
Comment: Why on earth did this answer get a downvote? It seems like eminently sensible advice. The third paragraph should be inscribed in golden letters above the door of every lecture room worldwide.


What are the properties of water in glaciers?

Question: Does water from glaciers have many minerals (hard water) or would it be considered pure or distilled water?
Comment: "Quick questions" without elaboration effort are not very welcome, and may be closed. Always think about and search for possible answers thoroughly before posting a question.

Chemistry SE site expects to explicitly elaborate the question by at least basic textbook/online search, writing down what was found/understood/tried/failed.

Written effort attracts elaborated answers.
Comment: Pftt, you could just as well ask the same about water in a river.
Answer: Water of glacier origin is at the beginning very close to distilled water.
As it comes into contact to sedimented dust and rocks/minerals in a glacier, or flowing from it, it gets contaminated by solid particles ( glacier rivers are  very turbid ) and eventually by some dissolved minerals.
But even then, mineral content is still very low, compared to other water sources.
Consider Earth water cycle as a giant distillation apparatus, contaminating water along all its path from the source to the glacier deposite. These contaminants are solid, liquid or gaseous of both natural and human origin.
For many technical cases, it case be used after filtration insteadof distilled water, similarly as rain water. But for serious lab usage, it is too contaminated with undefined trace contaminants.
Comment: Thank you for your explanation! Could you recommend some literature for me to learn more about the similarities between water of glacier origin in comparison to distilled water, thank you!
Answer: My understanding is that the water in glaciers constitutes over 2/3 of the designated 'freshwater' on earth and is an integral part of the so-called water-cycle.
Per U.S. Geological Survey, to quote:

Just because water in an ice cap or glacier is not moving does not mean that it does not have a direct effect on other aspects of the water cycle and the weather...Even though the amount of water locked up in glaciers and ice caps is a small percentage of all water on (and in) the Earth, it represents a large percentage of the world's total freshwater. As these charts and the data table show, the amount of water locked up in ice and snow is only about 1.7 percent of all water on Earth, but the majority of total freshwater on Earth, about 68.7 percent, is held in ice caps and glaciers.

And further on the age of the freshwater itself:

Short-term storage might be days or weeks for water in a lake, but it could be thousands of years for deep groundwater storage or even longer for water at the bottom of an ice cap, such as in Greenland.

As such, the captured freshwater from the atmosphere found in glaciers is apparently representative of especially CO2 and existing pollutant concentrations.
So on the question: "would it be considered pure or distilled water?", that depends on the age of the water and in what region the glacier resides as select places have experienced significant air quality problems.
For example, see this 2019 work: Air Pollution in the Hindu Kush Himalaya, indicating troubling visible signs.


How to store an event is happening from 2017-08-20 to 2017-08-24? What data type?

Question: Say an event is happening from 2017-08-20 to 2017-08-24.
I've actually seen most APIs store and return this like:
date_start: date
date_end: date

However it might just be the case that these APIs are using MongoDB or some other NoSQL without types.
Should I be doing the above or using the data types interval (not sure of an example of what it's for) or daterange (seems likely) instead?
Answer: Range Types might be the best - either daterange, tsrange or tstzrange

8.17.1. Built-in Range Types

PostgreSQL comes with the following built-in range types:
int4range — Range of integer
int8range — Range of bigint
numrange — Range of numeric
tsrange — Range of timestamp without time zone
tstzrange — Range of timestamp with time zone
daterange — Range of date

GiST and SP-GiST indexes can be created for table columns of range types.
You can create cxclusion constraints for ranges which allow the specification of constraints such as "non-overlapping" on a range type.
There are many built-in functions and operators available for range types.
The only drawback is that ranges are not a part of SQL standard and they are not supported by other databases, you may have troubles if you decide some day to move to another RDBMS.


Postfix ignoring virtual alias in MySQL database, returns error "Unknown user"

Question: I set up a Postfix email server over a year ago following this guide: https://www.howtoforge.com/virtual-users-and-domains-with-postfix-courier-mysql-and-squirrelmail-debian-wheezy.
The server has been trouble free since until now. Yesterday I bought a new domain name and needed to set up an email address for it. Like I've done so before, I added the domain name to the database, and created a forwarding for this new domain name to point to a mailbox held away from the server. I did a similar set up last week and this had been working.
While testing the email address yesterday, I kept getting the following bounce back email from the mail account I was sending an email from:

This is the mail system at host email.domain.com.
I'm sorry to have to inform you that your message could not be
  delivered to one or more recipients. It's attached below.
For further assistance, please send mail to postmaster.
If you do so, please include this problem report. You can delete your
  own text from the attached returned message.
               The mail system

firstname.lastname@example.com: unknown user: "firstname.lastname@example.com"

Thinking the MX records hadn't been updated, I left it alone until this morning. I've tried again and I receive the same message. I then thought to try the email I set up in a similar way last week and that has also stopped working, returning the same error message.
The database, as outlined in the tutorial, handles the forwarding and actual mail user accounts. These accounts are working also, having sent an email to non-forwarding email accounts held on the server. These are received without a problem.
Here is the main.cf contents:
# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = /usr/share/doc/postfix

# TLS parameters
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = email.domain.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = email.domain.com, localhost, localhost.localdomain
relayhost =
mynetworks = 127.0.0.0/8
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
html_directory = /usr/share/doc/postfix/html
virtual_alias_domains =
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_mailbox_base = /home/vmail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
virtual_maildir_extended = yes
virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = "The user you are trying to reach is over quota."
virtual_overquota_bounce = yes
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transpo$
receive_override_options = no_address_mappings

I've restarted MySQL, I've reloaded and restarted Postfix, but the problem seems to still persist. Nothing to this configuration or to the server in general has been changed in the past year. Any ideas what's going on?
Answer: Solved it, thankfully!
After a lot of searching, trial and error, it turns out the line:
receive_override_options = no_address_mappings

In my main.cf file was preventing the aliases in the forwarding table from being loaded in to Dovecot. Removed the line, reloaded Postfix, and it's all working nicely again!


How to print specific pages from the command line?

Question: Is there a way to send a PDF file (or files) to the printer via the command line, but print only, say, odd-numbered pages? E.g., lpr -{some option} *.pdf Or perhaps {some command to get odd-numbered pages} *.pdf | lpr.  This would be faster than opening each file, opening the Print dialogue, and telling it to print pages 1, 3, 5, 7, 9... The idea is to print all odd pages, then I can print the even numbered pages on the other side of the paper.
Answer: Try
lpr -o page-set=odd <file>
lpr -o page-set=even <file>

You can find the documentation of this and other lpr options in the cups documentation.
Comment: @ fschmitt : Thanks, that worked perfectly! (Sorry, I can't figure out how to comment instead of leaving a whole answer.)
Comment: Is there a manpage that collects all the possible `lpr` options?
Answer: An alternative to the cups solution by fschmitt - for example if you only have some limited lpr available - is the command psselect.
For example for manual duplex printing in a printer without a duplex unit:
$ psselect -e -r < foo.ps | lpr
$ # manually rotate pages by 180 degrees and reinsert
$ psselect -o < foo.ps | lpr

Well, only works if your printer has a rock solid paper transport mechanism ...
-e selects only the even pages, -o odd ones, and -r reverses the selection
Answer: If you choose to preprocess the PDF (for example because your printing framework is not CUPS and doesn't support page selection), you can do it with pdftk.
pdftk A=foo.pdf cat Aodd output - | lpr
# take out the sheets and feed them back in
pdftk A=foo.pdf cat Bend-1even output - | lpr

Depending on how cheap your printer is, you may need to print the odd pages in reverse and the even pages in order: move end-1 to the other command. If the document has an odd number of pages, take out the last page from the stack and don't feed it back in the second time.
Comment: Hm, about the paper burning - the duplex models of HP printers I've come across always did some automatic re-inserting of the page to print on the backside, they did not print both sides at once.
Comment: @maxschlepzig: Yes, you're right, I've been overgeneralizing a valid point. Printing on the back of a sheet that's been around and has accumulated some bad stuff (specks of dirt, inkjet ink, small tears, …) could damage the paper or the printer, but reinserting the paper as it comes out of the printer for the first time is fine.


Two separate power supplies for a single project...can they be conglomerated somehow?

Question: I have two separate components, one of which needs a 5V 500mA-1A power supply, the other of which needs a 12V 5A power supply. Is there any way to combine a single power supply somehow so that I only need to plug one thing into the wall in order to power both components?
Answer: Yes, use a 12VDC input (>6.5A or more), then regulate it down to 5V for the low voltage section.
You can use a simple fixed linear regulator like an LM7085 for this, or for better efficiency use a buck regulator like the TL2575 (lots more options here).
EDIT - more detail on the difference between linear and switching regulator options.
With a linear regulator, it drops and regulates the voltage by simply dissipating the difference as heat.
For example in your case of 12V in and 5V out at 1A, the dissipation will be:
(12 - 5) * 1A = 7W  (as Steven also calculated in his answer)
So do we need a heatsink? how hot will the regulator get?
In the datasheet for the LM7805, the thermal resistance for junction to air (Rθja) is given as 65°C/W. This means that for every watt dissipated, the junction temperature will rise by 65°C above ambient.
So at 7W, we get 7 * 65°C = 455°C = way too hot! (the regulator will actually shut down at ~150°C to protect itself)
The absolute maximum temperature before damage is given as 150°C, and maximum operating temperature is given as 125°C, so you would need a reasonably sized heatsink to keep the temperature within limits.
To calculate the heatsink needed, you take the junction to case rating (Rθjc), add this to the case to heatsink rating (Rθc-hs) and heatsink to air rating (Rθhs).
Here is an introduction to heatsink selection:
Heatsink Basics
A switching regulator is a different story. Switching regulators regulate by transforming the power rather than dissipating it (much like a transformer)
If we ignore the small inefficiencies for a moment and assume 100%, we know that power in must equal power out.
So if voltage in = 12V, and voltage out equals 5V and needs to be 1A, we know that 5W of power is needed at the output.
With this information we can calculate the current in:
5W / 12V = 417mA.
Now lets add the inefficiency (say 88%, from the TL2575 datasheet linked to above) and calculate:
5W / 0.88 = 5.68W at the input
5.88W / 12V = 473mA input current
5.68W - 5W = 680mW dissipated as heat.
How about the heatsink?
The TL2575 has a thermal resistance of 31.8°C/W, so:
31.8 * 0.68 = 21.62°C rise above ambient.
If the ambient is 20°C, the temperature will be 41.62°C.
Even at 50°C ambient, we would still be well within operating limits.
So you can see using the switching regulator in this case makes sense. You can go for a "ready rolled" module like in Steven's answer, or build your own using something like the TL2575 IC linked to above. The datasheet will have a few example circuits to help you along (note that a "buck regulator" is a type of switching regulator that lowers the voltage. A "boost regulator" is a switching regulator that raises the voltage)
Comment: @Mason - see edits for more detail. You are correct, the power supply current rating can be anything over 6A (I would go for at least 6.5A to give headroom) as the circuit will only draw what it needs. Stevens module and the TL2575 are both switching regulators, just that the module has the peripheral components added so is ready to use (it uses a similar IC to the TL2575 as its main IC, the [LM2596](http://www.ti.com/lit/ds/symlink/lm2596.pdf))
Comment: So I would connect a normal power supply that outputs 12VDC 6.5A to the LM7085, for example, and that would regulate it for me? As long as my power supply is greater than 6A, would it work? Or is there an upper limit to the current output of the power supply? (There shouldn't be, right? The components will draw as much current as they need). Can you go into a little more detail about how exactly that would work? And how much of a difference would Steven's improvement make practically? Would I need a heat sink if I didn't use a switching regulator?
Answer: Oli mentions a 12 V, 6.5 A supply. The 6.5 A is the 5 A you need for the 12 V + 1 A for the 5 V + 500 mA headroom. The 1 A for the 5 V is required if you use a linear regulator like the LM7805 Oli mentions. That will supply 5 V x 1 A = 5 W to its load, but also dissipate (12 V - 5 V) x 1 A = 7 W itself.
A switching regulator will cause much less power dissipation.

Instead of losing 7 W in the LM7805 you may lose for instance 0.88 W if the efficiency is 85 %. It won't do very much in your total power consumption; it will go down from 72 W to 66 W, or a gain of only 9 %, but you won't need a heatsink for the 5 V regulator.
Comment: It is in any case suitable for going from 12 V to 5 V. What's the 12 V coming from?
Comment: @Mason - That seems to take care of the 12 V part, so you'll only need the buck converter for the 5 V.
Comment: Would this particular switching regulator work for my components? And will I need two of them (one for each component) or can one do the job for both components. Thanks!
Comment: It would be from a DC power supply that plugs into a wall socket.
Comment: Probably [something like this](http://www.aliexpress.com/product-gs/421868548-Free-shipping-12V-6-5A-AC-power-supply-adapter-for-LCD-monitor-TV-wholesalers.html).


Does any pool accept higher-fee transactions of a double spend, instead of the earlier one?

Question: Some pools use a modified bitcoind that uses different rules for choosing the transactions to include in a block. Are there any pools that knowing one transaction to be included in a block would discard it if another transaction on the same inputs would arrive with a higher fee? That is to say, when faced with a double spend attack between a transaction that arrived earlier and a transaction that pays them more, the pool would choose the latter?
Comment: @HighlyIrregular No, as the transaction would still be valid. A pool can put any valid transaction in the block, even if it invalidates some other transactions which are not part of any block. Otherwise there would be a fork each time someone would perform a double spend attack.
Comment: @StephenGornick It certainly would be, however, if someone make a private pool for themselves that would prefer higher-paying transactions, they could still do it. Probably some miners would still join it in hopes of getting slightly higher payouts.
Comment: That would be a quick way for a pool to commit suicide, I suppose.  The bad PR as a result would probably be fatal.
Comment: Then I guess that's a good reason to wait for extra confirmations if you're receiving a substantial sum of bitcoins from an untrusted party.
Comment: AFAIK They would choose the one they received first, the oldest transaction.
Comment: Would doing as you describe make other honest miners reject the block, assuming they received the other transaction first too?
Answer: It seems as if there is such a pool now, advertising the behavior as a feature to allow "reverting mistaken payments":
BitUndo
They also supply a patch to bitcoind.
Answer: In your scenario there are two transactions with the same input, i.e. an attempt to double-spend.
If the first transaction is already part of a block in the chain, the second one can not be included in any block on top of that block. Other nodes would reject that new block. A miner could build his new block on top of the last block before the first transaction, but that fork of the blockchain would never catch up with the original chain, unless more than 50% of the networks hashrate also builds on top of it. That's the mechanism preventing double spending.
If the first transaction is not yet part of the blockchain (i.e. 0 confirmations), a miner can choose which one to include in the next block. Choosing the one with the higher fee would be a sensible choice, but I don't know if that is implemented in any client. In that case the first transaction would be discarded, and never become part of the blockchain, since it's effectively the same scenario as above.
So, no, there is no potential for a double spend attack through higher transaction fee.
Comment: Well, it's an okay analysis of the problem, but doesn't really answer the question. There is "potential" for such a double-spend attack, but it would need to be done through some malicious pool designed for such attacks.
Comment: -1 this is nice, but totally doesn't answer the question, which is **EXACTLY** asking if there is such a pool.
Comment: I would not call it a "double-spend attack" if the first transaction has 0 confirmations, but that's a matter of definition. Thinking about it, if pools would make it a policy to prefer transactions with higher fees in such a scenario (not malicious if you ask me), it would allow one to revert an unconfirmed transactions by paying a higher fee. As long as merchants wait for at least 1 confirmation, they are safe.
Comment: @bananer: That's like saying "I wouldn't call it stealing if there's no guard at the store". Any attempt to reverse a payment to a merchant is a double-spend attack, regardless of the protective measures taken. As for relevance - waiting for 1 confirmation is not practical in most cases, therefore it is very important that 0-confirmation transactions will be fairly safe as well. If miners eschew a tx they know for another that has a higher fee, this will be compromised.


In SQL Server, how do I save the results of a query to a txt file?

Question: In SQL Server, how do I export the results of a query to a txt file. I tried tools>options>results to file. But this appears to have saved the Messages the query generated instead of the Results the query generated.
Answer: Options:

Use sqlcmd at the command line to execute your SQL statement; the results will arrive as text and can be trivially saved.

See https://stackoverflow.com/questions/425379/how-to-export-data-as-csv-format-from-sql-server-using-sqlcmd

Use bcp at the command line to execute your SQL statement with the "queryout" parameter.
Use SSMS to grid as you are, right-click the upper left cell of the results pane and use the Save Results As... option
Use SSMS to file; this will of course save the file on the machine SSMS is running on.  Tools->Options->Results to file is where you set options like delimiter, maximum size, and so on.  Instead, you want Query->Results To->Results to File or Ctrl-Shift-F (by default)
Other non-SQL ways like Powershell or any application language or MS Access or Excel with a DSN data source or SSIS or many many many other ways.
Answer: A manual way of achieving it is to CRTL+T on your SSMS to enable the option Results to Text. Execute your query and right click the Results > Save results as > Save as Type > All Files and name your file something.txt.
Comment: Thanks for the answers Ronaldo. It's not working though, perhaps because I am accessing SQL Server through a VDI? Control T does not illicit anything, and I tried to save to text via Tools>Options>Results to Text, but that doesn't work for me either.
Comment: I just ran SELECT * FROM SYSDATABASES successfully. It did something. Not sure what.
Comment: @Jimbo your problem is not related to using a VDI. That query `SELECT * FROM SYSDATABASES` was just an example of a query to have a result to print and post on my answer. What version of SSMS (Management Studio) are you using? Did you hit `CTRL+T` after you had a tab open to run a query?
Answer: If you are not restricted only to SSMS, you can use Powershell
Invoke-Sqlcmd -ServerInstance MyInstance -Database MyDB -Query "SELECT * FROM Mytable" | Export-CSV "C:\MyResults.csv"


Does Thunderbird send IP address?

Question: I send my gmail emails from thunderbird (on Ubuntu machine). I am wondering whether thunderbird sends out the IP? If so, how can I hide my IP from the outgoing emails?
Answer: Email clients (like Thunderbird) generally don't insert origin IP addresses (or other header lines) into sent emails.
Usually, if such a change takes place, it's done by the mail server that the email client connects to.
In this case, I tried a test email (Sent via Gmail on Thunderbird), and my IP does not appear in it. You should verify that this result is the same for you - Gmail will have multiple mail servers, and they may behave differently (e.g. for testing).
Edit: Oops, I'll address the "how to hide" part of the question.
Short answer: You can't hide your IP from the email server you connect to.
Long answer: You can't hide your IP from the email server you connect to, because by definition, you need to connect to it to send your email, and once you do that, it knows your IP address. Once it has that information, it can do anything it wants with it - log it, store it, alert the police, or insert it into the email header.
The only thing you can do is to connect to the mail server from an IP address that can't be linked back to you. So this means using a privacy-oriented network tool like Tor, or a trusted VPN. Or, use public WiFi, e.g. at your local library or Starbucks etc.
Comment: I see an2IPv6 in 'Received {someIPv6}?? ([someotherIPv6]): from ' part of the email sent by thunderbird. What are these IPs?
Comment: It depends on where they appear in the headers (and whether you have IPv6 connectivity through to your ISP, which is still quite rare). At a guess, I'll assume you only have IPv4 back to your ISP, and so you are seeing a transaction between two email servers conducted over IPv6.
Comment: sorry I may have been unclear. My question is 'how to hide my IP from the email's receiver (not from google mail server)?. Of course the later is not possible.
Comment: The point I'm trying to make is that you can't do anything - the mail server you connect to decides whether or not to include the originating IP address. So the best alternative is to make sure your "regular" IP address isn't seen by the mail server.
Answer: According to RFC 821 e-mail client should send its domain name in the Helo/EHLO command. So the answer is yes, Thunderbird sends out the IP in e-mail headers.
But this behaviour is reversible, just create mail.smtpserver.default.hello_argument parameter with a example.com string value via Thinderbird's Config Editor (Preferences > Advanced > General). You can assign anything instead of example.com, of course.
Need to be noted, that this is actually will not conceal your IP from mail server, this trick just removes that info from the header. For real anonymity, you should use some kind of anonymization software, such as Tor.

Does Thunderbird send IP address?


Why didn't Lyta Alexander offer her services to the aliens when she ran out of money after the Shadow War?

Question: After the Shadow War, Lyta Alexander ran out of money and could not earn a living as a freelancer because she was a rogue Telepath. If she cannot find jobs with humans, she can always find a job with the Aliens. There should not be any problem to earn big bucks given that she is the most powerful Telepath in the universe after being modified by the Vorlons. Besides, she is probably the most attractive female on Babylon 5 and even the religious G'Kar couldn't resist her. G'Kar once made her an offer to mate with her to produce telepathic Narns. How convenient. Londo once offered her lots of money to learn about her experiences with the Vorlons. There should be ample opportunities for her to get rich as long as she opened up her services to the aliens. Why didn't she?
Comment: Because none of those options sound especially pleasant.
Comment: She's still loyal to the Vorlons, even after they're gone... she's not going to go blabbing on them... geez.
Comment: @Radhil - We learn (in B5: Thirdspace) that they left stuff in her head. I would assume that includes a compulsion not to tell anyone about them. Or to kill her if she's forced.
Comment: The Vorlons have left by then. She should be safe if she blurted secrets about the Vorlons at that time. She is the most powerful telepath in the universe. With that kind of power, there is no need to be a prostitute to aliens to earn a living, even though she is probably the most beautiful human on Babylon 5. She can sell her telepathic services to the aliens and earn a good living.
Comment: It is not necessary to tell anything about the Vorlons to earn a living. She can sell her telepathic services to the highest bidder as the most powerful telepath in the universe. Simple as that.
Answer: Most of the options you list for her are not terribly appealing.

The alien market has their own telepaths.

All those telepaths that were recruited and survived the Shadow War, just like Lyta?  All trying to work that same market.  Minbari and Centauri are confirmed to have their own teeps; they would do business with their own kind, or work through the ambassadors that have their own contacts and resources for verifying the transactions.  The rest of the League races may or may not have telepaths, but every alien mind would be a new adjustment Lyta has to make, since most races think differently (established all the way back in Legacies).  All that said, Lyta probably is working such non-human jobs where she can, it's just not lucrative enough to sustain her without the Vorlon paying her rent, or the support the command staff enjoy, which Bester points out:

It's just a little one-sided, isn't it? I mean, Sheridan and the others, they have this whole support mechanism. They draw their salary from the docking fees paid by alien ships. Their meals and clothing are all free.

She's actually trying to work on the alien angle with the human corp she's interviewing with at the beginning of the episode:

Lyta: And from 2247 to 2257 I was the commercial telepath for Xenocorp. I monitored their negotiations with representatives from Centauri Prime, Narn and Pak'ma'ra.
So scanning alien minds doesn't bother you?
  Well, it's not comfortable. I don't think any of us enjoys it but you get used to it.

Naturally, this falls through as soon as the agent gets the whole picture, because their financial backing is entirely dependent on Psi Corps certification.  Alien businesses might not have that limitation, but again, harder market to break into than you might think.

She rarely can get full power

The blocks and compulsions the Vorlon installed on her vast telepathic power remain in place unless at great need - it's not like she can call them up at will, at least not until later in Season 5, and then she has an entirely different set of problems.  She does state she's stronger and can reach farther to Garibaldi, and Bester notes that she's obviously no P-5 anymore, but she's not whipping out doomsday level telepathy on a whim.  Besides, the main certification agency for the power of human telepaths would be... Psi Corp.  Good luck getting them on board.

G'kar's offer wasn't attractive before and it's still not now

G'kar was only offering money for basically using Lyta as a lab rat, and he wasn't all that subtle about the alternative more appealing to him, breeding stock and sex toy.  Lyta's not going to give up her life just for a paycheck.  She does consider this later (again, Season 5) when she has a lot more to gain from the offer than money.

The Vorlon keep their secrets

Lyta has several memory blocks on her time with the Vorlons, and what isn't explicitly blocked, she's clear about keeping to herself.  She is still loyal to the Vorlon, or more specifically, to Kosh.  She's not going to sell their secrets.  She doesn't tell unless there's urgent need (as @Valorum noted in comment, this happens in Thirdspace, and those were secrets programmed in). She's not going to sell secrets to the highest bidder, and certainly not to Londo, who was as far from the Vorlon as could be.
Comment: And there's also a quote from JMS that says that she's trying to work things out for herself; http://www.midwinter.com/lurk/guide/080.html. The implication seems to be that she's being *actively blocked from finding work* by PsiCorp
Comment: You might want to drop in some quotes from Moments of Transition; https://www.springfieldspringfield.co.uk/view_episode_scripts.php?tv-show=babylon-5&episode=s04e14
Comment: @Valorum - Well, PsiCorp could be threatening to blacklist alien interests that work with her... but that's a bit of a wash considering Earth as a whole is xenophopic at the moment.  It still wouldn't surprise me.  The whole thing is really just fallout from *Epiphanies*.  Sheridan turned her out by implication even if not by giving her a ticket elsewhere, and Garibaldi has a point that the whole messiah gambit has unintended consequences.


Does EU geoblocking apply to businesses outside EU?

Question: This
: https://support.stripe.com/questions/eu-geo-blocking-regulation-changes
states that EU has passed a law preventing geoblocking .Does this
apply to businesses outside EU. It is favourable to block the whole of the EU because of GDPR.
Answer: Yes
The regulation applies to all merchants operating in the EU irrespective of where they are domiciled.
If you don't operate in the EU, then it doesn't apply to you.
Comment: The goal was to prevent geoblocking **within** the EU. Sample: price in country EU-a was more expensive than in country EU-b. Users in country EU-a were **not** allowed to buy the product in country EU-b (or redirected to country EU-a).
Comment: So if no opperations are carried in EU no fear of such laws.


"Sequent" vs "sequential"

Question: What's the difference between "sequent" and "sequential"? I think I know when to use "sequential", but I am not sure about "sequent" since I haven't found the usage of it in sentences.
Comment: You'll have to explain every time what you mean by *sequent*.
Comment: Sequent is a very technical word (that I had to look up).  Is it possible you mean "sequence" instead?  It could be easy to confuse the two in spoken language.  Sequence being a far more common word.
Comment: "Sequence" is a noun. I am considering the adjective "sequent".
Comment: I think you need to edit to show us how you propose to use _sequent_.
Answer: A sequence is sequential. Each step in the sequence is sequent. However, "sequent" is very rare in usage (except in "subsequent"). I would not recommend trying to use it in conversation.
They are basically equivalent for all intents and purposes, besides the fact that no one uses "sequent". (my spell check is not even recognizing it as a word)
Comment: Let's say, some series of numbers is sequential. Then how about numbers which the series consists of? Can we say that the numbers are sequential? Can we use "sequential" with objects forming the sequence?
Comment: @Vova, yes. I think "sequential" can universally be used in lieu of "sequent". No counter examples come to mind.

"Sequent" vs "sequential"


Where does Collabnet Subversion store its user database?

Question: I'm trying to migrate subversion from an old server to a new one. I can copy all the repository information, but I'm stuck when it comes to the users. Do I have to recreate all the users manually or can I copy a "Users database"?
Answer: Where the users are stored is dependent on the way the repository is served. If it is served via SSH then svnserve uses the system users. If it is served via svnserve plain daemon then they're stored in the svnserve configuration files. If it is served via http/https then they're in the Apache configuration file. Where these files are is explained in the chapter 6 of the SVN book you can find here


Paradox of the extend of space

Question: We are in a house, the house is in the earth, the earth is in space, so what is space in? In something bigger? Then what is it in?
It can go on like this right....? What is the truth?
Comment: You can see [Newton's Views on Space, Time, and Motion](http://plato.stanford.edu/entries/newton-stm/) and [Absolute and Relational Theories of Space and Motion](http://plato.stanford.edu/entries/spacetime-theories/): *bodies* are **in** space but space is not a body and thus it is not "in something".
Answer: You did not specify a formal meaning for your terminology, so we have to do some guesswork.  Believe it or not, the precise meaning of the word "in" matters here.  When one starts exploring the largest (or smallest) limits of a way of thinking, as you are, the funniest words become surprisingly important.
One valid meaning is to refer to space in either a Newtonian sense, or a relativistic sense such as spacetime.  In these cases, space is not actually a "thing."  Rather it is the domain upon which the equations of physics are applied.  If one did not desire to calculate the trajectory of objects, one would not need a spacetime to make sense of the universe.
Another valid meaning is mathematical.  For me, your question immediately conjures up visions of set theory.  I can treat all of your propositions as set theoretic phrases.  "We are in a house" could be we ∈ house, or "'we' is an element of 'house'".  These can continue forth with house ∈ earth* and house ∈ space, but what is space an element of?  Can we write space ∈ ??? if we fill in the question marks with the right thing?
Potentially, or potentially not.  We can always construct a new set which contains space, and everything in it.  We could even give it a name, like "superspace" or "megaspace" or "user17325's thing bigger than space itself"  However, this almost certainly not the direction your question was going.  You want to know what is bigger than "everything."
Well, that gets to be complicated.  In set theory, there is the concept of U, the "universe of all sets."  However, some complications arise here.  U is not actually a set, itself.  It is a category.  There is nothing that "contains" U because U cannot be an element in any set.  Sets can only contain other sets (in most set theories, anyways).  Since U is a category, it cannot be contained in a set.
This sort of distinction becomes important because there's all sorts of paradoxes that arise if one tries to presume U is a set.  The most famous is Russel's Paradox.  Russel's paradox arises when one seeks to use a naive assumption that all definable collections are sets.  If this were true, U would be a set, because it is defined to be "a collection of everything."  However, this definition creates a paradox:
Let's define two types of sets: tail chasing sets and normal sets.  A tail chasing as a set which contains itself, like a dog chasing its tail.  Clearly U would have to be such a tail chasing set, if it is indeed a set itself.  Normal sets are those which do not contain themselves.  These are the well behaved sets we're used to, such as {1, 2, 3} {{12}, {3, 4}}.
Since we defined these two types, we can define two sets by them: the set of tail chasing sets, and the set of normal sets.  But which set is the set of normal sets part of?  Is it tail chasing, or normal?  If it is normal, then it must contain itself, thus it is tail chasing.  If it is tail chasing, then it does not contain itself, thus it must be normal.  This is a contradiction, and it is this contradiction that shows that our assumptions are invalid.  As it is, the "collection of all normal sets," which is clearly either U or a subset of U, is not a set at all.  They coined the word "class" to describe these concepts.  U is a class, not a set.
So this is where your question can lead, using modern science and math.  One can take other approaches as well, if desired.  The Chinese have the concept of the Dao.  Everything is part of the dao.  However, if one asks what the dao is a part of, the question falls apart.  It becomes hard to construct phrases related to your question.  The most common response I have seen is "the dao is," and it is left at that.
It also could be turtles all the way down.
* I'm handwaving away some technicalities in set theory.  In the strictest sense, if a ∈ b and b ∈ c does not entail a ∈ c in all cases.  However it is possible to construct my sets for "we" "house" "earth" and "space" such that this relationship does in fact hold.  For the exact construction, see von Neuman ordinals as a well respected formal construction that uses this approach.  This distinction will only be important if you continue exploring set theory, and is not really required to understand the rest of the answer.
Answer: Actually, this is a question that Aristotle asks in his Metaphysics; he asks "what is the place of place"; where before he defined place as something like our notion of space - it is like a container which can contain a body.
He admits this as being as being an obvious question to ask, but struggles to answer it himself, admitting it as a difficult queston.

Paradox of the extend of space


Dual boot :Windows 7 partition deleted after Kubuntu 14.04 install...Weird!

Question: I've bought two new SSD's in order to install Kubuntu on one and Win 7 on the other one. Before I had Linux Mint and Win7 together one just one SSD.
So first I installed win7 as recommended, and then used the guided installer of Kubuntu to install Kubuntu. I selected the second SSD, chose the option "use entire disk and install", but to my surprise after rebooting and selecting win7 boot loader from grub2, I got a prompt that my windows installation is damaged, and I need to run the repair option from the installation disk. So I booted into Kubuntu again, fired up kparted and saw that indeed my windows partition got deleted, except the recovery partition.
I don't understand what happened. I am not new to this topic, and this was not my first time installing Ubuntu alongside windows. I have never ever had that problem.
What can I do to make sure this won't happen again, so I won't waste another 2 hours of my life?
Thanks a lot !
Answer: There is another option in the installer, the last one, called Something else. Select this option and manually format/mount any new or already existing partition (including NTFS partitions). This variant will do nothing automatically, only what you want.


Apex Code - Integration

Question: We have a large Json file to come back into SF via Apex - the file contains every line whether it is edited or not which results in 1400 lines coming back for each update.  Is there a way to ensure SF is only picking up the edited fields and not every single line?  For example, you only edit the numbers of the street but you are still updating the street, city, state, country - but you only want the street updated.
Comment: I just tried updating an account without changing anything in execute anonymous. The account last modified date doesn't change. I don't think Salesforce will update fields that haven't changed.  However, it will still take up one of your DML rows. Are you trying to save out on DML rows or simply trying to prevent unnecessarily saving fields?
Comment: Yes, trying to save on DML rows, if possible, along with too many API uses in a 24 hour period.  Someone said I could do filters but there is not a way to know exactly what fields will be edited.
Answer: If every JSON line is one Salesforce record and you don't expect the number of lines to increase much beyond the 1400 records than I would just deserialize the JSON into whatever object you need and update them. The 1400 records are well within the 10.000 DML rows you are allowed in one operation.
If you think you'll get close to the 10.000 DML rows, and a substantial part of the data hasn't actually been changed, then it may be worth the effort to first query the data you are going to update, and check if it needs updating. I don't believe there is a way to automatically have Salesforce check this, but depending on your requirements it wouldn't be too complicated to make.
Assuming you send the entire file in one piece to Salesforce than only the number of times you send the file will have an influence on your API call limit. (Do mind the 6 mb heap size limit, and the 6 mb call out limit for synchronous operations.)
The API call limits are pretty generous unless you intent to update these records a lot of times. You have at least 15000 calls per 24 hours + either 1000 or 5000 per Salesforce licence. (See: https://developer.salesforce.com/docs/atlas.en-us.salesforce_app_limits_cheatsheet.meta/salesforce_app_limits_cheatsheet/salesforce_app_limits_platform_api.htm)
Comment: It will be sent to Salesforce approximately every 10 seconds for every customer - to three different objects.  And only if there are updates/edits.
Comment: The 1400 lines are all for one record essentially, one person's file...so we could have a large number essentially.
Comment: Geez, that is a lot! How many customers do you have? I'm assuming you don't have any control over the JSON source? It would make your life a lot easier if they have some kind of last changed time stamp. Do you expect these records to also be changed on the Salesforce side? If that happens than keeping the records synchronized becomes a lot more complicated.
Comment: If I have control over the JSON source - how would I factor in the last changed time stamp?
Comment: You might want to edit your current question with the extra information. I can then delete this answer since it's of no value as an answer to this question. Please include anything you think is relevant so that people can try to answer your question as well as possible.
Comment: Also, yes I expect these records to also be changed on the Salesforce side.  We want the JSON file to be the supreme record but have both to reflect the same data.
Comment: This makes it a far more complicated question. You should really consider updating your question with all the relevant information. It will be some work, but it will allow everyone to properly understand your problem. I do think that keeping a two way sync going between Salesforce and your other databases is possible but it is a complicated affair involving a more than comparing if two records are the same.

Apex Code - Integration


When I plug my earbuds into my macbook pro, the sound in the left side is "Fizzy"

Question: Like I said in the title, whenever I plug my earbuds (or any earbud/earphone) into my macbook pro the sound on the left side only puts out a hiss-like (Fizzy) sound. I've plugged my earbuds into my iPhone and other devices that play music and it sounded fine, but it's just my macbook. I've already tried resetting the PRAM and that didn't work. The right side sounds fine, and my macbook's speakers are fine. If anyone has any good suggestions it would be very helpful and appreciated. Thank you.
Comment: Interference of some type?
Comment: Maybe there is something inside the headphone jack causing causing the problem.
Answer: A quick test to narrow down the cause.

Launch Audio Midi Setup [Applications/Utilities]
In the Audio Devices panel, click the item on the left that shows the small speaker icon when your headset is plugged in. [I don't have a headset, but from my picture below, it's the TonePort item that has the correct icon assigned to it]

Then on the right, click Output, then Configure Speakers.
Set each speaker to the opposite of what it currently says - from the 2nd  picture, set 1 to 2 and 2 to 1.
Click Apply, then Done.

Test your audio playback.
If the 'fizzing' has swapped sides, it's the computer or playback software.
If it stays in the same ear-piece, it's the headset or the physical connection.


s3 bucket policy chrome bug

Question: So I just made the following bucket policy:
{
    "Version": "2012-10-17",
    "Id": "http referer policy example",
    "Statement": [
        {
            "Sid": "Allow get requests originated from www.example.com and example.com",
            "Effect": "Allow",
            "Principal": "",
            "Action": "s3:",
            "Resource": "arn:aws:s3:::examplebucket/",
            "Condition": {
                "StringLike": {
                    "aws:Referer":
                        "http://example.com/"
                }
            }
        },
        {
            "Sid": "Explicit deny to ensure requests are allowed only from specific referer.",
            "Effect": "Deny",
            "Principal": "",
            "Action": "s3:",
            "Resource": "arn:aws:s3:::examplebucket/",
            "Condition": {
                "StringNotLike": {
                    "aws:Referer":
                        "http://example.com/"
                }
            }
        }
    ]
}
My goal is to allow ONLY viewing of videos on my website, no downloading, no hotlinking. This policy works in the sense that if you go to my website and grab the amazon link from the page source and copy it in your browser, you'll get a access denied message. HOWEVER, if you use chrome and view page source and either: click on the link, right click and hit open in a new tab, right click and hit open in a new window it WILL immediately download the link and close the new tab/window. ACL's are set to private. What's going on here?
I looked into signed urls but that seems pointless because my videos are hours long and people can just DL before the link expires. Thanks.
Answer: It's not possible with s3 buckets. You can't separate the read from download actions. It's not a Amazon thing it has to do with how content over the web is distributed. Here is a link to at least make it harder for someone to steal your content:
http://www.mediacollege.com/video/streaming/protect/

s3 bucket policy chrome bug


Fields should be displayed only in detail view not in the edit mode

Question: I'm creating a custom Object which is exact replica of Case Object. I have few fields like Contact Phone and Contact Email which is displayed only in the detail view but not in the Edit mode. Please suggest me how to accomplish this?
Answer: The only fields that appear only on detail pages, and not edit pages, are formula fields. For normal fields, you may choose to make the fields read-only, in which case they will appear, but not be editable by the user.
One possible solution is to have two fields per entry: a formula field and the actual underlying data value. You can have two different layouts assigned by profile or record type. When the user views the object, they will see the formula fields on the screen, but they won't appear in edit pages. Users with the actual field, and not the formula field, on the page will be able to edit the field normally.
Comment: @SarojBera Nope. They would see the labels but not be able to edit the values. There's no way to hide them just during editing anymore.
Comment: @Brian - After Summer 16 formula fields will also show in new and edit screen. Is there any way to hide from the new screen?


Stream video hosted on a server onto a display

Question: I am new to Raspberry Pi. I am working on a project in which a video which is hosted on a server needs to be displayed on a LED screen via a Raspberry Pi. The Pi will receive the video from the server and will display it on the screen. As I am totally new on Pi, how shall it be done? Please provide me with some references, if possible.
Comment: There are many many videos and tutorials for video streaming. What have you tried?
Comment: Most of them were streaming videos using the Raspberry Pi camera. Some were simply streaming video from the device's memory. Tried building my project on those, but found myself in more difficulties.
Comment: Hmm. Roughly speaking, you're trying to watch something like YouTube on your LED screen?
Comment: Yes, but the video that will displayed will totally depend on the remote server admin.
Answer: Video content can be delivered as a file or as a stream. If video is delivered as a file, then simply consult standard Raspberry Pi documentation. However, streaming video is much more complicated since it involves long-term coordination between the media server and the displaying Raspberry Pi. The simplest approach for displaying streaming video on a Pi is to use a web browser, which incorporates all required software.   If you cannot use a web browser, then you will need to use a Linux utility. Please search the Internet for "displaying streaming video on Linux".


From colab directly manipulate sqlite3 format data in Google drive

Question: From colaboratory, is it possible to directly manipulate sqlite 3 format data in google drive?
 It is possible if you upload it, but it is convenient to use it in google drive.
Answer: You can do load files directory from Drive by mounting your Google Drive as a FUSE filesystem.
Here's an example:
https://colab.research.google.com/notebook#fileId=1srw_HFWQ2SMgmWIawucXfusGzrj1_U0q
There's no official Google Drive FUSE filesystem. But, several open-source FUSE + Drive libraries have been written by third parties. The example notebook above uses  google-drive-ocamlfuse. The notebook shows three things:

Installing the Drive FUSE wrapper in the Colab VM.
Authenticating to Drive and mounting your Drive using the FUSE wrapper.
Listing and creating files in the newly mounted Drive-backed filesystem.
Comment: That's right, but synchronization is done using the Drive API. This can be very slow for large data. And it could be a problem for the files shared on the drive that require real-time synchronization.
Answer: First and foremost, upload the database.sqlite and the desired csv file(Reviews.csv in my case) to Google Drive.
Then, you need to mount your drive in Google Colab using the following command:
from google.colab import drive
drive.mount('/content/gdrive')

This will result in the following output:
Go to this URL in a browser: https://accounts.google.com/o/oauth2/auth?client_id=947318989803-6bn6qk8qdgf4n4g3pfee6491hc0brc4i.apps.googleusercontent.com&redirect_uri=urn%3aietf%3awg%3aoauth%3a2.0%3aoob&response_type=code&scope=email%20https%3a%2f%2fwww.googleapis.com%2fauth%2fdocs.test%20https%3a%2f%2fwww.googleapis.com%2fauth%2fdrive%20https%3a%2f%2fwww.googleapis.com%2fauth%2fdrive.photos.readonly%20https%3a%2f%2fwww.googleapis.com%2fauth%2fpeopleapi.readonly

Enter your authorization code:

Click on the URL that will lead to a new tab that shows your Google account to provide certain privileges to Google Drive File Stream:
Choose an account
to continue to Google Drive File Stream

You must select the same Google account with which you logged in to the Google Colab. Then click on the 'Allow' button. This will lead to another page that shows the alphanumeric code. Copy the code and paste it in the text area(Enter your authorization code: ).
Consequently, the message about the drive being mounted will be displayed:
··········
Mounted at /content/gdrive

Now click on the folder icon(below 'show code snippet pane' and is located on the left side of the code cell), you can see the gdrive folder. Your Google Drive - My Drive will be located inside gdrive. Now click on the desired folder in which you stored the database.sqlite file. Right-click on it and select 'copy path'.
The path you copied should be pasted in the path link of the following command:
con = sqlite3.connect('paste the path you copied')

For example, if the database.sqlite resides in '/content/gdrive/My Drive/Colab Notebooks/database.sqlite', then the command will be as follows:
con = sqlite3.connect('/content/gdrive/My Drive/Colab Notebooks/database.sqlite')

Now you may run some SQL queries to check whether all is well:
filtered_data = pd.read_sql_query("""
SELECT *
FROM Reviews
WHERE Score != 3
""", con)
print(filtered_data.head())


Eclipse internal error "Polling news feeds"

Question: I'm using Eclipse(4.9.0) on my MacBook (High Sierra, Java 11) and this error is showing sometimes, if I'm on another app, the errors create a "stack" as you see in the screenshot, it is annoying to come back to Eclipse and to close this error every time.
Can somebody help me solve this?
Comment: Look in the .log file in the workspace .metadata directory to see if there is a more detailed message.
Answer: This indeed seems to be an issue when Eclipse is run with Java 11. I have created Bug 539545 to report this.
In the meantime, you can work around this issue by disabling news feed polling. To do so, go to Preferences... -> General -> News, and untick the Enable automatic news polling option:

The error window will no longer appear.
Comment: This solution is the same for Eclipse on Windows - except the Preferences menu is under the main 'Window' menu
Comment: @ChrisHalcrow The Preferences menu is under the main 'Window' menu under GNU Linux too :)
Answer: This is caused by the http://openjdk.java.net/jeps/320 - which is removal of Java EE and CORBA Modules from the standard Java 11 version.
As mentioned by @Pyves, the simple way would be unchecking "Enable automatic news polling" from the Preferences-> General -> News
But if you still need this, you can install "javax.*" bundles from the eclipse orbit repository.
Here is the latest stable repo url:
http://download.eclipse.org/tools/orbit/downloads/drops/R20180905201904/repository
Comment: Just confirmed that adding the bundles does not work (JRE 11.0.1, Eclipse Version: 2018-09 (4.9.0) Build id: 20180917-1800). I am still getting the error message even after adding the bundles exactly as described and letting Eclipse restart.
Comment: Same issue here, doesn't resolve. AdoptOpenJDK (build 11.0.4+11), Eclipse Version: Photon Release (4.8.0) Build id: 20180619-1200
Answer: Turning off the news feed does solve this problem (Per @Pyves, unchecking "Enable automatic news polling" from Preferences-> General -> News), but be aware that you may get other issues because of the too-new JDK. Noga Rotman just spent several hours working out for me that Eclipse not being able to find JUnit, even though it was installed and correctly on the classpath, was because of using the new JDK (the one that is causing these same issues).
You can solve the underlying issue by uninstalling your current version of the JDK and installing an old version, then reinstalling Eclipse.
If you have the Oracle JDK you can find uninstall instructions here and and Java SE Development Kit 8u191 (which fixed my issues) is here.
Comment: Do you have to re-install Eclipse after installing the older JDK? Or is it sufficient to update your eclipse.ini file to point it to the older JDK? I suspect it will be sufficient to update eclipse.ini (which is quite a bit easier than reinstalling it) - I'm going to give that a try, and if it works I'll comment back.
Answer: For windows version Eclipse,

Enter search key string "news"
Check off "Enable automatic news polling"
Click [Apply and Close] button.

That's it.


Why the derivative of a vector field along a curve is not defined for a generic manifold?

Question: In his book "Differential Geometry" Loring. Tu writes the derivative of a vector field $X$ along a curve $c: [a,b] \to \mathbb{R}^n$ as $\frac{dV(t)}{dt}=\sum \frac{dv^i(t)}{dt} \partial_i |_{c(t)}$. It then goes on to say that such a derivation is only defined in the $\mathbb{R}^n$ manifold and not in an arbitrary manifold because it doesn't have a canonical frame $\partial_1 .... \partial_n$ like $\mathbb{R}^n$ does. But what exactly does this mean? Could it mean that in an arbitrary manifold, globally the derivative is not defined, because we don't have an atlas with a single chart like $\mathbb{R}^n$? But the derivative could still exist locally, because by considering a single chart around a point $(U, x_1, ...,x_n)$ I could still use the chart coordinates to create a frame, couldn't I?
Comment: What is the derivative of the unit tangent vector field to any of the circles $z=c$ in the unit sphere $x^2+y^2+z^2=1$? Draw pictures. Do some computations.
Comment: By the way, if you haven't looked at the concrete cases of curves and surfaces in $\Bbb R^3$, I recommend starting your differential geometry exploration there. You can look at my free text, linked in my profile.
Comment: Hi, I've tried but I'm still learning about manifolds and tangent spaces so I don't have a lot of familiarity with the mathematical "machinery". Would you be so kind to give me some hints on how to do what you are asking? Thank'you
Comment: I'm just asking for basic multivariable calculus. The curves I'm talking about are easily parametrized, and then you can differentiate once and then again.
Comment: Thank you very much
Answer: Suppose $X$ is a vector a field on a smooth manifold, and $\gamma:I\rightarrow M$ a smooth curve. Let $(U,\phi$, and $(V,\psi)$ be coordinate charts with $U\cap V$, and $\gamma(I)\cap U\cap V$ not equal to the empty set.
Let $U$ have coordinates $x^i$, and $V$ have coordinates $y^i$. Then in both frames we can write that:
$$X=v^i\frac{\partial}{\partial x^i}\qquad X=w^i\frac{\partial}{\partial y^j}$$
Since $X$ is globally defined, we have that on the overlap these must agree. I.e. the transition function given by the Jacobian of $\phi\circ\psi^{-1}$ relates the two coordinate frames. This means that on $U\cap V$, we can write $X$ in terms of the $x$ frame as:
\begin{align}
X=w^i\frac{\partial}{\partial y^i}=w^i\frac{\partial x^j}{\partial y^i}\frac{\partial}{\partial x^j}
\end{align}
so we have that $w^i\partial x^j/\partial y^i=v^j$. Now in the $V$ coordinates, we would write $d/dt X$ along $\gamma$ to be:
\begin{align}
\frac{d}{dt}X(t)=\frac{dw^i(t)}{dt}\frac{\partial}{\partial y^i}\qquad \star
\end{align}
and in the $U$ coordinates, we would write it as:
\begin{align}
\frac{d}{dt}X(t)=\frac{dv^i(t)}{dt}\frac{\partial}{\partial x^i}
\end{align}
Now, we know that on $U\cap V$, $v^i=w^j\partial x^i/\partial y^j$, so:
\begin{align}
\frac{d}{dt}X(t)=\left(\frac{dw^j}{dt}\frac{\partial x^i}{\partial y^j}+w^j\frac{d}{dt}\left[\frac{\partial x^i}{\partial y^j}\right]\right)\frac{\partial}{\partial x^i}
\end{align}
However, if rewrite $\star$ in terms of the $x$ frame, we have that:
$$\frac{d}{dt}X(t)=\frac{dw^i}{dt}\frac{\partial x^j}{\partial y^i}\frac{\partial}{\partial x^i}$$
and it just doesn't have to be the case that these two things are equal to one another, so the naive idea of differentiating a vector field along a curve with respect to a local frame does not yield a globally defined vector field, since it's not independent of coordinates.
In the case of $\mathbb R^n$ we can do this because our vector bundle is trivial, so we have a global frame. In fact, for any trivial vector bundle you can define derivatives of a vector field like this, and it's equivalent to having a covariant derivative that admits a flat curvature form. Basically, you can find a frame such that all the Christoffel symbols vanish (which I am sure you will get to at some point in Tu's wonderful book).
Comment: Yea pretty much. If you're gonna define a derivative on a vector field it should give you another (globally defined) vector field. And just naively taking the derivative only does that in certain situations.
Comment: So the problem, if I understand correctly, is that while a local frame always exist, so the derivative is defined locally, but globally there may not be a global frame (which would be the case of $\mathbb{R}^n$ given that it has a single chart covering all the manifold, so it has a single set of chart coordinates that induce a frame), thus a derivative may not be defined?


Debunking issue in proving $ \sqrt2 $ is irrational

Question: Proving $\sqrt{2}$ is irrational: $ \sqrt{2}= \frac{a}{b} $ in lowest terms, thus $ {2}= \frac{a^2}{b^2} $ which leads to $ {2}= \frac{2{b^2}}{b^2} $, so $ {a} $ must be even, as even times even returns an even result (odd times odd returns an odd result).
Thus, $ {a} $ can be represented as $ {2k} $. Now, $ {b^2}= \frac{a^2}{2} $ which evaluates to ${b^2}= \frac{(2k)^2}{2}$ resulting in $b^2=2k^2$. As such, $b^2$ is even, therefore $b$ must be even. This concludes that the fraction $\frac{a}{b}$ of $\sqrt2$ can never be in lowest terms, and as such it is irrational.
However, I could not wrap my head around this because from my understanding $b = \pm\sqrt{2k^2}$ so that $$b =\sqrt{2}\cdot k$$ So, if $b$ is to be even or nonzero, then whatever value $k$ holds, it must multiply with the assumed irrational number $\sqrt{2}$ to give an even rational number. However, that is not possible because for all positive real numbers multiplication of an irrational number and a rational number always outputs an irrational result.
Futhermore, since $a=\sqrt{2b^2}$ leading to $a=2k$, which results into the following:
$$ \frac{2k}{\sqrt{2}k} = \frac{2}{\sqrt{2}} = \sqrt2$$
And when squared it reveals exactly why we consider it irrational:
$$\sqrt2 = \frac{2}{\sqrt2}\rightarrow 2 = \frac{4}{2} \rightarrow \frac{2}{1}$$
So I would also like to know why we base this irrationality of $\sqrt2$ off of $\frac{4}{2}$ which can be simplified.
Please indicate any wrong doings in my evaluation or if I missing some big picture here.
Comment: Your $b=\sqrt2k$ starts from the assumption that $b$ is a non-zero integer such that there is another integer $a$ such that $a^2/b^2=2$. If you work around the conclusions coming from said FALSE assumption, you'll end up proving all kinds of false statement (in fact, you might prove any statement, be it false, true or undecidable).
Comment: $b = \sqrt2 k$ is perfectly possible... if $\sqrt 2$ were a rational number, which we don't know yet in the proof if it is or not.
Comment: In fact, a funny thing I used to do in set theory exercises was to dissect proofs by contradiction as such: if the goal was to prove the predicate $P$, I would first write a proof of $P$ assuming $\neg P$, and then I would basically said that $$\text{True}\equiv P\lor\neg P\implies P\lor P\equiv P$$
Answer: Keep in mind that $a$ and $b$ don't actually exist - this is a proof by contradiction. The proof should really begin "Suppose $\sqrt{2}={a\over b}$ with ${a\over b}$ in lowest terms." That "suppose" may seem like a small point, but it's really the key here: we're not outright asserting that such $a$ and $b$ exist, we're considering what would happen if they did - and we're going to show that they can't.
In a bit more detail, we begin by supposing that there are such $a$ and $b$. We then deduce something impossible - namely, that both $a$ and $b$ are even. At that point it's clear that our initial assumption was wrong: that is, $\sqrt{2}$ cannot be written as a fraction in lowest terms. Since every rational number can be written in lowest terms, this means that $\sqrt{2}$ is irrational.
So the fact that "$b=\sqrt{2}k$" doesn't make any sense isn't a problem: the whole point is that we've figured out that such $a$ and $b$ are impossible in the first place.
(Meanwhile your second question - about ${4\over 2}$ vs. ${1\over 2}$ - is a bit unclear to me. But I think once you understand the above, this will clear up too.)
Comment: matter of taste, I like the quadratic forms style approach. There is no need to introduce a square root symbol, and the coprime assumption and the `both even' conclusion/contradiction are fairly well separated.
Answer: I prefer the version with quadratic forms, the relevant word is anisotropic. I think the "infinite descent" makes people nervous. I do all the descent first.
The form is going to be $x^2 - 2 y^2$ and we are to show it cannot be zero with rational and nonzero $x,y.$ First, ASSUME we have such rationals, multiply them both by the least common multiple of the numerators. We still get zero, but now we have $u^2 - 2 v^2 = 0$ with $u,v$ nonzero integers. Next, find $\gcd(u,v)$ and divide both $u,v$ by that. We still get zero, but now we have COPRIME nonzero integers with $s^2 - 2 t^2 = 0.$ That is the current state of the ASSUMPTION. As Samuel L. Jackson said in a movie "Long Kiss Goodnight" with Geena Davis, "When you make an assumption, you make an ass out of you and umption."
LEMMA: if
$$ m^2 - 2 n^2 \equiv 0 \pmod 4 \; , \; $$
then both $m,n$ are even. Proof: well, $m$ must be even, so now $2 n^2 \equiv 0 \pmod 4.$ But that requires $n^2$ even, therefore $n$ is even.
Our assumption became that we had coprime nonzero integers $s,t$ with $s^2 - 2 t^2 = 0.$ Well, this implies $s^2 - 2 t^2 \equiv 0 \pmod 4,$ so both $s,t$ are EVEN, and $\gcd(s,t) \neq 1.$


What are some precautions with Foreign Exchange Management Act, India when earning money through Forex in India?

Question: I have almost $7 Million to trade in forex and I am learning new forex strategies day by day and mastering two of them. I have trading with my demo account for almost 5 months but I am still not able to find out whether Indian traders have to register with Foreign Exchange Management Act (FEMA) after earning from Forex. Do we have to take precautions with FEMA or can we face problem of any kind from FEMA. What are additional things I should about FEMA know when earning through Forex.
Answer: With $7 Million at stake I guess it would be prudent to take legal advise as well as advise from qualified CA.
Forex trading for select currency pair [with one leg in INR] is allowed. Ex USDINR, EURINR, JPYINR, GBPINR.
Forex trading for pairs without INR or not in the above list is NOT allowed.