A Linear Diophantine Equation is of the following form: $Ax+By+C=0$, where $x_1\le x\le x_2$ and $y_1\le y\le y_2$.  If the value of $A$, $B$, $C$, $x_1$, $x_2$, $y_1$, $y_2$ are given and $x_1\le x_2$ and $y_1\le y_2$, then how many solutions can be found?  How can I find out the total number of solutions according to the above condition?  I asked the above question in this link: before. But there I didn't give sample input and output. I liked the second answer in the above link but when I checked the  sample input and output according to the second answer it gives me wrong result   It is worthy of mention that the reasoning of the second answer based on $A$, $B\gt 0$, but my question is that what I have to do if $A$, $B\lt 0$ and how will I match sample input and output using the given answer.  Here, I have included sample input and output:    I need a method that satisfies the above input and output. I also need better explanation of the method with example.
A Linear Diophantine Equation is of the following form:                                                                                        $Ax+By+C=0$, where $x_1 \leq x \leq x_2$ and $y_1 \leq y \leq y_2$.  If the value of $A,B,C,x_1,x_2,y_1,y_2$ are given and $x_1 \leq x_2$ and $y_1 \leq y_2$, then how many solutions can be found? How can I find out the total number of solutions according to the above condition.
Why does Stack Exchange use Imgur over Amazon S3 or Azure? What benefit does  offer over , , etc. for image hosting?   Is it the simplicity of integration? The cost model? What's better about using a "gateway"? Clone Ubuntu system to a pendrive and make it bootable? I have Ubuntu 14.04 installed on my laptop. Can I clone the entire system with apps, settings, etc on a USB 3 pendrive, and then boot from that on other computers as a portable Ubuntu installation to take around with me?  I am trying a function that Timeshift has that's called "Clone the current system on another device". I've selected the pendrive as the target device. Timeshift was talking about this being bootable. But is it going to bootable on only this laptop, or on any system? For example, on an Intel Mac, or a Windows computer without the grub bootloader? Is that Timeshift function what I am looking for, or do I have to do something else?  Edit: The Timeshift clone failed to boot on the first system I tested it on. (A Dell Hackintosh that usually boots from USB just fine.) Unable to Enter a Country If I have a connecting flight through a country I am unable to enter. Can I retrieve my bags to recheck for my connect? Multiple I2C devices with the same address I have multiple devices with the same address, and only one I2C bus. If I don't want to/can't use an address multiplexer, will the following arrangement work? (sorry for the messy schematic)          &ndash; Schematic created using   SW1 and SW2 are microcontroller I/O, and are pulled low when we don't want to talk to the corresponding IC, and set to high impedance when we do want to talk to that IC. Can anyone see any problems with this, apart from with clock stretching? Assuming you choose diodes with a small voltage drop, like a schottky.  Edit:   Also assuming that the VIH and VIL all worked out with the diode drop and the VOH VOL.   The diodes could also go on the data lines instead, not sure if there would be any benefit/difference (maybe some I2C devices do something special when the clock goes low even if it's not their address? It's probably safer to not clock at all i.e. have the diodes on the clock lines. How do I remove Windows but keep Ubuntu? I want to keep Ubuntu but remove Windows. How should a family with young children apply for UK visas? We are sponsoring a family to visit us in UK as friends from Madagascar for two weeks. They have a 6 year old and a 16 month old.   Do the kids need their own visas, and are they the standard visitor visa or a special child visa?   Also, when I try and apply on the website I can only apply for one person so how do I apply for all the individuals in the family?   I have looked on the Immigration website and can't find the answers I need. What does "rc" in .bashrc stand for? Is it "resource configuration", by any chance? Echo from MySQL database with spaces and line breaks? Suspend process without killing it So I've got a persistent program running in the background. Killing it just causes it to restart with a different PID. I'd like to suspend it (put it to sleep without actually killing it). Does kill -9 do this? If not, how should this be done? Applications Don't Show Up in Spotlight Spotlight has stopped showing any results for my Applications. I've tried reindexing and removing the index so it rebuilds it. No change. I've tried adding Applications to the Privacy tab and removing it, no change.  I tried repairing disk permissions and redoing the above, no change. I've tried removing everything from the index except Applications and then I just get nothing for any search at all (except dictionary entries).  I tried adding a symlink in my homedir to Applications and reindexing, but no change.  Any ideas on what to do?  I'm running Snow Leopard.  This is driving me crazy!  Update: I've noticed that when I start a reindex with sudo mdutil -E / and then immediately do a Spotlight search for an app that the app shows up temporarily until Spotlight gets disabled due to active indexing.  After the indexing is done, the app entries go away. What autofocus zone selection mode should I use for action/event shooting? I have a Canon 7D, and typically shoot everything I do in its single-point autofocus zone select mode, because I usually want fine control over exactly what the camera is focusing on and I often find that its two automatic focus zone select modes don't focus on what I want in focus.  For most of the photography I do, this is fine -- I have enough time that I can compose the shot the way I want, use the joystick on the back to select the right focus point, and take the shot at my leisure.  However, recently I've been doing more event/action photography, and I've been running into issues with this mode of operation.  Too often, I will see a person start to do something interesting, but my autofocus point is not in the right place -- so by the time I get the camera up, adjust the settings, and move the autofocus point, the opportunity to take the shot has passed.  My question is, what autofocus zone selection mode and workflow should I use for this type of photography?  I could use the 5-zone partial-auto mode (which gives me a choice of top, middle, bottom, left, or right, and then the camera chooses the points within my selected region), but I find that the time needed to switch in between that mode and the single-point mode is similarly prohibitive, and I have to hope that the camera chooses the right thing to focus on. Short version: In what circumstances is dd safe to use for copying data, safe meaning that there is no risk of corruption due to a partial read or write?  Long version — preamble: dd is often used to copy data, especially from or to a device (). It's sometimes attributed mystical properties of being able to access devices at a lower level than other tools (when in fact it's the device file that's doing the magic) — yet dd if=/dev/sda is the same thing as cat /dev/sda. dd is sometimes thought to be faster, but . Nonetheless, .  Problem: dd if=foo of=bar is not, in fact, the same as cat &lt;foo &gt;bar. On most unices¹, dd makes a single call to . (I find  fuzzy on what constitutes “reading an input block” in dd.) If read() returns a partial result (which, according to POSIX and other reference documents, it's allowed to unless the implementation documentation says otherwise), a partial block is copied. Exactly the same issue exists for write().  Observations: In practice, I've found that dd can cope with block devices and regular files, but that may just be that I haven't exercised it much. When it comes to pipes, it's not difficult to put dd at fault; for example try :  yes | dd of=out bs=1024k count=10   and check the size of the out file (it's likely to be well under 10MB).  Question: In what circumstances is dd safe to use for copying data? In other words, what conditions on the block sizes, on the implementation, on the file types, etc, can ensure that dd will copy all the data?  ( has a fullblock flag to tell it to call read() or write() in a loop so as to transfer a full block. So dd iflag=fullblock is always safe. My question is about the case when these flags (which don't exist on other implementations) are not used.)  ¹  I've checked on OpenBSD, GNU coreutils and BusyBox. map to drive on server with bat file I have a web server that I want to map a drive to it. I want to do this in a .bat file. Pseudo ->   Check if a drive at an ip address has been mapped to a local drive.  If it has then progress with a reference to the drive If not map to a local drive and then progress with a reference to the drive  Is this possible and if so how can I achieve it? Trigger to use HTTP callout and update record with the results I have been trying to integrate Google Shortener API into my salesforce org. I wrote a class to make the call out, but am having difficulty bringing the value back into the record. I have a custom object called "referral_advocate__c" with a field called "Short_URL__c". Anytime the field "unique_ID__c" has a value, I am wanting to send this value with a static URL to google shortener and then save the response value to "referral_advocate__c.short_URL__c" on the record. This is the class to make the call out:  public class URLshort {  final string urls = 'https://www.myurl.com'; referral_advocate__c adv = new referral_advocate__c();  @future(callout = true) public static void URLshortner() {      HttpRequest req = new HttpRequest();     HttpResponse res = new HttpResponse();     Http http = new Http();      req.setEndpoint('https://www.googleapis.com/urlshortener/v1/url?key=myapikey');     req.setMethod('POST');     req.setHeader('Content-Type','application/json');            req.setBody('{"longUrl":+urls + adv.unique_reference_number_c}');       try {         res = http.send(req);         System.debug(res.getBody());     } catch(System.CalloutException e) {         System.debug('Callout error: '+ e);         System.debug(res.toString());     }   }  }   The after insert trigger on "referral_advocate__c" I wrote is not firing correctly. How do I return the results from this class and update the field "short_URL__C" with the returned value from a trigger? Why does comparing strings using either '==' or 'is' sometimes produce a different result? I've begun cooking Asian food in the past year or so, and in many Korean and Chinese beef recipes, I see instructions to soak beef in water. Just plain water, not salt water or anything. And every recipe seems to have a different  time - from 5 minutes to like, multiple hours.  I inquired about this and was given various reasons for this step, including "to remove the blood (because it is simply undesirable", "To remove the blood, because it gives the meat a bad taste" or "To soften the beef".  I'm wondering:   Does soaking meat in water really remove that much blood? How much of a flavor component is blood and why would it give it a bad taste (especially since i've never soaked beef before and I've like the taste just fine)? What is the action of solute-free water on a piece of beef immersed in it? Can it really tenderise it to any degree, or is there any osmosis occurring or other such physical/chemical action? Okay. If I wanted to redirect the output of a program to a file, I'd do something like this  prog &gt; file   If I wanted to redirect both stdout and stderr to that file, then I'd do  prog &gt; file 2&gt;&amp;1   This is all well and good if you want the output to go to the file. But what if you want the output to go to the file and yet still go to stdout/stderr? So, the output is saved in the file, but you can still see it on the console as the program is running. Is there a way to do that? And if so, how? New 16GB of RAM installed yet I see 15.3 on my system. Why? Just switched 4GBs to 16GBs of RAM. However, when I look at how much memory I have, it says 15.3. I'm just wondering why did my memory drop down when I just installed 16 GBs of RAM. Similar matrices and field extensions I am looking for either an online tool or one that I can download to convert DD to DMS.  For example, I want to convert from:  41.590833, -93.620833 to 41° 35′ 27″ N, 93° 37′ 15″ W ...  Those are the coordinates, according to , for Des Moines.