ios UTF8 encoding from nsstring

Question: I am receiving a nsstring that is not properly encoded like "mystring%201, where must be "mystring 1". How could I replace all characters that could be interpreted as UTF8? I read a lot of posts but not a full solution. Please note that nsstring is already encoded wrong and I am not asking about how to encode char sequence. Thank you.
Comment: are you asking about URI encoding? http://en.wikipedia.org/wiki/Percent-encoding
Answer: - (NSString *)stringByReplacingPercentEscapesUsingEncoding:(NSStringEncoding)encoding is what you want. basically use it like so:
newString = [myString stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

Answer: [urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]

Answer: Check the Strings and Non-ASCII Characters section of Formatting String Objects:
NSString *s = [NSString stringWithUTF8String:"Long \xe2\x80\x94   dash"];

Answer: lblDate.text=[NSString stringWithCString:[[arrTripDetail valueForKey:Param_vCurrencySymbol] UTF8String] encoding:NSUTF8StringEncoding];

U can Convert & get Custom Emoji to string
eg :

input : \U20b9
Output: ₹
Comment: Please don't post identical answers to multiple questions. Post one good answer, then vote/flag to close the other questions as duplicates. If the question is not a duplicate, *tailor your answers to the question.*
Answer: Do you want just percent encoding/decoding or full URL encoding/decoding? -(NSString*)stringByReplacingPercentEscapesUsingEncoding: will work if it is just percent encoding, but if there is full URL encoding there (so, for example a space could be either %20 or +) then you'll need something like the url decoding in the three20 library (or search on there, there are lots of examples of how to do it such as URL decoding/encoding NSString).

ios UTF8 encoding from nsstring


Is cooking a chicken pot pie with a low power microwave safe to eat?

Question: The package says do not use with microwaves less than 1100 watts because it won't cook thoroughly. If I cook on a 700 watt microwave for 6 recommended minutes*(1+(1100-700)/700=8 minutes 10 seconds do I risk food poisoning or do I risk it tasting cold in the middle? I don't really know how these pies are made but the brand is banquet.
Comment: What matters most is the internal temperature of the pot pie. I cook all sorts of frozen stuff at 30% power (30% on, 70% off) so that I don't have to stir.
Comment: @MaxW The back states it has to reach 165 degrees. I think that means it's not fully pre-cooked, otherwise it would say till hot. I ate fish last year that gave me food poisoning and lost a full day of work to vomiting. I wonder if it's worth the risk.
Answer: It doesn't matter for food safety how you reach the required temperature, as long as the food doesn't spend too long in the danger zone. Since you've looking at possibly minutes longer this is not a problem for you. Just make sure you know that the internal temperature is high enough when you finish cooking. I would recommend a thermometer.
Answer: Microwaves are notorious for cold spots. What is likely the issue is that a low watt microwave will not heat the food to safe temperature without affecting taste. i.e.Uniform cooking. For the entire food product > 165, some parts may have hit far far > 165. i.e. burnt.
Comment: In my experience, high power is more likely to cause hot spots. Warming slightly slower gives the heat the chance to distribute better. (As stirring isn't an option here.)


How much is a cup of graham cracker crumbs in crackers and weight?

Question: I have a recipe that calls for one cup of graham cracker crumbs.   How many crackers am I going to need to crush?
I'm having trouble finding an answer partly because different people consider a "cracker" to be of various sizes.  I would consider a cracker to be a full sized sheet like this:
 (image source)
It would also be helpful to know what a cup of graham cracker crumbs weighs.   My box of crackers is 14.4oz.   I could estimate what portion of the box to use if I know how much a cup of crumbs weighs.
Comment: Perhaps the most useful advice long-term would be to look for recipes which use weight rather than volume.
Answer: It should be about 7 crackers per cup, maybe 8, depending how finely you crush them. One of the inner packages from your 14.4oz box should be plenty (there are probably three packages with 9 in each, or 4.8oz). If you need to go the other way, that's 1/7 to 1/8 cup per cracker, or more simply, 0.5oz or 15g per cracker.
I know this from making graham cracker crusts - and you can confirm it by looking at some recipes. You generally need 1.5 cups of crumbs for a pie crust, and it takes 10-12 crackers. I've seen recipes ranging from 9 to 12 crackers (and checked ten or so when writing this), but I don't think I've ever used fewer than 10. One cup is 2/3 of that, 7 or 8 crackers. (Some people do say 20 or 24 squares, but they're clearly half-cracker squares, not the whole crackers.)
For what it's worth, the Martha Stewart crust recipe says "6 1/2 ounces graham crackers (12 crackers), finely ground (1 1/2 cups)", and 2/3 of that is 4 1/3 oz, pretty close to 1/3 of your box, maybe a cracker short, so by weight this works out too.
Answer: (I don't care that this thread is old, I was looking for this answer and this was one of the top three Google results.)
I just pulverized 8 full sheets (Honey Maid, 8 sheets come per wax paper package, 3 of those per box), which resulted in a scant 1 1/2 C of crumbs (just shy of 1 1/2 C, more than 1 1/4 C.)  Those 8 sheets netted approximately 4.9 oz of crumb according to my scale.
Answer: According to culinary school 1 C Graham Crackers is 85 grams, and from package of graham crackers

8 crackers (2 sheets) are 31 grams.
so ONE cup should be 5 1/2 sheets (22 cracker).
To make 1 1/2 cups, you need 33 crackers ( 8 sheets and a quarter)..
To make 2 cups, you need 44 crackers (11 sheets)....

Revised by Chef_Code
Answers may vary depending on crumb size of the graham crackers as well as if you pack down the cup, because of the possibility of these variables weight to volume as well as volume to weight conversion results may vary.  all answers above are close but are still to be considered approximate.  Here is a source for more information on the math.  If the link breaks in the future here is an additional link
Comment: @Chef_Code I don't think an edit like that is appropriate in a non-wiki answer. It also doesn't seem to be particularly useful information. The original poster was just looking for an estimate of number crackers that need to be crushed, not a precise amount, so it doesn't need be pointed out this answer can only be an approximation.
Comment: @Cindy There's a ton of good and relevant information for novices that could be added to every post on this site. In the context of answering this question the edit doesn't improve the post. And why does only this answer get singled out? If it's useful and appropriate for this post, it should should also be useful and appropriate for all of them.
Comment: @RossRidge, the information added is both appropriate and useful. That said, it could have been added as a comment rather than as part of the edit. Either way, it is good information for novice cooks/bakers.
Answer: Roughly it should be 4.8 ounces of 27 graham crackers or 1 pack of this brand. I did a little bit of a back calculation using this recipe.
Calculation:
190 gms is equivalent to 1.5 cups, so 1 cup should have 127gms which is equivalent to 4.48 ounces and almost close to a pack of 4.8 ounces but if you want accuracy then you need 25 crackers of the brand that I mentioned in 1
Answer: Graham crackers are definitely smaller than they used to be when I was growing up. For my recipe, I used Honey Maid from the 14.4 ounce box containing 3 packs with 9 crackers in each. I followed the first answer I saw -- 10 crackers -- and it was just short of the 1.5 cups of crumbs I needed.  I had to crush 2 more crackers to get 1.5 cups.
So, for Honey Maid:

4 crackers = 1/2 cup
8 crackers = 1 cup
12 crackers = 1.5 cups
Answer: 10 graham crackers equals 1 and 1/2 cups so about 7 or 8 should equal 1 cup.
Comment: 2/3 of 10 is 6 to 7, not 7 to 8. But I suspect you're ending up with them a bit more fluffy than I do.
Answer: Just ran one inner package of graham crackers through the food processor. It made 1 1/4 cups of crumbs. So, an entire box (14.4 oz) will yield approx. 3 3/4 cups of crumbs. I suggest you you run an entire box of crackers through the food processor and store in an air tight container and measure what you need, when you need it.
Comment: How many crackers were in that inner pack for you?
Answer: 20 SQUARES--crushed==1½ cups--I just did this for a recipe today.


Auto resize div when resizing browser

Question: In my page, I have a form inside a div. When I resize the browser, some parts of the form won't be seen and scroll bars will appear. How can I do it in css wherein after resizing, the whole form will still be visible without having to use scroll bars?
Answer: Use "%", not "px", "pt", "em" or whatever constant size, when creating such properties, like width.
For example, #element: width:80%; will make the "element" be 80% in width of it's parent element. And if the parent element is body, it will automaticly change it's width together with the browser window width.
If some child of "element" will have constant width, the minimum width of an "element" will be the same size as this child.
I hope my answer was helpfull.
Answer: Have you tried setting the forms element heihgt and width properties equals to 100% into your CSS file?

   <form id="id_form" style="background:orange;width:100%;height:100%">
        <input id="id_send_button" type="button" value="click me..." />

   </form>

Also consider the positioning property it can be: static, relative, fixed or absolute.

Auto resize div when resizing browser


Encrypted home folder and email

Question: I'd like to encrypt my home folder in CentOS.  I notice Dovecot has created directories and files under ~/mail.  If I encrypt, will my email stop working (remote access over imap and smtp)?
Comment: @Christopher - so daemons such as dovecot can still use the data?  I think my confusion is that, dovecot would not have my decryption key.
Answer: Your unencrypted directory is available only when you are logged in, it's a fake filesystem provided by the decryption program. When you're logged out, the fake (decrypted) filesystem does not exist. dovecot, at, cron cannot see it.
Reconfigure dovecot to only use files/dirs that exist while you're logged out.

Encrypted home folder and email


Live Sorting by Custom Field in Wordpress

Question: Im working on a wordpress powered website for a client that involves a directory of local offices. Part of their requirement is that live sorting be implemented via drop downs, so when someone selects X Office in X Area, the page dynamically loads the relevant results.
I currently have a custom post type set-up called "listing", which lists all the relevant information for that office. I then display each of those fields via the Loop.
In a perfect world, a plugin would exist that would perform the above, but I've yet to find one. The closest I've come is The custom category sorting over at Digging into Wordpress.
Any suggestions on a "easy" solution that would allow me to sort "listings" with multiple attributes?
Answer: please use the wp-smart-sort plugin for that.
With the help of this plugin you can also sort the custom field
If there is any issue after the use of this plugin then let me know
thanks


What does fête du profit mean ?

Question:
La Saint-Valentin est une fête du profit déguisée en fête de l'amour.

I am translating it as "for profit business" but fête in fête du profit might have some other cultural meaning for the French. Is there?
Answer: Fête has its ordinary meaning in both occurrences: celebration, holiday, festival. The sentence doesn't say anything about any business.
A nearly word-for-word translation works fine:

Valentine's day is a celebration of profit disguised as a celebration of love.
Answer: In the present age, when in matters of verbal expression an evident trend is a general instigation in the producing of pungent verbal forms, which results in the craving of numerous writers for a pun in their every sentence, the questionned sentence comes as no surprise, that is, no surprise in that sense that it is one more of those strained analogies without real pith in it. People are overdoing things under  pressure and necessarily there must be an unavoidable crop of bad results.
What is meant, plainly, is that the celebration is a pretext for raking in profits; that is quite clear. The idea of celebration in this business of supplying some of the paraphernalia that goes with Valentine's Day corresponds to nothing ; there is no analogy ; the introduction of this idea is nothing else than a rather thoughtless, easy transposition, the pattern of which is nothing but popular.
The activity has nothing to do with the rest of the business community, implies no ritual in the way of rejoycing about making profits.
A typical example

Vous parlez d'une direction communale des établissements de santé ! C'est une direction communale d'escrocs associés.

In the same way, here, there is no such controlling body. It must be said that serious thinkers do not indulge in that sort of rhetoric, it's just to easy, not refering to something specific enough.
If this particular practice is unique to the French language, of course the translation has to rely on a comparable context and is a problem; it could have, as is often enough the case, no real equivalent in English.
Irrespectively of a perfect correspondence of  context, the following translation renders the idea fairly well, while exploiting a real parallel, as an overwhelming concern for making money without regard for anything else is figuratively represented as a worship of Mammon.

Valentine's Day is from the point of view of the business Community that thrives on it a mere testimony of faithfulness to Mammon and not of faithfulness to the tradition of love.
Comment: I'm not the one who downvoted you,  but boy you are off-topic. Here the best type of answer is short and to the point, for a question as simple as that you *really* didn't need to write all that (was it *necessary* to include a "*worship of Mammon*"??).
Comment: @TeleportingGoat I see you do not share my point of view; you must be refuting then, among possibly others, this particular assertion concerning "fête" that says that there is nothing to explain the word (which is also the OP's  point of view). Do you have an explanation for it?

What does fête du profit mean ?


Sending messages to iPhone : PushSharp or SignalR

Question: A web application acts as a backend to process request coming from the iPhone. To send messages to iPhone from web application while processing a request(e.g., for payment), I want to send messages to iPhone when something interesting happens on the server or else if everything is successful, sending them transaction details. Which one is better to use PushSharp or SignalR? Does they both serve the same purpose? Either way, enlighten me on this topic. Its confusing to me.
Comment: You need to provide some information on what you are trying to achieve? Are you sending a message to an ios app you have written? or simply viewing a webpage in safari on an ios device?
Comment: The first word I mentioned is 'To send a messsage to iPhone'. Anyway I made an edit. Hope its clear now.
Comment: I can read your question perfectly... but it does not make any sense... what kind of request? Is your app a website or a native IOS application? are you simply trying to update a webpage when something happens on your server or are you trying to send a PUSH notification to an actual app... you dont seem to know the difference between a notification from signalR and a push notification.
Comment: I'm from dotnet background. I know nothing about iOS and how it works. Its an app. I know SignalR provide real time communication between server and client. But i dont know what is push notification is. All I'm asking is difference between them.
Answer: SignalR is a great way to send real time information to a web client, essentially having server-side code push information to the client and call client-side code (i.e. javascript) in realtime.
PushSharp is a great way to send push notifications to native mobile apps. For iOS, this means using Apple's infrastructure. It also means that the message will be shown as a notification in the iPhone and not just inside the browser.
Essentially, if the iPhone request you mention is coming from a native app, try PushSharp. If it's a web app running in a browser, use SignalR.
Comment: Is there a way to use Pushsharp to open a url insteead of your app?
Comment: I don't know, but even if there isn't a way to directly do this, you could either include the URL as part of the notification content or have it trigger a view that shows a link within your application which will in turn load the URL in the browser
Answer: PushSharp appears to leverage the native messaging for each platform.  Azure Notification Hubs provide native messaging similar to what PushSharp appears to do.  The native messaging platforms scale out very well, but do not give you direct access between client/server code, and messages can be delayed in some cases up to minutes.  Messaging like this works really well when you want to send messages to millions of devices. Example: all users who want an alert when their favorite sports team wins a game - not time sensitive to the minute.
If you want your push message to be strictly between your server-side code and your client-side code, SignalR can achieve that.  SignalR also has a .Net implementation, so it isn't just for javascript/web pages. SignalR is will leverage approaches like web sockets / long polling / etc.  If you are sending a response to tell your client that a query has finished, or that a message was received, and it doesn't help to have that message arrive minutes later... SignalR may be a better approach.


Can I put CAT-6 ethernet in the same conduit as power wires?

Question: I am going to run an underground 50 amp circuit to my detached garage for an EV charger.  The distance from the house electric panel and the garage is about 60 feet. I was planning on putting the power lines (4 or 6 AWG) in conduit.  It would be nice to run a data cable to the garage at the same time.  Can I put CAT-6 ethernet cable in the same conduit?  Or better in a separate conduit in the same trench?
Comment: See https://diy.stackexchange.com/q/222428/18078
Comment: Or this? [Can I run Cat-6 in conduit with line-level power cables?](https://diy.stackexchange.com/questions/198560/can-i-run-cat-6-in-conduit-with-line-level-power-cables)
Comment: Depending on your ethernet needs, you may be better off just using a WiFi solution, whether with a good AP at your house nearest your garage, or with a air link connection to wired connections in your garage.  Would probably be more expensive, but wouldn't have to worry about fiber or another conduit just for data.
Comment: Or this? [Low voltage circuits inside mains conduit](https://diy.stackexchange.com/questions/109896/low-voltage-circuits-inside-mains-conduit)
Comment: Where is your meter, is it on the garage or house?   There is an ev charger that goes into the meter socket.  https://new.siemens.com/us/en/company/press/press-releases/smart-infrastructure/siemens-and-connectder-partner-on-home-ev-charging.html
Answer: The only practical way you can run data through a power conduit is if you use fiber optic (no metal) and handle the details "just right". While that makes sense in some situations, 60' is well within normal ethernet range, and the usual solution is to run a separate conduit for data, which can contain any low voltage wires you need - e.g., Ethernet, phone, coax (cable TV), etc.
I don't recommend WiFi for this use. Even for one device, hardwired Ethernet will be more reliable. And even if you only need one device, I'd put in a switch on the end of the Ethernet. Which is kind of like a subpanel for data...
Unasked related questions, but I'll answer them anyway:

Wire size/type:

Instead of 4 AWG or 6 AWG copper, consider 2 AWG aluminum. It is far cheaper and can handle up to 90A. The only catch is if your local jurisdiction won't allow it (like mine). However, there is normally no limitation if it is a feeder to a subpanel instead of an individual circuit. And since you are in a detached garage:

Detached Building Stuff:

Disconnect needed. But that can be the main breaker of a subpanel
Ground rod needed (likely 2)
Subpanel is a very good idea. Not only does it pretty much guarantee that aluminum feeder will work well, it will allow you to add additional circuits as needed, up to the total feeder capacity (e.g., 90A for 2 AWG aluminum). That can be for a 2nd EV, lighting, tools, heater, etc. A subpanel doesn't have to be small - a large "main panel" is OK, and pricing is often crazy enough that a big main panel with a few "free" breakers will cost around the same as a small subpanel.

GFCI - Almost certainly required for all 120V receptacles and possibly for other stuff. 240V GFCI means GFCI/breaker. 120V GFCI can be GFCI/breaker or GFCI/receptacle.

In the case of your EV charging, if you are on NEC 2020 it may be required for that as well if you use a plug/receptacle connection. Hardwire and you avoid that problem.
Comment: Downvoter care to explain what I got wrong?
Comment: @Ecnerwal But if you actually run a separate conduit (which OP indicated they can do) then it isn't a problem. Just sticking a Cat 6 in the ground - and I've seen people do that - is not a good idea.
Comment: The "between buildings" aspect brings in a requirement for "primary protection", under atricle 800, which copper cables need and fiber cables sidestep. "In addition, where there exists a lightning exposure, each interbuilding circuit on a premises shall be protected by a listed primary protector at each end of the interbuilding circuit."  There's some more info about exceptions, but they probably don't apply.
Comment: Not them (I upvoted to reverse) but you really want fiber here, unless you are going to spend generally more than fiber on properly protecting the cat6/5e/6a/7 copper wiring that runs outside. Yeah, sure, "everybody does it without that" and "everybody" is not up to code.
Comment: I've read that fiber is better between buildings because of voltage differentials during a lightning strike can kill the Ethernet devices. Fiber isn't affected by lightning.
Answer: I'm going to pull you in 2 different directions at once.
EV charging size - don't go overboard
If cost is no object, why not?  Because your house's service may not be able to handle it. I know you've got a notion there, but the only thing that counts is the NEC Article 220 Load Calculation, which already has all valid notions professionally applied to it using data-driven science.  Since EV charging applies 100% to the Load Calculation, you can simply run the Load Calculation on the house as it is now, and compare to the ampacity of the electric service.
Other than that... the error we see is people thinking they need to put in some huge charger when really, nobody needs to charge 350 miles in 10 hours. Especially with DC fast charging being ever more available. Technology Connections covers this point wonderfully here.
A subpanel is mandatory here... or awkward disconnects.
You already have electric power to the garage, and you're not allowed to have 2 separate supplies to an outbuilding (NEC 225.30).  (Except under very special conditions, and then the disconnect switches have to be grouped (NEC 230.71) and have to be where power enters the building -- and doing that is a royal pain.)
So the only way you can make this work without a subpanel is if the original line is 120V, the EV line is 240V, the EV line enters the garage right next to the original line, and disconnect switches are added to both right next to each other (and they can be indoors).
The added complexity of all this is not worth it just to avoid a subpanel. Subpanels are cheap.  Feed existing circuits off the new subpanel, and abandon any existing circuits from the house. (they can be reused for "switch loops" to control lighting from the house, but the power on them must originate from the garage).  The only annoyance is the outbuilding now needs ground rods but it probably needed them before.
"Oh no, this means even bigger wire. I'm not made of money here!"
Feeder size - do go overboard!
Because of money. You will need a subpanel or disconnect here, and those things have lugs that are made of aluminum. (aluminum lugs play well with both copper and aluminum wire). Further, LARGE aluminum wire has a rock solid safety record that is undisputed.  This has a bizarre effect on the economics of heavy feeders.
90A feeder (#2 aluminum) is actually cheaper than 40A #8 copper feeder and about the price of 30A #10.  And even the most superstitious authorities agree #2 is perfectly safe.  #2 is at a pricing sweet spot due to its widespread use for service wire, so #4 is not economical and #6 is barely cheaper.
The problems in the 70s with small branch circuits were largely UL's fault for hastily and improperly certifying 15 amp sockets for use with aluminum, and nobody using torque drivers on the small stuff back then.  Not a problem for an AL lug torqued to spec.
Other circuits in the conduit
First, other power circuits are not allowed due to the "1 circuit per outbuilding" rule. (lamp switch loops are allowed but would result in a "thermal derate" of #2 aluminum down to 80A because the lamp circuit has to cool too.)
As far as data, no go.  Cannot ever mix data and power in the same enclosures, conduits or raceways.  A wire problem could cross mains voltage onto the Ethernet wires, and cause all manner of shock and fire.
However, fiber is allowed if it does not have any metallic parts. For obvious reasons.
Second EV
Modern technolgy (called "Share2" or other names) inside the EVSE charging gateway allows two or more EVs to dynamically split a single power allocation. The master EVSE is told "you guys share 40A" and they talk to make sure no amp goes unused. Most of the time only 1 car is actually charging, and it gets all of it. For instance a family with three EVs could make do with a 50A circuit - if one car needs extra charge, just use the EV console to delay charging on the other two.  The one will get the works.
However, NEC has not been updated to accommodate Share2, and they still require a dedicated circuit per EVSE.  So you need a subpanel, even though the sum of EV loads does not add up to more current than 1 of the circuits.
Comment: Would you go conduit with conductors or teck cable?  If you go teck cable you could also just run a small conduit in the same trench for the low volt stuff instead of having two conduits.
Answer: Cat6 in its own conduit, Fiber in the same conduit. But ..either way for the money and effort I'd spend it instead on an upgraded Wifi mesh  including outdoor units for the house and garage.   You'll get coverage in your yard and driveway for free as part of that effort and if you haven't done that kind of work you'll learn some new skills.
Or the cheap, ugly easy way:  a couple of bamboo masts with Cat6 strung between them. Plenty of things wrong with that but It'll work for a few years and then you can replace it for $20.
Answer: You can put it in the same conduit, but if you do you will not be allowed able to use it for ethernet or telephone or any other SELV application.
you can put non-conductive able like fibre-optic in a power conduit
or you can put a second conduit in the same trench and put your data (and any other SELV) in that,


How to splice wires on an Electric dog fence

Question: I am installing an electric pet fence.  It is indicated that the perimeter wire must be able to make it around the yard to meet at both ends so it can be spliced into the twisted wire that feeds into the transmitter. The twisted wire will cancel the signal. So I get all that   My question is, is there any type of tubing I can feed through some of the live wire so it can be another dead zone.  Also, how can I splice off twisted wire to create another dead zone.  I was thinking of the running the 15feet through the crawl space since I read concrete may block the signal.   Help  P.S. I am not an electrician but one did set the transmitter into the wall.
Comment: Question is a little unclear. do you want to know how to make some sections of the electrical wire insulated so that it does not shock you when you touch it?  - also you don't want to let the "signal/energy" dissipate anywhere! thats why it basically makes a loop,- out one side of the energizer and back on the other side - if there is lots of power lost it may trigger an alarm - setting the live strand into concrete will do this. Best is to use something called HT Lead or some good insulated cable (if its a low power unit)
Comment: TJP why do you think that the 15 feet isn't good enough?  Have you tried it and determined that the signal doesn't cancel?
Answer: To be sure I've answered your question, yes you can use electricians corrugated metal conduit.  You'd have to connect a ground wire and tie it off as close to the transmitter's (the wall socket that the perimeter wires connect to) ground as possible.  For your second question, I'd go to home depot and peruse the electrical section.  When I installed my invisible fence, I used either the crimpable ones, called a butt splice, but found that the wire rusted out and dropped the signal to ground in a rain storm, -or- the new fancy ones like the following: AlumiConn 3-Port.  If this sounds a little "hack-ish" don't worry, if you study the electric fence's supplied manual and inferred method you'll see they are just as bad.  This is low voltage stuff, so you won't get shocked.
So,... now that your question is answered, I have to say, the conduit is overkill.  I would think that 15 feet of the twisted wire is more than sufficient.  The longer the twisted section with tighter twists the better, but my dogs never got zapped once walking out of the garage where this was installed, so I recommend trying it (testing it without the dog collar on the dog of course) and see if it is an issue before you waste lots of time and money on trying to attenuate a signal that may not be a problem in the first place.  While the electrician "hackery" of these electric fence companies may appear a little unnerving, they have definitely overcome the problem of needing "deadzones" in the fence quite well.
Comment: Direct-burial-rated (self-sealing) type splices are a good idea here.  Depending on the wire gauge on your fence, something like [this](http://www.lowes.com/pd_447115-48412-67000_0__) could be made to work well...


Why don't TAWS systems provide automatic avoidance?

Question: After watching several episodes of "Air Disasters" where the pilots' response to a TAWS (terrain awareness and warning system) alert was, "huh, that can't be right", and then they fly into the terrain. I am left wondering why don't these systems actively avoid the terrain (pull up) automatically?
Answer: I would have to disagree with most of what John K has said. I will try to provide my own answer as well.

Theoretically possible, but it would have to be a very expensive and complex sort of system, because it would have to manage pitch and thrust together, meaning it would have to integrate an autothrottle function in addition to an autopilot function

Current generation fly-by-wire aircraft have massive amounts of computing power and are capable of linking together autothrottle and autopilot actions already. Yes, it's expensive, but modern airliners are.

the risk level of that sort of incident, which are pretty rare outliers really when you think of millions of hours flown each year, doesn't justify the development costs.

Indeed, thankfully, all accident types are enormously rare in modern aviation. However, that doesn't mean we stop trying to improve and CFIT (controlled flight into terrain) accidents are actually some of the more common and certainly warrant the development of safer systems.
My answer: As ymb1 has shown, this system does exist already. Why is it not on airliners yet? Well, I think it will be soon. But there might be a number of issues.
Firstly: false positives, where a terrain avoidance command is issued without need. Say, for example, an aircraft is coming into land and passes over a tall tree, this sets off the system needlessly and could very well cause further issues with traffic avoidance and airspace incursions - pilots would be hesitant about allowing such a system.
Secondly, aircraft performance. For the jet fighter in ymb1's video the aircraft performance, it's agility and power, and the pilot protection (e.g., helmet and 5-point harnesses) mean that this type of rapid terrain avoidance command is possible and effective. For any large commercial airliner, those sort of commands are not possible (much lower thrust-to-weight ratios etc.) and so the aircraft would have to respond to a terrain avoidance command a long way out - this would increase the likelihood and issues associated with my first point. Additionally, things are not as secure in an airliner and so there is the very real possibility of hurting people and breaking things when such a command is followed - if this is a do-or-die situation, then who cares! But what if it's a false positive and now you've just injured 50 people for no reason.
I'm sure there are other reasons. But having said all that aircraft designer are looking for solutions for CFIT accidents. Currently, for airliners, the main solution seems to be greater awareness for the pilots. So, using HUD/HGS (Heads up display/ guidance system). Some even now have special cameras at the front so that the surrounding terrain is overlayed on the HUD for use in low-light, low-visibility conditions. I guess that is the current solution for now. So expect to see greater use of HUD systems with terrain overlays in airliner cockpits.
Answer: Theoretically possible, but it would have to be a very expensive and complex sort of system, because it would have to manage pitch and thrust together, meaning it would have to integrate an autothrottle function in addition to an autopilot function capable of abnormally radical zoom climb maneuvers and then recovering from the maneuver at the appropriate time.
So, theoretically possible, but it will cost eleventy jillion dollars to certify, and the risk level of that sort of incident, which are pretty rare outliers really when you think of millions of hours flown each year, doesn't justify the development costs.
However, in future as the world moves toward single pilot airliners (inevitable as the crew shortage is not likely to get better any time soon with collapsing birth rates)  and software and AI makes more and more things possible cheaply, that kind of automation of escape systems like terrain avoidance and windshear escape will probably come to pass.
Comment: I'm guessing OP is after jetliners, but for fighters, it's actually there and it saved a life in [this video](https://youtu.be/WkZGL7RQBVw).
Comment: It really doesn't :) The windshear escape already does that.
Comment: @ymb1 that's worth an answer


Headlights only working when indicating left

Question: I've got a Holden Jackaroo and since a couple of weeks the headlights are a bit funny. Sometimes working, sometimes not. Today they were only working when I was indicating left and turned of when I turned the indicator of. Does anyone have an idea what the problem could be? Thanks
Answer: Almost certainly a poor earth connection somewhere...
I'd start at the one closest to the headlights, and work back towards the switch - take each connection off, check it and clean it, and reconnect.


Illustrator: Type in circular vector & background colour disappearing

Question: I'm having problems adding text using the type path tool in illustrator within a round vector.
Every time I go to type on a path though the background colour disappears. Here's an example:

If anyone can help and it's the blue area I want to get circular text within.
I also tried saving it as an image and creating new paths, but get the anchors lined up without the background turning white...any small suggestion on how I could do this would be great.
Comment: If you press and hold the mouse on the Text tool it will reveal a Type on a Path tool. As @iuliux mentioned, odds are you'll get a detailed proper answer on GD as your question is related to design tools not programming
Answer: I'm not sure what "blue area" you mean since I see no blue but i'll assume you mean the black area.
You need two paths for the text  - top arc and bottom arc. Then you'll need the paths for the artwork behind it.
For the text, create a circle where you want the baseline of the top text to fall. Then select the Type On a Path Tool from the Tool Panel:

Click the path and type your text. Adjust font, size, etc. as desired. Use the Selection Tool (Black Arrow) to click and drag the I-Beam on the path to move the type along the path. You may need to do this to position the text on the path properly.
Then copy that path with the text. Change the text (using the Type on a Path Tool) to whatever the bottom text should read. Again, use the Selection Tool (black arrow) to move the I-Beam and position the text properly.
Then choose Object > Type on a Path > Type on a Path Options.

You'll want to tick the "Flip" box and set the alignment to "Ascender".
Now select both the top text and the bottom text with the Selection Tool and use the align buttons to align both objects on vertical and horizontal centers. You should end up with both parts fo the text. Simply place this above other artwork.
Answer: it's because it's turning your ellipse in to a text path. that's why  the filled colour is no longer visible. what you can do is lock your design and draw another ellipse on top of your design to match the original ellipse, and use that ellipse as your text path.  And you can set up other stuff like Scott mention above.
Comment: Perhaps a little faster and simpler to just copy the shape, paste in place, then use the Type on a Path tool. It eliminates the possibility of position or shape errors.


How can you tell if you've been a victim of the recent sms bug?

Question: How would one know if their phone was or is afflicted by the recent bug (sending sms to the wrong people)?
Comment: Title is unclear: HTC's implementation of Android SMS handling in the past has been buggy in the extreme - so maybe pick a better title?
Comment: It's a well known and specific bug that affects all phones running the android os. Anyone that regularly follows android news should be familiar.  If you search google for "android sms bug" pretty much every result is about it. When I'm at a computer and not posting from my phone I'll add more info.
Comment: Apparently Google now believe that there were two separate SMS bugs that they've managed to reproduce, and now have fixes for. More here http://www.androidguys.com/2011/01/06/google-working-fixes-sms-bugs/ no word yet on when or how the fixes will be distributed.
Answer: From this post, it seems that only very specific conditions seem to trigger this bug. Also, AFAIK, this only seems to affect the default Messaging app, using a replacement like Handcent seems to be the way to go. More info on the bug here.

Specifically, there is something about
  certain email-to-SMS messages that
  corrupts Android's SQLite database,
  causing unpredictable results
  thereafter. The most commonly cited
  offender is alerts sent by Bank of
  America, though SMS alerts sent by
  LinkedIn and T-Mobile are also cited.
  It's possible that any SMS where the
  sender is an email address will do the
  trick, or it's possible there's
  something else these specific senders'
  messages have in common.
To be clear: if you've never received
  one of these corrupting messages, you
  will never be able to reproduce the
  bug. That's why it's only affecting a
  small group of Android users.
If you have fallen prey to the issue,
  you should be able to fix it by
  performing a hard reset (wiping all
  data) and then blocking the offending
  sender(s) from sending you texts in
  the future.
Comment: The bug report you linked to mentions that the mis-directed SMSs are sent to the first contact in your contact list, so is it worth adding a new contact to the beginning of your list ('Mr Aaaa Aaaa') with your own number?
Comment: I've had a contact like that for years, ever since my friend 'Adam' kept complaining that my phone kept ringing him from my pocket when I forgot to lock it.
Comment: Might be a good idea.


Rotational motion and angular velocity

Question: Why does $N=0$ when w=w critical?
What does "Mass m falls away from the drum if N ≤ 0, when ω ≤ ωcritical" mean?
I don't understand the relationship between N and W here.
Comment: The mass $m$ is executing circular motion.
Answer: Basically, if we know the concrete is traveling in a circle with frequency $\omega$, we know its trajectory - that is, its position vector as a function of time.  So, by taking the second derivative of that function, we know its acceleration.  For circular motion, that works out to be a vector of magnitude $R\omega^2$, always pointing toward the center of the circle, aka. centripetal.
$a = R\omega^2$
So, the acceleration increases with frequency - at low frequency, there is little centripetal acceleration.
But Newton's law tells us that acceleration is proportional to applied force:
$F_{net} = ma$
At the top of the drum, all forces are downward and so is the acceleration, so if we make downward positive, they are all positive in that equation:
$W + N = ma\\
mg + N = mR\omega^2$
The normal force is the force between the drum and the block - but the drum is not sticky, so it can only push the block down, not pull it up.  Since we made downward positive, that means N cannot be negative.  So the net downward force cannot be less than the weight!
From the equation we can see that as frequency increases, normal force does too.  That's because, when the block circles faster, it has more acceleration, so it requires more force - and the weight does not change, so the normal force must.
But by the same token, as frequency decreases, the block requires less force.  At some point, it only requires its own weight, and so N = 0.  We call that the critical frequency.
$mg = mR\omega_{critical}^2$
And if the frequency drops below that, the block actually requires less force than its own weight to keep moving on the circle.  But the force can't be less than the weight.  Hence, there is too much force on the block, and it is pulled right off of the drum - it "falls away from the drum".
$F_{net} = ma = mg > mR\omega^2\\a > R\omega^2$
=> No more circular motion!
Answer: In this answer I am referring to top position only.Similar arguments can be made for any position.
Well think it like this.You know that radius of curvature of circular motion is given as:
R= F/(m ω^2)
where F is net force.
Notice if we keep angular speed decreases, radius decreases. However you know that such a thing is not happening here.The reason of this is that net force is decreasing simultaneously.
Now,net force= Weight + Normal
Notice how Weight cannot change . It must be Normal that is changing . In short , as speed decreases , Normal decreases to maintain same radius .
Now you might argue why normal is coming into play anyway. This is to balance centrifugal force from frame of body.
Finally what happens when Normal becomes zero . At N = 0 , Weight can alone support the current radius .However if you want reduce speed even lesser , you need to make Normal opposite to Weight (to make net force even lesser) . This is not possible as Normal  cannot be negative. It violates the very definition of Normal.
SO after this,radius just needs to become a little lesser so that the body falls. At this stage Weight cannot provide centripetal as it is always downwards and not towards centre. In short ,body falls.
P.S. Normal is defined as the force that stops two objects from attaining the same space.

Rotational motion and angular velocity


I constantly have phlegm in my throat and have to clear my throat all the time

Question: Alright, so I have a few problems with my voice rn.  One is my nose is always clogged/running.  So I always have a problem of phlegm going down my throat, which is horrible for my throat in the first place.  But that also causes a constant need to clear my throat, which is not helping my voice.  On top of this, when I sing I will be fine for like half a song, but then my gag reflex activates and i end up gagging/coughing.  Sometimes i can control my voice well enough to not have the gag reflex/coughing while singing, but that's like once in a blue moon.  I need to try to fix these by the time i get back to the US or begin to fix them at least so i can begin practicing and recording when I get back. Any suggestions?
Comment: Please, see a doctor ASAP so you can start to get better.  Due to the gag reflex you're experiencing, I'm guessing it might be a good idea to see an ear, nose and throat specialist.
Comment: I'm voting to close this question as off-topic because it's more of a medical inquiry
Comment: Do you know what the underlying cause of your problem is?  If you know that, then hopefully you can seek medical help.
Comment: Agreeing with other comments - get the nose problem sorted first - by seeing a specilist. We can't start to cure you here.
Comment: Could also be due to an allergy. Is it like this all year round? Do you have pets? But yeah, see a dr.
Answer: From childhood I've had medications and even surgery for this sort of thing. I'm 60 now, and it's no better. I've had to accept this as one of my limitations. By all means though, explore this with your doctor.
That being said, a snifter of scotch clears up my airways temporarily. ;)
Answer: In principle it is good when you have a running nose (outside or inside) as this is a reaction of defense against bacterias and other attacks. But if you need to stop it for singing and working there are cracking medicines like infludo or nonfludo.  (sweet or sour)
But this reaction you describe could also be a reflux  (sweet or sour) coming up from your stomachs and this can be stopped by base blockers, pantoprazol or any derivatives.
I had the latter symptom longer than 6 months, and I thought this was coming by air- condition or from the cold. When I visited the doctor he gave me this pantoprazol and and I was healed - but I didn't take it so long as he ordered it to me. Meanwhile I've found out that I can control this by eating not so much and wear trousers with enough place for my stomach. (I also have more control like I am sitting - especial in a car).


split container forms in c# windows application

Question: I have a splitcontainer and a form in that.when i click one button in a form, another form which is continuation of former appears. now i want to achieve sliding effect when one disappears and other appears instead of just closing and opening.The both forms are housed in right panel of splitcontainer.how to do it?
Answer: Question title is wrong as you actually want to know how to animate windows forms mostly.
If you search for animation winforms you will find several articles from which to get some ideas, see this for example: How to smoothly animate Windows Forms location with different speeds?


Is it possible to use bitcoin miners to decrypt files/communication?

Question: My understanding is that miners solve complex algorithms (sha256 i believe) and receive bitcoins. With the amount of hash power all these pools get from miners couldn't they use the resources to decrypt a bunch of encrypted information?
Comment: you underestimate the computing power required to brute-force encryption ....
Comment: It's called 'distributed computing' and it's been done for years.
Comment: @schroeder so wouldn't a pool like ghash be able to decrypt most communication?
Comment: To brute force weak passwords? Yes. To brute force strong keys or RSA? Not even all of them combined would likely succeed before our sun consumes the planet as a red giant.
Comment: @AndrewHoffman how much computing power would you need for something like aes256
Comment: @user44863 No idea. (other than the amount of years required is older than the age of the universe) Crypto.stackexchange might be able to answer that. If the key is stretched by a KDF that requires non-trivial hardware, then lots more than without stretching.
Comment: @AndrewHoffman what about quantum computing?
Comment: @user44863 Well with one of those they discovered your message before you decided to send it. They already know man, they already know!
Comment: Confer  http://jheusser.github.io/2013/02/03/satcoin.html
Answer: No.
Modern ASIC miners are highly specialized for the "mining" task of Bitcoin: generating partial preimages of SHA-256 hashes through brute-force searching (to be precise, a value that, when hashed, produces a hash with a given number of leading zeroes).
Breaking SHA-256-based security requires complete preimages (ie. a value that, when hashed, gives the exact hash value being sought), and the world's collective mining power is many orders of magnitude too low for this (the current hash rate is 1.33×1017 hashes per second, enough to generate a complete preimage about every 300,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000 years)
It might be possible to re-purpose Bitcoin mining rigs to break SHA-256 password hashes, since the search space is smaller.  The collective processing power could crack any eight-character password in under a second; ten-character passwords could be broken in an hour or two.  However, SHA-256 is an uncommon hash for passwords: most people use crypt, bcrypt, or MD5.  The mining rigs are too specialized to attack those or any other encryption algorithms.
Comment: I think it would be difficult, since Bitcoin uses SHA-256d which is two SHA-256 invocations, and it is likely heavily pipelined so, even if you can cut out the input and verification steps, you could still only feed it a fixed-size input and get the doubly-hashed output. A cheap ASIC may be a general-purpose SHA-256 hashing circuit where the input and block verification is all done in software, but they would likely be a lot slower than the ones that operate entirely by autonomously.
Answer: The tools used by miners are specialized circuits (ASIC) which are very good at exactly one task: computing SHA-256 on some input. SHA-256 is a cryptographic hash function, not an encryption function.
Being able to compute a lot of SHA-256 is useful for an attacker only in situations where:

there is some secret value S that the attacker wishes to obtain;
the value S is part of a space of possible values which is small enough to be enumerated with existing technology (meaning: S is not a random 128-bit key; rather, S is some password that an average human user can remember);
and the attacker has access to the value f(S) where f() is a function that mostly uses SHA-256.

So, in practice, ASIC for Bitcoin mining may be good tool to try to crack passwords which have been hashed with SHA-256 or a derivative which relies on SHA-256 for most of its structure (e.g. PBKDF2). Usual attackers normally rely on GPU, but the ASIC are supposed to offer a better efficiency/cost ratio (otherwise, Bitcoin miners would use GPU too...).
An ASIC for Bitcoin mining would be bad at doing anything else than SHA-256, so the "normal" way of using PBKDF2 (that is, with SHA-1, not SHA-256) is unimpacted. So are bcrypt and other password hashing functions.

Salient points:

The Bitcoin ASIC show that it is possible, for a given hardware building and running budget, to get substantially more computing out of dedicated circuits (ASIC) than what you get with generic hardware (i.e. PC and GPU). However, the ASIC has a huge one-time overhead, when you design the circuit, then go to a foundry and proceed to make a million of chips. Economically, the cost benefits are all in the scaling; you have to make and run a lot of ASIC to reach a high efficiency/cost ratio.
Specialized circuits being specialized, they cannot be easily retargeted. An ASIC for SHA-256 has no value when trying to break a SHA-1 based algorithm, let alone anything AES-based. Still economically, generic CPU and GPU are cheap because they are produced by the million because they are generic and thus can be used to a multitude of tasks.
Brute force enumeration works only for values which lie in a small enough space of possible values. All the Bitcoin ASIC on Earth won't help you do some brute-force on a 128-bit symmetric key.
Comment: Bitcoin mining ASICs can't compute SHA-256 of an arbitrary input at all. They take a block header template and search for a nonce where the double-sha256 is under some target value, and then just return that they're ready for more work or have found a matching nonce.


Strange Brasero Problem

Question: I was trying to burn a copy of the Zorin OS iso to a DVD+R in Brasero. It started out fine, and then it said "Ejected Medium" and ejected the disc.  Then it said that an error ocurred. Why is this happening? I've heard there's a problem with Brasero and Sony discs, but I'm using a Memorex one.  I'm kind of a noob to linux, so if you answer, please make it simple.
Answer: ancient question, but still came across this problem on Xenial, so here is the solution:
<code>apt install brasero-cdrkit
</code>
Comment: This appears to be a working solution for half the affected people - I'm in the other half. See discussion here: https://bugs.launchpad.net/ubuntu/+source/brasero/+bug/783918
Answer: Brasero is known for making errors, unfortunately. It is not the best software available for burning DVDs and CDs.
I've burned about 100 CDs in Ubuntu Linux and I would suggest using K3b which just rocks :)
Comment: K3b is more feature-rich, but I'm not quite so sure about the bugginess aspect. I once had to use Brasero in a KDE distro 'cause K3b was letting me down. Also, K3b pulls along with it a whole bunch of kde lib packages which are not needed for anything except K3b. So, K3b may be a solution in this case, but not a perfect one.
Comment: @Pavel As far as I know there is not a perfect solution for this problem. I answered solely from my and others' experience. I found myself stuck with Brasero while K3b solved my problems.
Comment: I didn't deny yours could be the solution, only pointed out the limitations.
Answer: You could try to set burning speed manually rather than letting Brasero determine the speed automatically ("max speed"). Worked for me once.

Strange Brasero Problem


Step down dc voltage

Question: One sensor output gives voltage range within 5mv to 50v..I need to give this to an adc (analog to digital converter )..however the adc available is upto 10v.i need to stepdown hight voltage to low voltage(50v to 10V, 25V to 5V like this linear) to give it within adc input range..Any standard circuitry for this to reduce this high voltage dc?
Answer: You can use simple voltage divider. Op amp decreases divider's output resistance. The x value at resistors depends on your sensor output resistance and its current efficiency.

simulate this circuit – Schematic created using CircuitLab

Step down dc voltage


How can I recreate a mediawiki database from scratch?

Question: I want to completely drop an old instance of a MediaWiki and create a new one. I recreated the server side of things and dropped the database which was on AWS RDS.
Now I'm getting errors that X table is not present (at this moment it's an empty database).
Most questions of the sort out there say that one should use the update.php script, but that does not work on an empty database.
How can I create a fresh MediaWiki database (with no content)?
Answer: The solution for me was to use the PHP CLI to run the install script. To do this one needs to delete or move the file LocalSettings.php away first, then go to the directory where the MediaWiki was unpacked and run php maintenance/install.php.
The mandatory arguments are the name of the wiki and the name of the admin, but as I already had a database created elsewhere I added the relevant options:
php maintenance/install.php --dbuser myuser --dbpass mypassword --dbname mydb --dbserver mydbserver.rds.amazonaws.com --with-extensions --pass myadminpassword mywiki myadmin


Why is the Force of Gravitational Attraction between two "Extended" bodies proportional to the product of their masses?

Question: Newton's Law of gravitation states that force of attraction between two point masses is proportional to the product of the masses and inversely proportional to the square of the distance between them. I know that the force of attraction between two spheres turns out to be of the same mathematical form as a consequence of Newton's law. But I am not able to prove how the force between any two rigid masses is only proportional to the product of their masses (as my teacher says) and the rest depends upon the spatial distribution of the mass. So $F$ is ONLY proportional to $Mmf(r)$ where $f(r)$ maybe be some function based on the specifics of the situation.
Comment: It seems that a lot of people are not reading the question.
Comment: Interesting question.  I don't know if this will satisfy you, but the force must be proportional the product of the masses, otherwise the units will be wrong.  To get Newtons from a combination fo $G$, the two masses, and the distance between them you have to multiply the first power of the masses.
Comment: Does this answer your question? [Why in Newton's law of gravity, we do $M_1 \times M_2$ and not $M_1 + M_2$?](https://physics.stackexchange.com/questions/80471/why-in-newtons-law-of-gravity-we-do-m-1-times-m-2-and-not-m-1-m-2)
Comment: @Aditya Sharma To clarify: Do you want to know how come that if I have two objects and replace one of them with an identical one that has twice the mass (so twice the density),the attraction will be doubled, or do you want to know if replacing one of the two objects with another one having the same mass but another shape or shape of mass distribution, will create an identical force?
Comment: I resonate with the second case. I have edited the question
Comment: Thanks ,  but I am still not completely satisfied. Is it not possible that the force be some function of their masses that still conserves the units?( maybe a function that depends on the mass distribution in space or something?) Is there someway to prove it mathematically?
Comment: Newton's Law is an empirical formula, its not mathematically derived from first principles, but rather based on observations. And its just that it has held up various amounts of testing. There would be no way to *prove* the formula from first principles given current knowledge. I suppose in theory, you could go along the 'flux' argument for light, in which 'gravity' would be spread out over a greater area at a greater distance hence $F\propto r^{-2}$ then intuitively from reality, the force will be propto some form of mass product, but its a very weak argument.
Comment: Also [How did Newton find out gravity is proportional to the product of two masses?](https://physics.stackexchange.com/questions/187107/how-did-newton-find-out-gravity-is-proportional-to-the-product-of-two-masses)
Comment: I believe that many experiments were done in calculating the Gravitational Force. If one draws a graph of $F vs
 m_1m_2$ then they got a linear graph . I believe that they drew the  graph for $F vs  m_1\pm m_2 $ or $F vs \frac{m_1}{m_2}$ but there was no observable pattern in the graph such that they could put it in  any equations.  So they prefered that F is directly proportional to $m_1m_2$ . It could have been $m_1 + m_2 ^2$ or something like that also but all those changes were cancelled by the Universal Gravitational Constant $G$.
Comment: The simple explanation is that any finite object looks like a point from sufficiently far away.
Answer: The statement

...the force between Any two rigid masses is only proportional to the
  product of their masses

is not true in general, or at least it is misleading. The shapes of the mass distributions and their relative positions matter when computing the gravitational force.
It is true that once you hold constant the shapes of the mass distributions and their relative positions, then the force will be proportional to the product of the total masses of the bodies.
There are certain situations where treating two extended massive bodies as point sources can be exactly correct (in the context of Newtonian gravity). For a spherically symmetric mass distribution, the gravitational potential outside of it is the same as that arising from a point source of the same mass. This is an application of Gauss' law.
In general, one can build up an increasingly good approximation of the gravitational potential arising from a given mass distribution via a multi-pole expansion. . The leading-order term, which drops off least rapidly with distance (force $\propto r^{-2}$), is that of a monopole like what arises for a point mass or outside a spherically symmetric system. But a general mass distribution will have contributions from higher-order terms (dipole, quadropole, octopole...), all of which drop off increasingly rapidly with distance. As one considers two bodies at increasing separation, reducing them both to their monopole terms becomes increasingly more accurate.
Finally, the fact that the gravitational force of attraction on an extended body due to another body can vary with position is essential when considering phenomena such as tidal forces.
Answer: I edited the answer to make it more readable.
It is true in general that the force between two separate and rigid bodies is equal to $ G M_1 M_2  f$ with $f$ depending on the details of the mass distributions. The main reason because this is true is that the mass is an extensive quantity.
However, it is also true that the force is not always proportional to the inverse of the square of the distance. This means that in general, changing the mass distribution will change the mutual force, especially in the case where the two bodies are very close. If we also assume that the distance between the two bodies is much larger than their individual sizes, then one can also recover the inverse square law, because in this case one has that $F\approx G M_1 M_2/R^2$.
In the following I demonstrate that
1) $F= G M_1 M_2 f$ with $f$ not depending on the masses but only on the details of the distributions
2) if the distance between the bodies is much larger than the individual sizes, then $F\approx G M_1 M_2/R^2$.
3) I show a counterexample where the mutual force is not $\propto 1/R^2$ but still proportional to the masses.
1) $F= G M_1 M_2 f$
For point masses, one has
$$
\mathbf{F}= G M_1 M_2 \frac{\mathbf r_1- \mathbf r_2}{|\mathbf r_1- \mathbf r_2|^3}
$$
So, assume that the mass distributions of the two bodies are rigid and separated in space.
The total force between the two bodies can be written as an integral over the two mass distributions
$$
\mathbf F_{12}= \int d r_1^3 d r_2^3 G  \rho_1(\mathbf r_1) \rho_2(\mathbf r_2) \frac{\mathbf r_1- \mathbf r_2}{|\mathbf r_1- \mathbf r_2|^3}
$$
The mass distributions satisfy
$$
\int d r^3 \rho_{1,2}(\mathbf r) =M_{1,2}
$$
In order to get rid of the mass dependences, one can factorize the masses in the density distributions, by defining
$$
\rho_{1,2}(\mathbf r) = M_{1,2} \psi_{1,2}(\mathbf r)
$$
The crucial point here is that the functions $\psi_1(\mathbf r)$ and $\psi_2(\mathbf r)$ do not depend on the masses $M_1$ and $M_2$, but only on the geometrical distribution of their densities.
They satisfy the property
$$
\int d r^3 \psi_{1,2}(\mathbf r) =1
$$
One can imagine them as ''normalized'' and adimensional density distributions.
So, why these functions do not depend on the mass? Imagine a rigid body or a mass distribution in space with mass $M$ and volume V. Imagine that this body is made of, for example, wood. Then imagine one could change every infinitesimal portion of this body with, for example, iron. The final result is a body with the same ''normalized'' mass distribution $\psi$ but with a mass much greater than the initial one $M'\gg M$. Then, the function $\psi$ do not depend on the mass but only on the geometrical distribution. The same argument can be applied for rigid bodies but also for more complicated mass distributions, for example nonuniform or deformable objects, fluids, etc.
Using the functions $\psi$ one has
$$
\mathbf F_{12}= G M_1 M_2 \int d r_1^3 d r_2^3   \psi_1(\mathbf r_1) \psi_2(\mathbf r_2) \frac{\mathbf r_1- \mathbf r_2}{|\mathbf r_1- \mathbf r_2|^3}=$$$$=
G M_1 M_2 \cdot \mathbf f_{12}(\psi_1,\psi_2)
$$
where the function
$$ \mathbf f_{12}(\psi_1,\psi_2)=
\int d r_1^3 d r_2^3   \psi_1(\mathbf r_1) \psi_2(\mathbf r_2) \frac{\mathbf r_1- \mathbf r_2}{|\mathbf r_1- \mathbf r_2|^3}
$$
depends only in the geometrical details of the distributions and not on the masses $M_!$ and $M_2$.
2) $F\approx G M_1 M_2/R^2$ at large distances
One can go further and redefine the spatial coordinates with respect to the center of mass of the two bodies 1 and 2.
That means that
$\mathbf r_1={\mathbf r}_1'+\mathbf R_{1}$
 and
$\mathbf r_2={\mathbf r}_2'+\mathbf R_{2}$ where $\mathbf R_{1}$ and $\mathbf R_{2}$ are the positions of the center of mass of the two bodies.
If $ \mathbf R_{12} = \mathbf R_{1}-\mathbf R_{2}$ is their distance, then one has
$$ \mathbf f_{12}(\psi_1,\psi_2)=
\int d {r}_1^{\prime 3} d {r}_2^{\prime 3}
\psi_1({\mathbf r}_1') \psi_2({\mathbf r}_2') \frac{{\mathbf r}_1'- {\mathbf r}_2'+\mathbf R_{12}}{|{\mathbf r}_1'- {\mathbf r}_2' +\mathbf R_{12}|^3}
$$
depends on the distance of the two masses and on the geometrical details of their distributions, but not on the value of the masses $M_1$ and $M_2$.
The dependence on the distance of the center of masses does not necessarily goes as the inverse of the square of the distance.
However, if the distance between the two bodies is much larger than the sizes of the two bodies, one has that $|\mathbf R_{12}|\gg |\mathbf r_1- \mathbf r_2| $ then one has, as a first approximation
$$ \mathbf f_{12}(\mathbf R_{12})
\approx
\int d {r_1}^{\prime 3} d {r}_2^{\prime 3}   \psi_1({\mathbf r}_1') \psi_2({\mathbf r}_2')
\frac{\mathbf R_{12}}{|\mathbf R_{12}|^3}
=\frac{\mathbf R_{12}}{|\mathbf R_{12}|^3}
$$
The last equality follows from the fact that the functions $\psi$ are normalized to 1, which gives
$$
\int d {r_1}^{\prime 3} d {r}_2^{\prime 3}   \psi_1({\mathbf r}_1') \psi_2({\mathbf r}_2')=
\int d {r}^{\prime 3} \psi_1({\mathbf r}')
\times \int d {r}^{\prime 3} \psi_2({\mathbf r}')
=1$$
Therefore in this case one has
$$
|\mathbf F_{12}|\approx
\frac{G M_1 M_2}{|\mathbf R_{12}|^2}
$$
2) $F\neq G M_1 M_2/R^2$ but still $F= G M_1 M_2 f$
The obvious violation to the case 2) is where the distance $R$ between the center of masses of the bodies is not large. This condition is obviously violated if the bodies are one inside the other. This is realized, for example, in the famous case where one has a spherical shell containing a sphere.
In this case (see wikipedia) all contributions to the mutual gravitational force cancel each other, and one has
$$ \mathbf f_{12}(\psi_1,\psi_2)=
\int d r_1^3 d r_2^3   \psi_1(\mathbf r_1) \psi_2(\mathbf r_2) \frac{\mathbf r_1- \mathbf r_2}{|\mathbf r_1- \mathbf r_2|^3}=0
$$
This still satisfy $F=G M_1 M_2 f$ with $f=0$.
Now consider the case of a sphere and imagine to dig a tunnel from one pole to the other and consider the gravitational force of an object inside the tunnel. In this case one has that $ \mathbf f_{12}(\psi_1,\psi_2)=1/R$ which gives
$$
{F}_{12}= G M_1 M_2 \frac{1}{|\mathbf r_1- \mathbf r_2|}
=\frac{G M_1 M_2}{R_{12}}
$$
The dependence on the distance is now $\propto1/R$ but the force is still proportional to $M_1 M_2$ and satisfy the equation derived in 1).
Example of mass distribution
To make things more intuitive, consider the easiest example of mass distribution: A rigid sphere of radius $R$.
In this case one has
$$
\psi(\mathbf r)=
\begin{cases}
1 & \text{for} |\mathbf r|<R\\
0 & \text{for} |\mathbf r|>R
\end{cases}
$$
Comment: I didn't go through this in detail.  But what if the mass *distributions* are the same, varying only in mass?   It's still not clear to me what exactly the OP is asking.  For example, I *think* that he is *not* asking about distance dependence.  And although he mentions spatial distribution it's not clear to me whether or not he wants an answer for fixed distributions.  Anyway, if you can summarize in words what your analysis yields for fixed distributions you might nail what the OP is after.
Comment: I think you still need to prove that the $\psi_i$ do not depend on the masses. How can I see that? Also you should probably write $\rho_i(r,M_i)$, as they must depend on the mass such that the $\psi$ doesn't.
Comment: I wonder if there is a way to convert the function $\mathbf f_{12}(\psi_1,\psi_2) = \int \ldots$ into a PDE?
Comment: @garyp about your first questions, what do you mean if the mass distributions are the same? Do you mean the case, for example, of two spheres at a finite distance, or the case where the two mass distributions coexist in the same volume? About your last sentence, what do you mean with fixed distributions?
Comment: @ Azzinoth Actually, the mass is defined as the integral of the density distribution. If I divide the density distribution by the mass, I obtain a normalized quantity which is adimensional and does not depend on the total mass.
Comment: Mass distribution is the same:   Same volume, same shape, all dimensions identical,  and the density *distribution* is the same (i.e. if normalized to total mass they would be identical), but not the integral of the distribution: total mass.  I can see where the words "mass distribution" don't really capture all of that.
Comment: @ja72 can you be more specific?
Comment: In the form of $\nabla (\psi_1 \psi_2) = \text{(something)}$.
Comment: @ja72 Maybe something like $ \nabla_1 \nabla_2 \mathbf f(\psi_1,\psi_2)=
  \psi_1(\mathbf r_1) \psi_2(\mathbf r_2) \frac{\mathbf r_1- \mathbf r_2}{|\mathbf r_1- \mathbf r_2|^3}
$?
Answer: How does this sound?
Let's say you have two extended bodies, A and B, each made up of a number of particles. Let's consider the force on a particle in A, call it P, due to body B. Each particle in body B exerts a force on P that is proportional to that B particle's mass. The sum of such forces gives the net force on P due to B. Now let's suppose we double the mass of each B particle. That would result in doubling the force on P. But doubling the mass of each B particle is doubling the total mass of body B. So doubling the total mass of body B doubles the force on P. Hence, the force due to body B is proportional to B's total mass.
To get the total force due to body B on the body A, we have to add up the forces on all of A's particles. Again, if we doubled each particle's mass, the total force on A would double, as would its total mass. Hence that total force is proportional to A's total mass.
Comment: I was starting to have doubts about my own answer - suppose the masses of the B particles are not all doubled but increased randomly so that the total B mass doubles. Then the force on the A particle will not double as B particles are at different distances from it. But then that's a different body B with a different f(r), to use your notation. I suppose that for a given f(r)  then it's true the force of attraction between A and B is proportional to the product of their masses. But what about @Dvij D.C.'s example of a particle in a spherical shell?
Comment: Yes, you can combine it with the symmetry and dimensional argument given by @Dvij D.C. to prove that it is only proportional to the product of the masses. And the rest shall depend upon the specifics of the situation.
Answer: As is stated in the previous answer huge non-spherical objects are rarely (never) seen in Nature so let's consider this as a purely theoretical enterprise. Let's go!
Consider two bodies of mass (let's assume they are rigid so they can't be deformed and tidal effects omitted). The gravitational force vector a massive body exerts on another body originates in its center of gravity (CG). Also, the point where it gets a grip on the other body is the other body's CG. For most celestial bodies (which are spherical symmetric) as well as for a number of other bodies where symmetry is involved (think of an ellipsoid), the center of mass (CM) and CG coincide, but in general, this is not the case. In fact, there is for these bodies not one CG, but they lie on a line piece on which the CM is situated. Where the CG is situated depends on where the other body is to be found. For example on a cube Earth:

The direction of the gravity you feel when walking on it doesn't point most of the time towards the CM. In the article is written:

"… Gravity on the surface wouldn't generally point toward the exact center of the [cube] Earth anymore."

And the center of this cube Earth is where the CM is situated.
The same holds for a barbel formed mass. Although some symmetry is involved the CG lies on a line piece on the principal axis of rotation with the smallest moment of inertia (in the barbel's length) going through the CM. The endpoints of the line piece lie a bit before the center of the two balls, as seen from the CM, and on the same distance from it (unless the balls are different in size, in which case the CM shifts from the middle and doesn't lay in the middle of the line piece anymore).
And also in this case the position of the CG depends on the position of the other body.
Now, what does this all mean? It means that if two rotating bodies of mass (with masses $M$ and $m$ gravitate towards each other in a straight line, the forces of gravity lay on the line connecting the two CGs that lay on one of the endpoints of the line of CGs (dependent on their relative orientations). This means they make a torque (a pseudovector produced by a cross product) come into existence on both bodies:
$$\vec{{\tau}_{1net}}=\vec{F_{gnet}}\times \frac{1}{2}(\overrightarrow{CM_1}-\overrightarrow{CG_{1max}})=\lVert{\vec{F_{gnet}}}\rVert \lVert{\frac{1}{2}(\overrightarrow{CM_1}-\overrightarrow{CG_{1max}}})\rVert \sin{{\theta}_1}$$
$$\vec{{\tau}_{2net}}=\vec{F_{gnet}}\times \frac{1}{2}(\overrightarrow{CM_2}-\overrightarrow{CG_{2max}})=\lVert{\vec{F_{gnet}}}\rVert \lVert{\frac{1}{2}(\overrightarrow{CM_2}-\overrightarrow{CG_{2max}}})\rVert \sin{{\theta}_2}$$
The factor $\frac{1}{2}$ appears in front of the vectors because their magnitudes vary between zero (when the CMs and CGs coincide) and the maximum values (when the CMs and CGs are the most far apart). This is the case on both sides of the CM, but on one side the $\vec{F_g} s$ have bigger magnitudes, which is why I write $\vec{\tau_{net}}$ and $F_{gnet}$, which I will call just $\vec{\tau}$ and $\vec{F_g}$ in what follows.
When the bodies have an initial minimum angular rotation the bodies make a whole rotation, while they rotate back and forth when they rotate below this minimum angular rotation, and no rotation at all results when the initial angular momentum is zero and the line piece between the two CGs is perpendicular to the line between the two CMs of the bodies.
The angles ${\theta}_1$ and ${\theta}_2$ are the angles between the concerning vectors. Their maximum values increase when the bodies get closer. The torque vectors are perpendicular to the plane containing $\vec{F_g}$ and $(\overrightarrow{CM_1}-\overrightarrow{CG_{1max}})$ or $(\overrightarrow{CM_2}-\overrightarrow{CG_{2max}})$ (if these are parallel, no torques are present, because in that case $\sin{\theta}_1$ and $\sin{\theta}_2$ are zero) and rotate around the axis connecting ${CM}_1$ and ${CM}_2$.
Now a torque makes a body rotate in the plane perpendicular (or rotating back and forth as we saw) to the plane just mentioned and are also given by:
$$\vec{{\tau}}_M=I_M\frac{\vec{{d\omega}}_M}{dt}$$
$$\vec{{\tau}}_m=I_m\frac{\vec{{d\omega}}_m}{dt},$$
where $I_M$ is the moment of inertia of the body of mass $M$ and  $I_m$ the moment of inertia of the body of mass $m$ (different momenta of inertia $I$, depending on the form of the mass, can be calculated or looked up) and $\frac{\vec{d\omega}}{dt}$ the time derivative of the angular velocity. It might be clear that the time derivative of the angular velocity (pseudo)vector ($\vec{\omega}=\vec{v}\times \vec{l}$) lies on the same line as the torque vector because $I$ is a scalar, i.e. a positive number. Let's assume the torques makes the bodies rotate only around the principal axes with the highest moment of inertia (the rotation can be around any axis, but the principle is the same).
When the bodies initially don't rotate, and the CMs and the CGs of both bodies coincide or all lie on one line (which is the case if the lines of CGS are parallel or orthogonal, so no torque is present) then the bodies just accelerate linearly to each other with a force $F=G\frac{Mm}{r^2}$, where $r$ is the distance between both CMs (or CGs).
If this is not the case the bodies make each other rotate. After each full rotation of each body, they have the same angular velocity.
So we have the mutual linear acceleration caused by the force $F=G\frac{Mm}{r^2}$, in which $F$ is the force component of the force pulling on the CMs and $r$ the distance between the two CMs. This linear acceleration is minimal when the total rotational acceleration is maximal, and vice-versa.
This linear acceleration is attenuated periodically by the variable (but periodic) angular rotation of both bodies. The linear acceleration grows, diminishes, grows, diminishes, etc. (because the rotational energy of the bodies varies periodically).
When the bodies are very far apart there will (approximately) only be linear acceleration, because the torques go to zero. But the linear acceleration also goes to zero when they are far apart so $f(r)$ reduces to one, so you can reduce the force formula to $G\frac{Mm}{r^2}$, with $M$ and $m$ considered as point particles. The torques and linear acceleration will not have the same ratio when the distance between the bodies increases.
The torques of the bodies (making their rotation vary between a maximum and minimum value) are just as the force $F_g$ (producing the linear acceleration) dependent on a squared distance ($F\propto{\frac{1}{{r_F}^2}}$ and $\tau\propto{\frac{r_{\tau}^2}{r_F}^2}$) so initially, the linear acceleration is very small, just as the torques. The angles involved in the torques go to zero though when the bodies approach infinity and so does $\sin{\theta}$ for both bodies.
So the attenuating function $f(r)\rightarrow 1$ when $r\rightarrow \infty$ so $F_g$ approaches the $G\frac{Mm}{r^2}$ form. When the bodies approach each other the ratio of the torque of the bodies and linear accelerating force is not equal at every distance between the bodies (see the previous alinea). So $f(r)$ is a periodic function (depending on the initial rotations of the bodies, the momenta of inertia of them both, and the varying torques) and it gives the linear acceleration a periodic component. This periodic variation is small when the linear acceleration is small (when they are far apart) and gets bigger when the linear acceleration increases (when they are getting closer). But because the ratio of the torque and F grows when the distance between $CM_1$ and $CM_2$ diminishes (e.g. when the distance gets half as big, the force becomes $\frac{1}{4}$ big, while the torque becomes more than $\frac{1}{4}$ as big, because in the two cross products definitions I gave above, a factor $\sin{\theta}$ is involved, which grows when the distance of the bodies gets smaller), the period of rotation in time get. Nevertheless, $f(r)$ still attenuates the linear acceleration periodically.
Given the necessary information, $f(r)$ can be calculated. Of course, we also have to include the stretching of the bodies because they are not truly rigid. This stretching is due to the rotations and the tidal forces (the last grows when the distance gets smaller), which can be calculated too. When the bodies stretch potential energy is given to the bodies and this diminishes the linear acceleration, but this effect I neglected (though it makes a small contribution to $f(r)$ and also approaches one when the distance approaches infinity) which is why I assumed them to be rigid.
In most cases, there is no constant periodicity (i.e. after a certain number of rotations the initial relative position of the bodies arises again) which is the case when the ratio of the momenta of inertia is a non-rational (real) number, but nevertheless a periodicity is present.
Pffff....I think this is more than enough.
Just one more thing. I just realized that the CGs don't have to lay on a straight line piece (this is only the case when symmetry is involved), but in general, they lay on a curved line piece. As a first approximation, it will do though (like a first approximation in a multipole expansion).
Comment: Sorry for reacting a bit late! Anyhow, yes. When $R\rightarrow \infty$ then $f(r)\rightarrow 1$ so $F\cdot{R^2}\rightarrow GMm$. I realized just now though that the lines on which the $CG$s lie are in general not straight lines. But as a first approximation, it will do.
Comment: In your example, the mutual force is still proportional to $m M$, although the dependence on the distance is not $\propto 1/r^2$. This is obviously a consequence of the fact that the two objects are not separate in space by a large distance. In fact, they are one inside the other. It is not a consequence of the non spherical shape.
Comment: No matter how far apart, because the center of gravity and the center of mass don't coincide, the gravitational force that accelerates the two masses linearly (the force acting on the center of mass) varies, no matter how far they are apart. So $mM$ is preceded by a factor $f(r)$. What do you mean when you write **they are one inside the other**?
Comment: I think I was misled by the picture :D Ok, forget my last comment. In any case, in your example, if I understand it now correctly, you have $F=G M m f$ where $f$ depends on the distance. If the body are far apart, one has that $F\approx G M m/R^2$ asymptotically for $R\to\infty$.
Comment: Ah, you mean the picture of the cube Earth. I understand ;D But suppose we have, for example, two equal dumbbells very far apart ($R\rightarrow \infty$). $F$ goes to zero (so also the force which gives rise to the linear acceleration), but also the torque. The torque though is dependent on the angle between the force taking hold on the CG and the line CM-CM, which is zero when both dumbbells are at an infinite distance to each other. So what you say is indeed true. The function f(r) goes asymptotically to zero when infinity is approached.
Comment: Actually, when I say that it goes asymptotically as $\propto 1/R^2$ I mean that the force $F$ goes to zero (obviously), but $F\cdot R^2$ approaches a finite quantity for $R\to\infty$
Comment: When the bodies are at an infinite distance there is no acceleration whatsoever. As soon when the distance becomes very big (but not infinite), a very small torque and a very small linear acceleration develop. So when they slowly accelerate linearly they also start a slow periodic rotation because of the torque (containing a factor $r^2\sin{\theta}$, $r$ being the mean distance between the CM and CG). The question is if the ratio between the linear acceleration and the torque stays the same, which it obviously does not (a factor sinθ is involved in the torque).
Comment: @descheleschilder thanks for the answer!
Answer: This is not true in the general case if the two masses are close to each other. That is, if you have 2 different objects of the same mass but with different shapes, the gravitational attraction between these 2 objects and a third mass that is close enough to the objects will depend on the specifics of the situation. For example, imagine a large dumbbell. In the middle between the two big masses at the end, the gravitational force of these masses is equal and opposite, so with a zero resultant. Only the small bar in between the two "counts". Compare that to a large plate of the exact same mass. In this case, all the mass "counts". Of course, if the objects have the same shape, but one has a mass double the other, then the forces will be doubled.
If the objects between which you calculate attraction are far enough from each other however, this is a good approximation, irrespective of shape. To get the attraction you integrate the attraction between each small element of object 1 and each element of object 2. If you are not at the calculus level, you can say that you divide both objects in small pieces and add the contribution of attraction between all the pieces with each other. In that case, the 1/r^2 factor is approximatively a constant for all "force couples" and the inverse square law is a good approximation.
To address your comment in the question, changing the mass distribution but keeping shape the same can be equivalent to changing the distance, so this can change attraction. For example, in my dumbbell, make one of the dumbbell much more massive than the other one, then the attraction at the center changes direction.
As a last note, even if you use the center of mass of the objects to get the distance "r", changing mass distribution will affect attraction. The center of mass moves as a linear function of distance in the mass distribution, but the attraction moves as a function of 1/r^2. These cannot compensate each other exactly all the time. In my dumbbell example, you are at the center of mass in the middle between the two balls, yet attraction is zero. Now, transfer half of the mass of one sphere to the other. The center of mass moves towards the mass that gets heavier. Go to the new center of mass. The attraction is not zero, as you are now close to a larger mass and far from a small mass.
Comment: Why do add a third mass?  You are answering a question that was not asked.  Regarding the force changing when shapes change:  sure, the force changes, but that's not the question.  The question is,  is it still proportional to the product of the masses?
Comment: So basically, I am not answering the literal question, I am answering what I think the OP wants to know and which seems to be not well defined in the question.
Comment: The third mass is a "test mass". It is used to compare the attraction with two different objects having the same shape. I don't agree with you regarding shape. I think part of the question is change in shape. See the second comment on the question: "Thanks , but I am still not completely satisfied. Is it not possible that the force be some function of their masses that still conserves the units?( maybe a function that depends on the mass distribution in space or something?) I"
Comment: The person asked: "But I am not able to prove how the force between Any two rigid masses is proportional to the product of their masses( As my teacher says..)." I think he meant. "Only depended on the product of their masses". However, there is a "form factor" if you wish. Yes, doubling one of the masses doubles the attraction, but I don't think that's what the OP wants to know. (as per his comment about mass disctribution.
Comment: I asked for clarifications in the comments. I can always be wrong.
Comment: I could be, too.  I didn't read it the way you did ... so the OP should clarify the question.
Answer: It is not true that the gravitational force between extended mass distributions depends only on the product of the total masses. It is true that the time averaged total force integrated over each body is $$\vec F = Gm_1m_2 \frac{\vec r_{12}}{r_{12}^3} ~.$$ However, unless both mass distributions are spherical, the attraction has higher moments. These higher moment forces cause the bodies to be stressed and to nonuniformly rotate or wiggle. Only for certain relative orientations these higher moment forces exactly cancel the internal stresses.
An example is the Earth-Moon system. The moon is deformed but it is almost at rest in the corotating frame. It only wiggles a little. Weirder is the rotation of Mercury. It has a slight permanent dipole deformation causing it to rotate in a tidal 3:2 resonance. See https://en.wikipedia.org/wiki/Mercury_(planet)#Spin-orbit_resonance.
Answer: If to be summarized in short - you need to apply and solve second Newton law equation for two-body problem :
$$ \vec F_G = \mu \, \vec r^{\,\prime \prime} $$
Where $\mu$ is two-body system reduced mass :
$$
\mu ={\cfrac {m_{1}m_{2}}{m_{1}+m_{2}}}
$$
Btw, it's interesting to note that reduced mass has reciprocal additive property :
$$ {\frac {1}{\mu }}={\frac {1}{m_{1}}}+{\frac {1}{m_{2}}} $$
Reduced mass helps to analize two-body problem as it were just 1 single body. And $\vec r$ is displacement between bodies.
That's why gravity force is proportional to mass product of both bodies. (I.e. product increases faster than sum of masses). Another way which is helpful to physical intuition is to check the moment of inertia of binary system :

Which is :
$$
I={\frac {m_{1}m_{2}}{m_{1}\!+\!m_{2}}}x^{2}=\mu x^{2}
$$
Answer: It is not true in general that the gravitational force of attraction between extended bodies is proportional to their masses. It happens that we usually deal with gravitational attraction between celestial bodies, and that celestial bodies above a certain size are almost invariably close to spherical (in consequence of the self gravity of the body). In the particular case of spherical bodies, the result is true as a consequence of Newton's shell theorem.
In the general case, simply note that the inverse square law of gravity is basically the same (up to the sign of charge) as the Coulomb law of electrostatics, and apply the argument of any number of text book examples, such as the electrostatic attraction/repulsion for a charge uniformly distributed on a long rod, or a large plate. Clearly the force does depend on the distribution of charge/mass.
OTOH, with regard to gravity, because gravity is such a weak force, most of the practical examples with rigid bodies in celestial mechanics do involve spherical bodies. One important exception is to treat the gravitational field of a spiral galaxy (it is not rigid, but its mass distribution can be treated as constant). This is not the same as the gravitational field of a central mass. I have shown how it can be treated in The effects of turbulence generated in Big Bang nucleosynthesis
Answer: The simple explanation is that any finite body (i.e. occupying a bounded region of space) looks like a point from sufficiently far away. This observation also tells you what is the range of validity of this "law". The distance between the bodies needs to be much larger than the linear size of each body.
Using math and calculus it is possible to turn this intuition into precise and predictive equations. This approach goes under the name of multipole expansion
Answer: It is a fundamental "law" of nature that just happens to be true.
You can prove laws to a very high degree of accuracy, but from theory alone it is impossible to predict something fundamental by definition. Maths can't tell you the universe's axoims!
To give an example, Coulomb's law for the force between two charged masses is very similar to the gravitational law.
If this law is correct, it can be shown that the electric field inside any conductor is zero. Thus, instead of trying to test the law directly (separating to charges and measuring their forces very precisely), which is not very accurate, one can check the inverse square law for electrostatics to a very high precision by testing that the electric field really is zero inside a conductor by seeing if any charge flows onto a test rod.
Thus, although some laws may be hard to verify experimentally directly (such as by moving stars), we can check that the laws match up with our measurement of elliptical orbits and their time periods, amongst other things.
In fact, it was the orbit of Mercury that led scientists (Einstein) to show that Newton's Law of Gravitation was in fact incorrect as it did not match the experimental data.
So my answer to your question is that no, this law cannot be proven from some other law since it is fundamental, however, through experimental data, we can show that it is true and thus "good enough for the time being" until we find a better one! Can you really ever say that it is really true everywhere in the Universe without visiting every location in space and time? I'd say that's philosophy not Physics.
Comment: I see your point but taking the law for point masses as fundamental, I believe that there should be some way to deduce mathematically that the statement in question is true. The way Newton precisely proved the statement for spheres as a consequence of the law for point masses. So as long as the statement for point masses is true, The other statements deduced mathematically from it are equally true..That deduction is what I require
Comment: You treat the body as a combination of particles. The vector sum of the forces from each particle is the same as a force acting through the centre of mass.
Comment: It should also be noted that experimental physics had a large hand in helping to nail it down and continues to do so

Why is the Force of Gravitational Attraction between two “Extended” bodies proportional to the product of their masses?


Why are my classes private by default in Visual Studio?

Question: WIen I create a new class file, Visual Studio does not make it public by default.
Can I change this?
Comment: This appears to be an exact duplicate of http://stackoverflow.com/questions/39903/vs-net-defaults-to-private-class and that question also has an accepted answer.
Answer: By default a class without an access specifier is internal and a member defaults to private. This it keeps the visibility as restricted as possible and thereby increases encapsulation.
Making a new class public without even thinking about breaks the entire idea of encapsulation.
The class template that VS uses to create a new class can be found in this zip file (in case of CSharp):
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ItemTemplates\CSharp\1033\Class.zip or
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\Code\1033 when using VS Orcas
Open the zip file, add the public keyword, save it and you're done. Every time you add a class it will be public. Hope this helps.
Source
Answer: There are other issues with the default code templates - for example, they are not compliant with StyleCop out of the box, since the "using" lines are outside the namespace declaration.
You could use ReSharper to create your class files from templates, allowing you to put any code you want into the template.  That's what I do :)
Answer: I have heard complaints about this, I do not believe it an option that can be changed.
Answer: Do you mean the class itself is not available within other classes?  Or do you mean that all of the contents of the file default to private access?
If you want the class to be visible in other classes, you just need to make sure that the namespace is visible in the other class (with the "using" keyword in c#, or just have them in the same namespace).
Don't know which language you are talking about, but in c# all methods, member variables, properties etc default to private.  If you want them to be public you need to individually specify that for each member.  I don't think it's possible to change this behaviour in c#.
Answer: I don't think that you can change an option in VS so that all classes created are public by default (but I will look into it.)
I would think that unless that you have a very specific need for all your classes to be declared public (and I can't think of any) that you should leave the default as it is. This allows you to make decisions on exactly which classes are public and which should remain internal. In my opinion, a good design option would dictate that classes are declared 'internal' by default.