How do I sort an array of Person Objects by using compareto()?

Question: Here is my code:
> import java.util.Scanner;
  import java.util.Arrays;

  /**
  This class tests the Person class.
  */
  public class PersonDemo
   {
    public static void main(String[] args)
    {
    int count = 0;
    Scanner in = new Scanner(System.in);

    boolean more = false;
    Person first = null;
    Person last = null;
    while (more)
    {
      System.out.println(
          "Please enter the person's name or a blank line to quit");
      String name = in.nextLine();

      if (name.equals(""))
       more = false;
      else
      {
       Person p = new Person(name); //new person object created with inputted name

       Person[] people = new Person[10]; //new array of 10 person objects
       people[count] = p; //declare person object with index of variable count as the new person object

       first = people[count];  // I have no idea what to do here.  This is where I'm stuck.
       last = people[count];   // I can't figure out what to do with this either.

       first.compareTo(p); //call compareTo method on first and new person object
       last.compareTo(p);  //call compareTo method on last and new person object

       count++; // increase count variable
      }
     }

      System.out.println("First: " + first.toString());
      System.out.println("Last: " + last.toString());
     }
   }

And the Person class:
/**
  A person with a name.
*/
public class Person implements Comparable

{
 /**
  * Constructs a Person with a name.
  * @param aName the person's name
  */
 public Person(String aName)
 {
  name = aName;
 }

 public String getName()
 {
  return name;
 }

 @Override
 public int compareTo(Object otherObject)
 {
  Person other = (Person)otherObject;
  if (name.compareTo(other.name) < 0) return -1;
  if (name.compareTo(other.name)  > 0) return 1;
  return 0;
 }

 /**
        Returns a string representation of the object.
        @return name of Person
 */
 public String toString()
 {
  return "[name=" + name + "]";
   }

 private String name;

}

Answer: What you are actually missing is that compareTo is a functionality that you give to objects. In your example you give a Person instance the capability of being compared with other Person to achieve a total ordering of the elements of that class.
Usually this method is implictly used by JDK collections like Lists, SortedMaps and so on but you have an array, that is a sort of primitive type, so you should look at Arrays.sort(Object[]) which will take care about ordering it using the Comparable interface.
A hint: since your compareTo method just work on the String of the Person you can easily just return its value instead of checking it to behave in the same way.
Answer: First off, get your array creation outside the loop. Second, even if the homework assignment said they'll only enter 10 names, you should assume more - you're just asking for IndexOutOfBoundsExceptions there. Consider using a collection like TreeSet which sorts automatically.
To sort an array:
Person[] people = new Person[10];
// add elements to the array...
java.util.Arrays.sort(people);
first = people[0];
// etc...

To sort a Collection (a Set is a Collection without duplicates) just use TreeSet and they're sorted automatically.
TreeSet<Person> people = new TreeSet<Person>(); // using generics to say "only Person objects are allowed"
while (more) {
    System.out.println("Please enter the person's name or a blank line to quit");
    String name = in.nextLine();

    if (name.equals(""))
        more = false;
    else
        people.add(new Person(name));
}

System.out.println("First: " + people.first());
System.out.println("Last: " + people.last());

Comment: The assignment may have said to not use a collection/arraylist, etc. etc.  Although, if you can, I would use a class to let java do it for you.
Answer: Well, first of all, your code won't do much of anything until you set more to true initially.  Otherwise, you'll just get a null pointer exception when you try to call tostring on a null object.
Also, don't create the person array within the while loop, otherwise it will be reset every time, and defeat what seems to be the purpose of storing all of the people.
Also, given to objects foo and bar, of the zoo class, you can't just do:
foo.compareto(bar);

That would be like just having a line of code like
-4;

Java doesn't like it.
So, to answer your question, using compare to methods, are like preform truth tests.  For example
if(foo<bar)
     /*Do something*/;

Except, you can use .compareto() so that your actually comparing objects, rather than simply the references.  So, you can determin which object of type zoo is greater, foo or bar, by comparing them with compare to.  The API for compareto stipulates that if 0 is returned, their equal, if a positive number is returned, the first is greater, and if a negative number is returned, the second is greater.  So:
if(foo.compareto(bar) >0)
    /* foo is greater*/;
else if(foo.compareto(bar) = 0)
    /* foo and bar are equal*/;
else
    /* bar is greater*/;


How can I randomly distribute objects in Illustrator?

Question: I have a small star object that I'd like to randomly distribute copies of all over a large space background in Illustrator CC. How can I do this automatically? I've tried to do it manually but the results are never "random" enough, and making it dense enough is very time-consuming.
Comment: Hey megrage and welcome. Do [any](http://graphicdesign.stackexchange.com/q/27916/23061) [of](http://graphicdesign.stackexchange.com/q/64015/23061) [these](http://graphicdesign.stackexchange.com/q/57287/23061) [posts](http://graphicdesign.stackexchange.com/q/48504/23061) work for you?
Answer: @ZachSaucier suggested old posts that address your issue. But if they still don't help you, a custom Scatter Brush will do the trick in just a few minutes. Here are a few steps on how to.

Draw your desired star on the artboard
Open the Brushes pane by pressing F5

Drag your star onto the Brushes panel. (A dialog window will pop up, and please make sure you have selected Scatter Brush second option as of Illustrator CC), and click okay.

Another option dialog dialog Scatter Brush Options will popup. Name your brush, and make sure the Size, Spacing, Scatter, and Rotation are set to Random (depending on what aspects you wish to randomize)

You can hide the star, and draw a random path/Pen Tool on the art board make sure it has no fill but just the stroke.

You can now select your custom brush from the panel with the path still selected

NOTE: To play around with the randomness, you can always double click on your custom brush to open its options, adjust the sliders and make sure preview is checked. Adjusting the shape of your path also helps a lot. For best effects of the overflow starts, you can create a clipping mask to hide them.
Other cool customization, Colorization/Tints and Rotation Relative to Path/Page.

Hope this helps.
Comment: Thanks, that works really well! Can you tell me how to make the stars individuals editable and remove the path? Basically like resetting the bounding box after rotating an object makes the bounds reflect what's on the screen.
Comment: Expanding the Appearance the of the path to make it fully editable will do the trick. This can be achieved by selecting the path then from the Objects Menu "`Alt` + `O`" **> Expand Appearance**. Note that this will take away the brush properties so its a good idea to back it up(*duplicate it and hide it*) just incase.


Binary of IPhone in iPad?

Question: I am new to iPad,I am having iPhone distribution build, can i upload to apple for iPad Device?Will it run? will it be accepted by Apple?otherwise i have to create new Ipad application for existing iphone application?
Answer: Practically all iPhone apps will run unmodified on the iPad. They will simply be scaled up pixel-by-pixel (with a little "2x" button so the user can choose scaled/unscaled mode).
For the best user experience, you should create a universal binary that provides customised behaviour for each platform, but this isn't required.
Answer: Any iPhone application, an application that has not been optimized for the iPad, will run on the iPad in 'compatibility mode', which means it will get its own iPhone-sized frame in the center of the iPad screen. The user also has the option to zoom in the application 2 times, so it takes up almost the entire iPad screen.
So if you want your app to run at all on the iPad, you don't have to do anything exciting, just submit it to Apple as usual, and iPad users will be able to download and use it.
If you want to optimize your application for the iPad, which is almost always preferred over 'compatibility mode', you can either make your current application into a Universal one, which is an app which contains both iPhone and iPad versions, in one binary, or you can create two different applications, one for the iPhone and one for the iPad. You can find more information on this on the Apple Developer website.

Binary of IPhone in iPad?


Can't display downloaded image in  in Firefox

Question: I'm writing a web application using a <canvas> element. For simplicity, I have stripped it down to the bare essentials needed to show the problem: http://demo.kuehldesign.net/imagetest/
On Safari and Chrome (Mac), the test.png image which is drawn on the canvas always shows, even when it was not previously downloaded.
For some reason, when Firefox has not previously downloaded the file (and presumably stored it in the cache), the file is not displayed (even though Image.onload is called).
To replicate:

Open the link above in the latest Firefox (I'm on Mac, guessing it happens on other OSes as well)
Refresh the page. It should have worked that time.
Hold shift while refreshing the page to not use the cache. You should see a status which is called when the image is downloaded, but not see the image.

The same steps show the image fine in Chrome and Safari.
Any ideas why Firefox is not showing the image even after it has loaded? Ideally I would like to continue passing the Imageobject as a parameter to the test function.
Thanks.
Answer: I can see image in Firefox, it seems working fine for me.
Answer: Setting image.src = image.src after adding the onload event handler fixed the problem.


Unknown Old Coordinate System of the Phillipines

Question: I am reading a report made in 1979 and the coordinates show N 46,400 and E 47, 600. This is in The Philippines. Would anybody know what the coordinate system was used in this numbers?
Comment: Can you tell us who made the report (country, organisation, anything!)?
Answer: Best I could find was Luzon 1911 Phillipines Zone V, EPSG:25395. The point would be at least south to the phillipines. Main islands lay about 1000000 metres north.
UTM 51N and Pulkovo CM123E are almost nearby.
For more information on Phillipine datums, have a look at:
http://www.asprs.org/a/resources/grids/08-99-phillipines.pdf
According to that, false Northing was at 4° North up to 1962, then set to the equator.
So using the following proj string:
<code>+proj=tmerc +lat_0=4 +lon_0=125 +k=0.99995 +x_0=500000 +y_0=0 +ellps=clrk66 +towgs84=-133,-77,-51,0,0,0,0 +units=m +no_defs
</code>
gives the follwing picture:
Comment: Thanks! I got these coordinates from an archaic document so I guess it's a mistake. It should be in Northern Philippines.


Azure API Management OAuth 2.0 Resource Owner Password Flow Client ID

Question: Context:

My software application is a multi-tenant application that customers can log into and generate their own clientIDs to use with a resource owner password flow OAuth Request.
Our OAuth 2.0 authorization server is built in WebAPI and inherits from the Microsoft provided Microsoft.Owin.Security.OAuth.OAuthAuthorizationServerProvider class.
Currently, we only support one flow (resource owner password) to get a token, which looks like:
POST /api/v1.0/token HTTP/1.1
Host: api.mysoftwareapp.com

UserName={username}&Password={password}&grant_type=password&client_id={client_id}

After we validate the credentials & client ID, we send back an access token generated by the Microsoft.Owin.Security.OAuth.OAuthAuthorizationServerProvider base class. In order to access a resource, a user would need to supply the access_token in the Authorization header as a Bearer token. Client ID is not required to be passed in again. Example below:
GET /api/v1.0/Partners HTTP/1.1
Host: api.mysoftwareapp.com
Authorization: Bearer this_is_where_the_token_goes

I'd like to implement the developer portal feature of Azure API management and allow for my customers to be able to input their own username, password, and client ID when making test calls, so they get data back in the context of their tenant (and ultimately - enable rate limiting by client ID).
In the publisher portal, under Security->OAuth 2.0, I've:

Only checked the Resource owner password grant type.
Specified my authorization request method as POST.
Added my token endpoint URL.
Added grant_type / password as an additional body parameter.
Left the resource owner password credentials blank.

I've also done the following since they were required, but I believe does not apply due to only supporting resource owner password flow, and handling client registrations through my own application:

Added my authorization endpoint URL.
Selected 'In the Body' as my client authentication method.
Added fake client credentials.
Added a fake client registration page URL.

Here's a screenshot of that:

When I navigate to the developer portal and view an endpoint, I can select 'Resource onwer password' under my Auth server. However, when I select this, a popup shows that only lets me input my username and password, NOT my client ID.
How do I set up Azure API Management to allow a user to also specify the client ID they would like to use when setting up authorization - or would we need to change our API to require the client ID when making calls to specific resources instead of when requesting a token?
This is what I'd need:
Answer: In order to pass these values in the POST body, you need to change the client authentication method from "basic" to "post".
Go to Publisher Portal security, and modify the OAuth2 server settings to be like the below:
Comment: Hey Kevin, thanks for the response. I changed that, but still doesn't get me what I need - I need the ability for a developer to be able to enter a client ID when requesting a token. I updated the original post with a screenshot of what I'm looking for.


Testing phone installation without phone service

Question: Is there a way, such as a simulation tool, that would allow me to test some phone wiring + outlets without having actual phone service? A device that would fake signal from one end to another?
Comment: Quite a few I imagine.  You just need to send low voltage over the wires from one end to a phone.  Phone service only required to talk to people.  Would do an amazon search for phone/ phone circuit/phone line testers.
Comment: @MonkeyZeus A traditional landline phone requires the phone company to connect the premises; their 48V current is what powers the phones. To test, you'll need a device to send active signal over the lines and termination points. Before the carrier lights up the property that's best done with a line tester, such as per answers by gnicko and Criggie.
Answer: There are devices called "Tone Testers" which plug in to each end of a run and test the integrity of the wires. You should be able to pick one up for about $20. You can get them for RJ11 (telephone) and Ethernet (RJ45) runs. Some will work for both.
Here is one example (https://www.amazon.com/Multifunction-Telephone-Ethernet-Collation-Continuity/dp/B09MRVTDHZ)

There are hundreds of other models for sale from thousands of retailers. This is just an example.
Comment: Remember voice is just a simple single pair of wires, so for testing wiring inside a home (up to the demarcation point) this is more than adequate.    Any service problems outside the demark point are the problem of the telco not the customer/enduser.
Comment: What you illustrate there is a cable tester with tone facility. A simple tone tester is for *identifying* pairs and will pass a tone across broken wires which will not wotk with a telephone.
Answer: If you're doing this a lot, a common tool is a Butt Phone  amongst other things.

This is capable of being a subscriber phone talking to the exchange (aka the Central Office), or the other way, providing voltages to a regular subscriber phone and looking like it is the exchange/CO.  They can also listen into an active line without drawing power and affecting the call quality because the have a battery inside.
So you could clip this to one end of your dry pair of copper cables, and have an analogue telephone at the other.  Then you and an assistant could both pick up the phone and have a conversation.  Some butt phones can cause the remote phone to ring/sound like a regular incoming call.
Downside, quality units will cost $500 US each refurbished or twice that new, so they're out of the reach of handypersons.  I've also seen cheap knockoff ones for about $100 US, which is more accessible.
More info: https://en.wikipedia.org/wiki/Lineman%27s_handset
Answer: There are devices called phone line simulators which you can hook up standard handsets or modems and it will simulate connections.
It can simulate calling and ringing as well.
Here is a popular vendor: https://vikingelectronics.com/products/dle-200b/
Answer: There are VoIP boxes that simulate real phone service and don't cost much.   You could buy one, sign up for one month of some arbitrary VoIP service, and test away, making and receiving actual calls.
"Ah", you say, "but I don't have internet service either!   If I did, I would have phone service".   You did not say that .... but you're going to.  So.   Buy a router, for example an Eero but there are many, that can use your cell phone's hotspot as a backup ISP.  Turn on the hot spot, connect the router to it, connect the voip to the router and test away.
"Nah", you might argue, "this does not answer the question about testing "without having actual phone service", because ..... it is actual phone service.  Ok.  But it gets the job done.
If all that is more than you had in mind,  you can test the connectivity (but not functionality) of the wiring by building some RJ11 plugs that short pairs of pins together, plugging in to one of the outlets in the system, then going to other outlets and using an ohm meter to see that the pins that are either shorted or not shorted have the expected readings.  This doesn't test things like poor connections that won't carry ring current, noise pickup, etc.
Comment: What did Excel have to say for itself when you called it, @user253751?
Comment: Once for a little project I set up my PC as a VOIP server and then I could make calls from the attached ATA (Analog Telephone Adapter) to various programs on my PC
Comment: @user253751 Excel wouldn't answer for FreeMan!


Steam WindowsPhone 8 App

Question: Is there any Steam application for WindowsPhone 8? I have seen it for Android and iOS. Please let me know if there's any.
Comment: This question appears to be off-topic because it has to do with finding out if a particular type of app exists.
Answer: A quick google search (all I searched for was "steam app windows 8 phone") brought me to the Windows Store where there is a Steam app for download. It does work on the Windows 7.5 and Windows 8 platform.
Comment: @NeilTurner the poster asked if there was "any" application. There is actually 2 of them that I found right away. I never said it was an the official app from Steam, I was providing what the poster asked for.
Comment: That's not the official app!
Comment: In that case, the user is very lazy and this question should be closed.
Answer: A quick search in the Windows Phone Store will reveal "Steam Center" by DG-InfoTec as the first search result. There are numerous other third-party apps available as well.
If you want an official app, contact Valve.
I'm new here, so can't comment or vote up comments yet, but +1 for off-topic by karancan. Even if asking if an app exists is OK, it doesn't take a lot of effort to search the store yourself before asking.
Comment: Thanks for the +1 :) but I will have to flag your answer as not an answer!
Comment: Eh, I suppose that's fair, since it looks like C-dizzle and I came up with the same answer - though our sources differed (google vs. the Windows Store). I'll cry, but I think I'll get over it.
Comment: Perhaps you would like to chime in on this post http://meta.windowsphone.stackexchange.com/questions/191/what-about-change-the-faq-allowing-question-about-apps . Your input would be greatly appreciated.
Comment: @row1 I would love to chime in - still working for those all important reputation points >.< I'll keep an eye on it and when I have the rep I'll add my 2 bits.

Steam WindowsPhone 8 App


garage wiring problem

Question: I have 3 wires coming into a 3 way switch. I connected the hot black wire to the brass screw on the left side of the switch. I connected the red traveler wire to the black screw on the right side of the switch  opposite the brass screw. I connected the white traveler wire to the brass screw on the top of the right side of the switch. The five lights in the circuit will then go on and off with the operation of the switch. The light fixtures are wired to the switch utilizing the white and red traveler wires. My problem is I cannot get the other 3 way switch to function no matter what wiring combination I try. I would like to know the correct way to wire the second switch. Two things to note. There were two 4 way switches in the circuit. I took those switches out of the circuit by wiring the two red wires together, in each box, and doing the same with the white wires. The other note is that there is no current going to the second switch no matter how I connect the wires. Am I not connecting a load to the circuit at the second switch?
Comment: Can you sketch a wiring diagram and add that to your question?  It would be a lot easier to follow.  Plus, the exercise of diagramming it often makes the issue clear before you're even done with your sketch.
Answer: The black screw on a 3-way switch is the common, and the brass screws are the travelers.  It sounds like you wired up the switch incorrectly.

garage wiring problem


Sum of two i.i.d R.V having singly non-central F distribution

Question: Noncentral F-distribution is used frequently in communication areas. In one of the applications, I need to do a sum of two i.i.d R.V having non-central F-distribution with parameter 1 (d.o.f for numerator), $N-1$ (d.o.f for the denominator) and $\lambda$ (non-centrality) parameter of the numerator. Is there any standard result on the sum of these two R.V.? or is there any approximation result? Since applying a straightforward approach, i.e., the convolution formula, is tough or doesn't seem to have a closed-form solution.
Answer: I think you end up having a non-standard distribution. My (tentative) approach would be the following. Let $W_{j}\sim \mathrm{F}_{1,N-1,\lambda},j=1,2$.
First, we know that $\widetilde{T}_j\sim \mathrm{t}_{N-1,\lambda},\widetilde{T}_j:=\sqrt{W_j},j=1,2,$ where $\mathrm{t}_{\nu,\mu}$ is the non-central $\mathrm{t}$ distribution with $\nu$ degrees of freedom and non-centrality parameter $\lambda$.
Second, I would consider the centralized version of the two random variables above. Namely,
$$T_j = \widetilde{T}_j-\frac{\lambda}{\sqrt{V/(N-1)}},\quad V\sim \chi_{N-1}^2.$$
Finally, this paper provides a formula for the density of two independent $d$-dimensional Student-$t$ random vectors. In your case $d=1$. If you can work with $(T_1,T_2)$ instead of $(W_1,W_2)$ you are done. Otherwise, you simply transform the density for $T_1+T_2$ given in the paper into the density of $W_1+W_2$ using the relationships mentioned above.


R combining vectors into a data frame but without a continuous common variable

Question: I have two different files which I'd like to combine to make one data frame but I've no idea how to do it! The first file has two columns; one is the date, the following is a binary code for debris flow events. Then my other file has also two columns; the date and then precipitation data.
The thing is, is that the two date columns don't all contain the same dates. The binary one is every day from April - October from 1900 - 2005, yet the precipitation file has dates from from say, 1911 to 2004, with some missing data on certain months and during certain years.
So my question is how to make a data frame which would have the date, the binary 0 or 1, and then the corresponding precip value from that particular date. I only want the precip information for the days where I have information in the binary file; the others can be disregarded.
I have tried using codes which I found in answer to other questions asked but none of them work with my issue. If I'm honest I don't really know if this is what I need. I'm hoping to end up doing a logistic regression.
I'd be really grateful if anyone could help me and suggest a way to do it!
I'm also really not very technical and am not at all comfortable with R so if you could be really basic in your advice I'd appreciate it!
Comment: Can you be more specific about which "codes" you used from "answer to other questions asked"?
Comment: We love [reproducible example](http://stackoverflow.com/q/5963269) here. So please share your code that didn't work.
Answer: If you want to combine data which have identical dates, take a look at %in% and intersect .   Something like
# not tested. Beware.
new_dates<- intersect(data_1[,1],data_2[,1])
new_data <- cbind(new_dates,data_1[data_1[,1] %in% new_dates,2] , data_2{data_2 %in% new_dates,2])

(probably much cleaner ways with the ever-looming plyr package :-)  )


How much can domain admin really do without access to domain controller?

Question: With almost all ports blocked on the domain, there is no way for intruder to remotely access domain controller and do big changes to the domain. Can anyone enlighten me on why a lot of resources are still put into protecting domain admin accounts and how much possible harm can an intruder do with domain admin account without access to DC?
Comment: Domain admin accounts have admin access on all the workstations as well, not just the DC. They're literally the God-tier account of the enterprise.
Comment: Do you trust all your users? Even if you are part of a large company with 1000s of employees? One bad legitimate user could compromise the whole lot without being remote.
Comment: If they gain access to an Domain Admin account, they can in theory, exploit any vulnerability that exists on your network.  Don't say it can't happen, many companies are compromised from the very bottom and escalate their access slowly.
Answer: Maybe this will help:
You said:
"With almost all ports blocked on the domain, there is no way for intruder to remotely access domain controller and do big changes to the domain."
All ports blocked? inbound or outbound? This is the idea behind rats/backdoors.
If a domain admin can control any system, they can disable a system from domain restrictions if they wanted to. Leaving them more vulnerable than you'd expect (a monitoring note). If they domain admin wanted access to the domain controller, they'd pretty much just need to backdoor or monitor a user who does have access. They can launch exploits that may require admin privs locally to exploit. Fileshare and vm escapes sell for some good monies these days. I mean, there's a whole world of possibilities. If your single point of failure is your DC, you might want to think about the platform your DC is on. Most people, it's on windows, with other services, on a shitty physical box or virtual instance. If it's in a virtual instance, that's probably within a whole other realm. People have found attackers using dns, http, smtp, irc, xmpp, smb, nss, slack web api, other web api, etc... to pull data about your enterprise out depending on abilities of your network. Some attackers have dozens of malware generators just for these types of network and will rotate between sample structures until something else works (often from phishing).
So, to answer the question, your enterprise is at stake. You don't need domain controller access, which an intruder would have better leverage to attack at with domain admin creds, to own an entire company. That hasn't been thought of as needed or required for many years. The claim that ports being blocked doesn't really change that.
If your entire network has no external access, PoC campaigns have shown that this doesn't really stop someone dedicated to taking your company.
Soo.... The reason why people put so much effort into it is because it's a baseline monitoring requirement if nothing else to attempt to protect administrative accounts that can compromise any system in your enterprise.


ASA IPS issue: routing and management interface

Question: We have management network (192.168.25.0/24) where we have management ip of ASA 5525-X IPS Bundle (.250) and IPS (.37). The IPS has a default gateway of our Layer 3 (.1) switch that is behind the ASA (according to Cisco's docs).
To pass traffic back to the IPS, I created a route for 192.168.25.0/24 that points to the L3 switch.
When I type #sh route on the ASA:
C    192.168.30.0 255.255.255.0 is directly connected, inside
C    192.168.25.0 255.255.255.0 is directly connected, management
C    192.168.35.0 255.255.255.0 is directly connected, outside
S*   0.0.0.0 0.0.0.0 [1/0] via 192.168.35.1, outside

at the same time #sh running-config route:
route outside 0.0.0.0 0.0.0.0 192.168.35.1 1
route inside 192.168.25.0 255.255.255.0 192.168.30.2 1

So, in the routing table I have information that subnet is directly connected and is it management interface traffic will not pass to IPS. But the IPS can access Internet and traffic goes through L3 switch (I checked counter).
Can someone explain how routing for the IPS function should work?
Comment: If you remove the ip address from the management I terrace, what IP do you use to contact the device on?
Comment: Did any answer help you? if so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could post and accept your own answer.
Answer: I've run into this problem before and there's a couple things happening in this scenario.
First, The Management interface does not play by the same rules as other interfaces on the FW.  By default it will not pass or receive traffic from any other interface on the device due to the "Management-Only" setting.
Second, the way that Cisco implements the Management interface causes a routing loop with the ASA.  You would like to route all traffic to the management network through the L3 switch on the Inside, but the ASA sees the Management network as directly connected via the Management interface
You would like the traffic to take the following path:
IPS > L3 Switch > ASA Inside > Internet > ASA Outside > L3 Switch > IPS
Unfortunately, the path it is actually taking looks like this:
IPS > L3 Switch > ASA Inside > Internet > ASA Outside > Bit Bucket
Any packet sent from the IPS to the internet is returned to the ASA Outside interface, at which point the routing table is checked and it sees that the management network is directly connected via the Management interface.  Since the Management interface will not receive traffic from another interface by default, the bits hit the floor.
Unfortunately, the best way to resolve this issue is to abandon using the Management interface to manage the firewall and instead use the Inside interface.  If you remove the IP address of the Management interface (but still keep the port enabled for the IPS module), that will remove the Management network from the ASA routing table.  This will allow the traffic to take the correct path back to the L3 switch on the Inside when it returns from the Internet.
I hope this helps
Comment: Thank you!
I understand that traffic from INternet to IPS have to go like this: IPS > L3 Switch > ASA Inside > Internet > ASA Outside > Bit Bucket, because we have connected network in the routing table.

But traffic go in such a way: IPS > L3 Switch > ASA Inside > Internet > ASA Outside > L3 Switch > IPS and it is rather strange ).

P.S. when I want to remove static route (route inside 192.168.25.0 255.255.255.0 192.168.30.2 1) from running-configuration I get error: ERROR: Cannot remove connected route.

Very strange behaviour.
Comment: It's a connected route, and it's not pointed at the inside but at the actual management interface.
Answer: Unfortunately the mgmt0/0 interface on an ASA is often misused.  It should only be used for management of the admin/system context of an ASA in multi-context mode, or for a dedicated management subnet that uses the ASA as its default gateway.
What you need to do is remove the IP address from the mgmt0/0 interface on the ASA itself (NOT THE IPS!!) and everything should work as expected as long as the management subnet is routed out the correct interface on the ASA.
What is happening with the ASA having an interface into the management subnet (192.168.25.0/24 in this case) is all packets from that subnet that use an internal gateway (L3 switch) and then try and forward packets through the inside interface are failing the reverse-path-forwarding (RPF) check and being dropped as spoofed traffic.
The actual traffic flow that you are seeing is IPS>L3 Switch>ASA>Bit Bucket(RPF Failure), until you re-address the IPS, disable RPF checking (not advised) or remove the IP from the ASA's management0/0 interface you will continue to see this behavior.


Do any characters from Jumanji appear in Jumanji: Welcome to the Jungle?

Question: I'm thinking about going to see Jumanji: Welcome to the Jungle and I was wondering, do any of the characters from the original Jumanji appear in it?
I'm interested in both the actual characters, played by the same or different actors, and the actors from the original film appearing in a cameo.
Answer: No.
I saw the new one recently and as far as I remember there are no cameos by any original movie actor. However, there are subtle references to characters from the previous movie.
The references which I noticed are (Spoiler Alert!):

  You can see the original Jumanji Board in the beginning of the movie.
  There is also a reference to Alan Parrish (Robin William's Character from the original movie) when the actors are inside Jumanji.
Answer: There is one (altered) character that appears in both movies: Van Pelt.
In Jumanji, he's a big game hunter that escapes from the game into the real world. In Jumanji: Welcome to the Jungle, he's been transformed by the game into an explorer and antagonist/rival to the PCs. The two are also played by different actors: Jonathan Hyde vs Bobby Cannavale.
Comment: Do we know if it is the same Van Pelt? Couldn't it be his son or even grandson?
Comment: @Skooba I mean, Van Pelt isn't real--the game transformed itself to fit a 90s video game aesthetic; it makes sense to me that it'd transform its main antagonist as well. Narrative continuity isn't something it needs. But if it helps: Alex had been there for 20 years. He entered right after the first Jumanji movie. and felt like a matter of weeks or months had passed. Cannavale was about 45 at the time of filming Jumanji 2; Hyde about 45 when filming Jumanji 1. Not old enough to be the dad, assuming Van Pelt 2.0 has been there the whole time, which as the main antagonist makes sense.
Comment: The Jumanji WIki points out that Van Pelt in Welcome to the Jungle is closer to the Van Pelt from the Animated Series, maybe he was based off of that?
Comment: Nora Shepherd, Judy and Peter's aunt from the first movie, appears in Jumanji: The Next Level. She is the same character, and portrayed by the same actress (Bebe Neuwirth), albeit likely from the 'new' timeline established the end of the first film.


Manhwa where girl is reincarnated as her past self 3 times

Question: So in the start it shows how a little girl (black hair green eyes) chose to marry a duke (blond hair blue eyes) instead of a king (red hair) and said she chose the blond kid "because he's pretty".  It later shows that she has relived her life multiple times: the first time she killed herself after realizing her husband the king gave her stds, the second time she killed herself because she married a poor painter and they killed him and took her baby, and in her current life she is trying to have the blond guy she choose to marry cheat on her so that she can get a divorce and live her life peacefully.
Comment: Hi, welcome to SF&F.  Where and when did you read this?  Do you recall the names of any of the characters?
Answer: Is this The Broken Ring: This Marriage Will Fail Anyway...?

When six-year-old Inés laid eyes on the handsome heir to House Escalante, she promptly made the boy her fiancé. Since noble men are all the same, she figured she might as well choose a pretty one. But Lord Cárcel isn't ready for this sort of commitment just yet, and he spends the next decade and a half avoiding the marriage at all costs! Luckily, that's no trouble for Inés, as this marriage failing is exactly what she wants. In fact, he has her blessing to sow his wild oats as long as he stays out of her business. Unfortunately, being a playboy isn't as fun when your fiancée gives you permission. And doesn't this mean she's cheating on him too? Now, Cárcel is determined to change Inés' mind about him and prove he can be the husband she's always wanted.

As a young girl, the black-haired, green-eyed female lead turned down a marriage proposal from the red-haired crown prince, choosing to marry a blond-haired lord instead, because he had a pretty face.
It's later revealed that she's in a time loop of some sort, and that in a previous loop, she married the prince and had a series of miscarriages, for which she was blamed. The cause of the miscarriages were STDs that she caught from the prince as a result of his infidelity, and she ultimately took her own life with a rifle.
In a subsequent loop, she ran away with a portrait artist's assistant, but after spending a few years together, he was shot and killed in front of her, and she later committed suicide again.


PulseAudio server connection failure: Connection refused (debian stretch)

Question: i play vlc but surprised by this error :Audio output failed:
The audio device "default" could not be used:
No such file or directory.
so i search for it and the run this command : vlc --reset-config --reset-plugins-cache
but it produce this error PulseAudio server connection failure: Connection refused
and also there's no sound when i using browser
and i don't know what to do
hint: my sound was work well but suddenly this happen
Comment: Check logfiles, look for pulseaudio lines. It seems to be crashed.
Answer: It might be because either your pulseaudio driver is broken and/or has permissions set to root.
I had solved this problem with the following commands :
# clean and reinstall pulseaudio
sudo apt-get remove --purge alsa-base pulseaudio
sudo apt-get install alsa-base pulseaudio
sudo apt-get -f install && sudo apt-get -y autoremove && sudo apt-get autoclean && sudo apt-get clean && sudo sync && echo 3 | sudo tee /proc/sys/vm/drop_caches
# fixes user folder permissions
sudo chown -R $USER:$USER $HOME/
# then reboot
sudo reboot

Pulseaudio should be started at startup but you can manually start it with :
pulseaudio --start

If the problem persists, feel free to paste your system log here
tail -100f /var/log/syslog

Comment: Yes - that chown -R is very reckless and unlikely to be necessary.  If the user directory and/or the pulse directory need correct permissions, then just set those, don't blow away all of someone's ownership settings.
Comment: chown command took very long but then I though it might be not needed. I have web projects in my home dire and it might make somewthing wrong, so I cancelled this.

After pulseaudio --start - sound worked ,but after computer restart - it did not. In my case even before fixing - at the begggining it was not working, after like half an hour it used to start working. I have added to startup "pulseaudio --start" and now audio workse again on OS start. Using xubuntu 18
Comment: I actually did only the first of these steps i.e. removed pulse and alsa, and just tried vlc then and it worked! Never did the reinstall VLC works better without these somehow.
Comment: The apt-get command to purge... `The following packages will be REMOVED: ... ubuntu-desktop* ubuntu-desktop-minimal* ...` so clearly that cannot work. I don't want to remove the whole desktop.
Answer: On my Xubuntu 18.04 system, I had a problem with pulseaudio not accepting the ~/.config/pulse/cookie file.
I tried to reinstall pulseaudio as suggested in the other answer but that didn't help, so I simply removed and re-generated the user configuration as follows:
mv ~/.config/pulse ~/.config/pulse.old
pulseaudio --start

which fixed the problem for me.
Answer: Got a temporary solution at ubuntuforums
$ pulseaudio --check
corei3@corei3 ~ $ pulseaudio -k
corei3@corei3 ~ $ pulseaudio -D
E: [pulseaudio] main.c: Daemon startup failed.

Comment: fwiw, i seemed to need to create and set the XDG_RUNTIME_DIR. `sudo install -o $myuser -d /var/run/user/$myuserid` then `XDG_RUNTIME_DIR=/var/run/user/$myuserid dbus-launch bash` then (with the pulse ~/.config/pulse directory cleaned) `pulseaudio -D` THEN I could start my app. when did multi-user systems get so complicated :(
Answer: For my pulseaudio "connection refused" issue the following helped:
mv -v ~/.config/pulseaudio{,~}

This way the pulseaudio userspace configuration is reset (without destroying the old). No reinstall or reboot was needed.
Answer: For me all other solutions failed. This made the trick :

pax11publish -r

After that, pulseaudio is found by everybody.


Create name shortcut to run application from terminal in Linux

Question: I have an application X.  I want to be able to type in X anywhere inside terminal to be able to launch application X.  How can I do this?
Answer: You make sure your application is either in one of the directories in your $PATH or you create a symbolic link from one of these directories to your application:
$ echo $PATH
/home/MEMEME/bin:/bin:/usr/bin:...   # let's just assume it's this way
$ ln -s /PATH/TO/MY/APP/X /home/MEMEME/bin/X
$ X              # starts your application

Answer: To be able to invoke X application from anywhere inside terminal, absolute path of X should be a part of environment variable PATH
Option 1
Place your application in one of the paths already defined in PATH variable. Type echo $PATH to list existing list of paths.
Option 2
Add following line in your ~/.bashrc file
export PATH=$PATH:/path/to/app/X

where /path/to/app/X should be replaced by an actual path of application X


Different Pressure in Parts of the House

Question: We are in the middle of remodeling our house. The water pressure in the bathroom is low but at the outside back faucet it is very high. The shower head doesn't have enough pressure to run it correctly. And the pop-off valve on the brand new water heater is leaking every time we run hot water. Any suggestions what may be going wrong and how to fix it?
Comment: Is the back faucet supplied before a pressure regulator and the rest of the house after? have you checked the pressure regulator setting - if fitted? can it be turned up? what diameter pipes feed the shower from source and how long is the run?
Comment: Voting to close. Not enough info and OP hasn't been back.
Answer: You possibly have galvanized steel pipes which when replaced with PEX or copper would fix your low water pressure. I'm not sure why galvanized steel was ever used for water pipes, but you can use a magnet to tell if they're steel or not. Other than being a different color than steel, copper isn't magnetic and steel is magnetic.
Your T&P valve on your water heater will leak for 3 reasons. 1 if the pressure is too high, 2 if the temperature is too high, or 3 the valve is failing.
Reason 1, your pressure too high, can be corrected by adding an expansion tank to your hot water line. Water expands when heated, and it needs somewhere to go or it'll build up a pressure much higher than your normal water pressure.
Reason 2, your temperature is too high, can be corrected by turning down your water heater temperature. The US Department of Energy recommends as low as 120F, 140F is the most common, and it really shouldn't ever be set higher than 160F because the scalding/burn risk is extremely high at that temperature.
Reason 3, your T&P valve failed, is unlikely since it is new. Typically they fail where they never seal or never open. So it leaking only when the heater turns on makes it more likely to be reasons 1 and/or 2.
Comment: Regarding sentence #2, because at one time copper was extremely dear (due to wars 'n such) and PVC hadn't been invented or approved for plumbing.


What would happen if there were no SOX9 in an XY human?

Question: Would testes be produced? If SRY is functional, can it produce other proteins that can direct the production of testes, which may or may not be sterile?
Answer: Quoting the abstract of this paper verbatim:

Sox9 is an Sry-box-containing gene that encodes a transcriptional
  activator. During mouse gonadogenesis, Sox9 is detected in the male
  gonad at 11.5 days postcoitus (dpc). At 12.5 dpc, testicular cords
  form, morphologically distinguishing the male gonad from the ovary.
  From this stage onwards, Sox9 expression is restricted to the Sertoli
  cell lineage and persists in the adult. Humans with heterozygous
  mutations in SOX9 develop a skeletal syndrome known as campomelic
  dysplasia. Furthermore, most XY SOX9 heterozygotes show variable
  male-to-female sex reversal, implicating SOX9 in testis development.
  Sox9 heterozygous knockout mice die at birth with a syndrome similar
  to that of human campomelic dysplasia. In contrast to humans, XY
  Sox9+/- mice form normal appearing testes. Germ-line knockout of Sox9
  using a conditional null allele provides a tool for generating Sox9-/-
  mice by simple genetic crosses. However, Sox9-/- mice die soon after
  11.5 dpc because of cardiovascular defects. In vitro culture of the urogenital ridges of XY Sox9-/- results in gonads lacking testicular
  cords and Sertoli cell marker expression, but with the expression of
  ovarian-specific markers. Therefore, Sox9 is essential for diverting
  an intrinsically ovarian program of organogenesis toward testis
  formation.

From MGI page on Sox9:

Null mutant heterozygotes and conditional knockout mutants display
  perinatal lethality with cleft palate, hypoplasia and distortion of
  numerous cartilage-derived skeletal structures, and premature
  mineralization in many bones. Specific conditional knockout mutations
  are sex-reversed.
Answer: SOX9 is indeed the factor which is important for the developent of the sexual organs and not only for men, but also for women. Expression of SOX9 regulates the expression of the anti-Müllerian Hormone, which inhibits the formation of the female reproduction system. See reference 1 for more details.
Mutations in or around (in regulatory regions) of the SOX9 gene lead to severe developmental changes and to the genetic disorder "Campomelic dysplasia". The disorder leads to changes in the bones and also in the sex determination, it is often lethal in the neonatal period due to respiratory problems. Have a look into reference 2 for more details.
In mice, the complete loss of SOX9 is embryonical lethal, have a look at reference 3 for details. Although there are no data available for humans (for obvious ethical reasons) I assume that the effect is the same.
Development of testis starts by the activation of SOX9 by the testis determination factor. SOX9 in turn activates a number of other transcription factors (have a look into references 4 and 5 for details) which finally lead to the development of the testis.
Mutations in SOX9 in men (with XY chromosomes) also lead to the reversal of the sex, meaning these individuals will develop female reproduction organs (see reference 4). It has also been shown that female mice will develop testis when SOX9 is induced in these animals (see reference 6). You can also have a look into the OMIM database for an extensive review.

References:

Direct interaction of SRY-related protein SOX9 and steroidogenic
factor 1 regulates transcription of the human anti-Müllerian hormone
gene.
A clinical and genetic study of campomelic dysplasia.
Sex determination: a tale of two Sox genes
The PGD2 pathway, independently of FGF9, amplifies SOX9 activity in
Sertoli cells during male sexual differentiation.
Fgf9 and Wnt4 act as antagonistic signals to regulate mammalian sex
determination.
Sox9 induces testis development in XX transgenic mice


David Lewis and naturalism

Question: I am studying Lewis and I am wondering what are the cornerstones of his philosophical perspective. In particular, I am wondering if Lewis is a naturalist like his supervisor Quine.
Comment: For broad questions of this sort please consult online encyclopedias, e.g. SEP [David Lewis](https://plato.stanford.edu/entries/david-lewis/). We take more pointed questions that come up after general reading.
Answer: Very interesting question.  If naturalism means in part that there is no philosophy prior to science (philosophy is continuous with science) as Quine says then  there are reasons  to think that Lewis' philosophyical views may not be completely naturalist. I have in mind his appeal to what he calls perfectly natural properties and their role in his accounts of laws, other nomological modalities, intrinsicness, and reference. lewis' perfectly natural properties play a prominent role in his responses to Quine's skepticism regarding these notions. But perhaps one could argue that these notions are important to science and so consider perfectly natural properties as scientific posits rather than metaphysical posits. Of course, there is also Lewis' famous appeal to concrete possible worlds to make sense of metaphysical necessity. Even if this is the best way of understanding metaphysical necessity Lewis' doesn't argue that metaphysical necessity is required by science so to that extent he is being non naturalist (in Quine's sense).
Comment: Welcome to the SE! Your answer will be more useful to those less familiar with Lewis/Quine if you could add some references.
Answer: Lewis provides a lot of his overall philosophical picture in On the Plurality of Worlds, but it assumes a lot of knowledge of existing debates. I suggest looking at Daniel Nolan's "Lewis" for an overview, since Lewis was a systematic thinker. Nolan examines - among other things - the extent of Lewis's naturalism.

David Lewis and naturalism


Does a locally free sheaf over a product pushforward to a locally free sheaf?

Question: Suppose $X$ and $Y$ are two (smooth, affine) algebraic varieties.  Let $\mathcal{F}$ be a locally free coherent sheaf over $X \times Y$, and let $\mathcal{G}$ be the pushforward of $\mathcal{F}$ to $X$.  Is it true that $\mathcal{G}$ is a locally free quasicoherent sheaf?
Answer: The answer is "yes" (though I can't imagine a situation where one would really need this fact).  More generally, if $A$ and $B$ are arbitrary commutative algebras over a field $k$ with $A$ noetherian and if $M$ is an $A \otimes_k B$-module which is locally free as such (perhaps not finitely generated) then $M$ is locally free as an $A$-module.  Here, by "locally free" I meant relative to the Zariski topology.
Without loss of generality (since $A$ is noetherian), we may and do assume that ${\rm{Spec}}(A)$ is connected.
The first thing to observe is that $M$ is projective as an $A \otimes_k B$-module.  Indeed, projectivity is a Zariski-local (even fpqc-local) property for modules over commutative rings, by 3.1.3 part II of Raynaud-Gruson (and the fact that faithfully flat ring maps satisfy their condition (C), using 3.1.4 part I of Raynaud-Gruson), so any locally free module over a commutative ring is projective.  Thus, $M$ is a direct summand of a free $A \otimes_k B$-module, which in turn is also free as an $A$-module.  Hence, $M$ is projective as a $A$-module.  If $M$ is module-finite as such then it is certainly locally free (since $A$ is noetherian).  But if it is not module-finite then we're again done since $A$ is noetherian with connected spectrum, as then it follows that any projective $A$-module that is not finitely generated is free!  This is Bass' theorem "big projective modules are free"; see Corollary 4.5 in his paper with that title.
Comment: It was suggested (in an earlier comment which was later deleted) that there must be something "wrong" with Bass' theorem, since for a non-free finitely generated projective module P, surely an infinite direct sum of copies of P is not free. In case anyone else has doubts, it really is free (and Corollary 4.5 in Bass' paper is not wrong); that (among other things) is the marvelous surprise of Bass' theorem. This phenomenon can also be seen on a smaller scale: if $R$ is Dedekind and $I$ is a non-principal ideal then $I \oplus I \simeq R^2$ is free even though $I$ is not free.
Comment: A fact similar to the last one you mention is also true for the Weyl algebra A_1 (differential operators on C[x] with polynomial coefficients). If M is a projective (left, say) A_1 module, $M \oplus M$ is free.
Comment: Small typo: in my preceding comment,  for the example at the end I meant to require that $I$ is also 2-torsion in the class group.
Answer: One can prove this also without Bass's theorem.
Let $X= Spec A$ and $Y=Spec B$.
The sheaf $\cal F$ comes from a finitely generated module $M$ over $C=A\otimes B$.
Our first goal is to show that $M$, as an $A$-module, is a direct sum of finitely generated, locally free modules.
Since $A$ is noetherian, this is equivalent to $M$ being a direct sum of finitely generated projective $A$-modules.
The fact that $M$ is locally-free implies that $M$ is projective over $C$, further it is finitely generated, so there is a finitely generated $C$-module $N$ such that $M\oplus N=\bigoplus_{i=1}^kC e_i$.
Now each $e_i$ of this free basis can bewritten uniquely as $e_i=m_i+n_i$.
Let $M_0$ be the $A$-module generated by $m_1,\dots,m_k$.
Let $(b_j)_{j\in J}$ be a basis of $B$ over the ground field, then
$$
M=\bigoplus_{j\in J}b_j M_0.
$$
Let $N_0$ be the $A$-module generated by $n_1,\dots,n_k$. Then $M_0\oplus N_0= \bigoplus_i Ae_i$ is a free $A$-module and so is
Also $b_j(M_0\oplus N_0)=\bigoplus_iAb_je_i$.
This means that we have written $M$ as a direct sum of finitely generated projective $A$-modules as claimed.
Now to conclude remember that $A$ is noetherian, therefore for each point in $X$ there exists an open neighborhood, where all summands of $\cal G$ are free.
Answer: Hi. I don't know how to make a comment; this is on Torsten's example with
elliptic curve minus zero point. When you take a line bundle corresponding to
a point (for simplicity not a two torsion point) and add the line bundle corresponding to minus of that point then this rank=2 vector bundle restricted to the elliptic curve minus zero is (even globally) free.
Indeed, working on the elliptic curve twist with the degree one line bundle L
corresponding to the zero point and take the canonical inclusion of the structure
sheaf on both factors, the quotient must be isomorphic to L squared.
This is just to understand Bass' theorem on this nice example.
Answer: No. Take for example $X$ to be an elliptic curve, $Y = Pic^0(X) \cong X$ and $F = L$, the Poincare bundle (the universal bundle on $X \times Pic^0(X)$. Then the pushforward of $L$ onto $Pic^0(X)$ is the structure sheaf of the point, corresponding to the trivial line bundle.
Comment: An elliptic curve is not affine.
Comment: Certainly not. I am sorry.
Answer: Maybe I'm totally confused, but a locally free sheaf over an affine variety should be nothing else than a projective module over the ring of global functions.
Push forward along the projection is then just restriction of scalars along the inclusion
$$O_X\rightarrow O_X\otimes_k O_Y$$
Now $O_Y=\bigoplus k$ so
$$O_X\otimes_k O_Y=O_X\otimes_k \bigoplus k=\bigoplus O_X$$
so free modules stay free and projective Modules=Summands of free modules stay projective.
Comment: In the affine setting a locally free sheaf corresponds (under mild finiteness conditions) to a projective module, not to a free module.
Also, your equality O_Y=\oplus k is incorrect.
Comment: Thanks, I edited my post. O_Y=\oplus k is true since O_Y is a k algebra and any vectorspace is free.
Comment: I think the question may be based on the fact that for non-finitely generated modules projective and locally finite are not the same thing. Take for instance an elliptic curve
(minus the origin to make it affine) and take the sum of all the line bundles (one for
each point on the original elliptic curve). Then this sum is projective but there is no non-empty open subset of the spectrum over which it is free.
Comment: By Bass' theorem, a non-finitely generated projective module over any noetherian ring with connected spectrum is free.
Comment: Mea culpa. My comment was wrong in almost any respect. I leave it both in order
to leave the subsequent comment meaningful and as a reminder to myself.
Comment: @Torsten:  It's fine with me if you delete my comment and your comments, if you wish to do so.


retrieving images from Picasa on android

Question: hello am trying to get images from an album from picasa in an android app. I tried creating an album and the album was created successfully however there is something wrong when i try to get the images in the album. Please find below my code:
<code>PicasawebService myService = new PicasawebService("myApp");
myService.setUserCredentials("username", "password");
URL url = new URL ("https://picasaweb.google.com/data/feed/api/user/myusername/albumid/myalbumid");
AlbumFeed  feed= myService.getFeed(url, AlbumFeed.class);
List<MediaContent> l;
for(PhotoEntry photo : feed.getPhotoEntries()){
l= photo.getMediaContents();
return l.get(0).getUrl().toString();
 }
</code>
the for loop is not being entered but when i check the size of the feed  and it shows me the correct number of images in the album. I got the code from google developers guide:(https://developers.google.com/picasa-web/docs/2.0/developers_guide_java#listalbums)
NB: i tried the same exact code in a desktop app and worked perfectly.
Thank you
EDIT: The problem is that the ALbumFeed is returning entries of class GPhotoEntry and not PhotoEntry. I searched online and the solution was to include the gdata-photos-meta.jar in my library which was already included...Any idea?
Comment: well am new to android development, i checked the log for exceptions and so but nothing found...note that might help: the for loop is not entered but without throwing exceptions but keeps executing the rest of the code..thx @fiddler
Answer: google's GData doesnt work with android. You should use google Client api and they say that there is a running sample for picasa on android.


Is heating rate important with sugar syrups?

Question: I make hot fudge syrup ; heat  chocolate , sugar , butter, etc, to 240 F ,then put in half and half . I end up with a spoon-able viscosity at room temperature but warming to 100 F makes it pour-able. Does it make any difference how fast I heat it ? I don't need it to firm up into fudge.
Answer: The limiting factor for how fast you can heat your syrups is how evenly that heat is distributed through the liquid. If you have a runny liquid, a thick pot that distributes well and you stir constantly, you can heat very fast. The heated liquid is immediately mixed throughout.
On the other hand, if your syrup is viscous it won't mix easily. If your pan is thin then there will be hot spots. The syrup will get too hot and burn at those points.
Another consideration is precise temperatures needed for candy making. If your syrup is destined for a denser candy then you want to hit a final temperature that is within about a 5F range. It might be hard to hit accurately if you are heating too fast.
Personally, I start my syrups on medium-medium low until the sugar is dissolved and then bump the temp up to almost high. If I'm making candy I'll go back to a medium high when it starts getting close.
As for reheating- just use a microwave. The syrup won't burn.
Some recipes need to be heated gently. Eggs, for example, are more likely to curdle when they are heated abruptly- even if they are only heated to the same temperature.
This does not apply to sugar syrups.


Missing Certificates Tab when viewing properties of a VM role in Visual Studio 2010

Question: I've been trying to connect my Azure VM role to my domain and was following the steps provided by the Windows Connect Azure team blog as shown here: . However, I hit a snag when I was asked to click on the certificates Tab and create a certificate. Wonder of wonders, there is no Certificates tab that appears on the properties of the VM role properties page. All I see are the following tabs: Virtal Hard Disk, Configuration, Settings, Endpoints and Virtual Network. Any clue as to wjhat I might be doing wrong? I will appreciate any help greatly.
Answer: I'm guessing the tutorial you are following is for a web or worker roles?
If you're creating a Virtual Machine role, then I don't think you can specify the certificates to install. If you want to pre-install certificates, then you can do this yourself within the VM image?


WP plugin updates

Question:
Possible Duplicate:
WP plugin updates

I wrote a plugin for WordPress which requires regular updates.
Is it possible to notify user of new version being available (some of the other plugins have some kind of this option - when new version is available user can see it in his admin panel and update - everything using some built-in WP functions...)
Answer: This is done for you automatically if you place it in the plugin repository:
http://wordpress.org/extend/plugins/about/

WP plugin updates


Table partitioning in SQL 2008 - Why?

Question: I understand how it works, but the book I'm studying doesn't tell me why you'd want to partition. Could someone shed some light? I can't understand any concept unless I see how it's useful.
Answer: Basically, to split up a huge table into smaller sub tables or partitions

offload data into different files/filegroups (with changes in backup/restore strategy too)
separate "working" from "historic" data (without having 2+ separate tables which complicates queries)
allow compression of older data

We're talking 100s of millions of rows and/or high volumes.
You don't partition for a few million rows.
Comment: It'll also affect your indexes, so if you have a few years worth of archive data in one partition and only the present year in another, searching through the present year's partition involves only that partition's indexes.
Comment: Does it speed up SQL if you split it to multiple files? Isn't there a better archive strategy than just splitting it up? I'd have thought you would physically move the old data to a new table, or back it up / compress it to another computer somewhere, not just leave it in the same folder.
Comment: That, and the advantages of partition pruning (don't look in partitions if you know the data ain't there) and parallel execution (you can access multiple partitions at the same time to do a SUM or COUNT or other aggregate)

Table partitioning in SQL 2008 - Why?


Trying to install OS to new computer; Won't detect HDD

Question: Mobo: Biostar th67+
CPU: i3 2100
GPU: Radeon 6850 (using integrated right now)
PSU: Antec 400 Watts
HDD: 80gb Deskstar IDE + external Seagate
I am trying to install Windows 7. My problem is that it won't recognize my HDD during installation.
I have an old IDE HDD which I'm using with an adapter for SATA. It's not working.
Currently I'm trying to update the BIOS without windows since it might help. I cannot get to the BIO-FLASHER by pressing F12. I've restarted and tried the other F keys as well. I can only get to the boot item menu with F9. I tested F keys on another computer to verify that the keyboard is working. I have placed the current H67BRC15.BST BIOS file at the root of a blank FAT32 USB stick and it's in a working USB port in the computer. This gives me two questions:
<code>How do I update the BIOS without windows?

Why won't my IDE HDD work?
</code>
Other possibly useful information:
I have successfully ran Ubuntu 11.10 off of a USB stick, so everything seems to work.
The IDE to SATA adapter appears to work since my HDD shows up in the BIOS (I have the HDD set to master as well).
I have tried to get both Ubuntu and the Windows installer to read the HDD to no avail. I've tried using 15 pin and 16 pin master modes for the HDD as well.
In the BIOS I've tried setting the SATA settings to IDE mode, and to AHCI mode and tested those, with and without the extra options like SMART and Power Link Management. I've tried most of the SATA slots. With IDE mode the windows installer won't display the HDD (it says it needs drivers!). With AHCI mode it finds the HDD but says that I can't install to it, and I need to enable the controller in the BIOS, but both of them are enabled.
I cannot understand why the HDD can show up in the BIOS and not to the OS. Any help is appreciated!
Edit: Installing Windows 7 from a USB stick using wintoflash
Comment: Hello.
Are you trying to install Win 7 from a USB stick ?
Comment: Yes, I am, I forgot to mention that.
Answer: According to the BIOStar manual you can update the BIOS from within the BIOS (page 22 & 32).
It's a long shot, but make sure you haven't turned on any overclocking yet. I had this problem when I had set overclocking before I installed Windows 7. Once I reversed it, the install went as advertised.
It is also possible the HDD may be defective. Try connecting it to another PC to see if you can access it.
Comment: I've just finished going over both manuals on their website, and the one included on the cd again, and I can't find any useful information on bios updating outside of windows. Would you mind pasting the information? I think we may have different manual versions.

Also, I haven't tampered with overclocking yet, but good guess. It's nice to know that someone experienced this and solved it.
Comment: Page 22 lead me to believe you can, but I missed the words "under Windows" on page 32. Sorry about that. I can't believe they don't have a BIOS flash utility that isn't windows based.
Answer: Make sure you're not using the USB3 ports
(blue ones usually) either to attempt to flash the bios, or to install Windows. Windows 7 installer doesn't have USB3 drivers


Joint Space Singularities

Question: I would like to clarify my self on singularity configurations. If I am moving the robot in joint space only one joint at a time, can I come to a singular configuration? If so how?
Thanks
Answer: Assuming it is a robot with a serial structure:
You will always be able to move every joint of the robot in any pose.
However the singularitites still exist, and you can end up in a singular pose, but if you do not have any cartesian space contrains  (and do not even calculate inverse kinematics/inv. jacobi), then from a motion point of view these are not significant.

Joint Space Singularities


How can I interpret a regression model with a reciprocal response?

Question: I fitted a multiple linear regression model as the following
$$BMI = \beta_0+\beta_1Age+\beta_2Gender+\beta_3Age*Gender+e$$
But the residuals obtained after fitting the model have violated both normality and homoscedasticity assumptions. I use the reciprocal transformation of $BMI$ to solve this and it satisfies the assumptions of normality and homoscedasticity. I tried log transformation, and square root transformation but the problem still exists. So, I used the reciprocal of $Y$, and the model becomes
$$\frac{1}{BMI}=\beta_0'+\beta_1'Age+\beta_2'Gender+\beta_3'Age*Gender+e$$
Now, how can I interpret the result (main effects, and the interaction) obtained by the model with reciprocal response $BMI$? And how can I link the results to the original response itself?
Answer: BMI (Body Mass Index) is weight (kg) divided by height$^2$ (m$^2$) so can be seen as a measure of thickness, so its inverse will be a measure of thinness.  Seen that way you have a linear model for thinness, and can interpret as usual for linear regression.
For interpretation on the original BMI scale, maybe make plots of the estimated model. For more specific advice tell us more of the context:

Is this a longitudinal study, so you are following a cohort of people over time, so at different ages?

Or a population study, so each person observed only once?

But in most cases the model seems strange, published papers on BMI often use quantile regression ... Here is a paper on new regression methods for BMI,  Intelligence Test Score and Educational Level in Relation to BMI Changes and Obesity is a longitudinal study of changes in BMI with age,
Comment: Normal residuals are a bit of a hobgoblin or misleading. The goal is usually to identify the pattern of weight in the population, hence the calculation of BMI to standardize for height. Try some graphs of BMI by age for men and women and separate models for men and women. You might find them to be nonlinear or to be extremely weak.
Answer: Since the body-mass index is defined as $\text{BMI} = \text{weight (kg)}/\text{height (m)}^2$, you can rewrite your reciprocal model (now dropping the units) as:
$$\text{height}^2 = \text{weight} \times (\beta_0'+\beta_1'\text{Age}+\beta_2' \text{Gender} + \beta_3' \text{Age} \cdot \text{Gender} + \text{error}).$$
So, by modelling BMI as a reciprocal linear equation, you get height-squared as the product of weight and that linear predictor.  This is certainly one model you could try, but the restriction of holding BMI fixed relative to height means that you are unlikely to get a realistic model.

An alternative: One thing worth noting here is that you are working with a derived quantity that depends on two underlying quantities (height and weight).  If you can get the underlying data for these two quantities then it is probably more sensible to try to model one of them in terms of the other (plus the other explanatory variables).  In this context, it probably makes most sense to model log-weight in terms of log-height and the other variables, using a model of the form:
$$\log \text{weight} = \alpha_0 \log \text{height} + \alpha_1 \text{Age} + \alpha_2 \text{Gender} + \alpha_3 \text{Age} \cdot \text{Gender} + \text{error}.$$
As a general physical observation, if a three-dimensional object growths proportionately in all dimensions then its log-volume will increase at three times its log-height, and if weight remains proportionate to volume then its log-weight will similarly increase at three times log-height.  Now, under this "simplifying theory" we would have $\alpha_0=3$ in the above model.  However, it is well known that living organisms like humans do not exhibit exactly this growth pattern, in part because they grow relatively thinner when taller.  Nevertheless, you can look at the coefficient $\alpha_0$ by comparison to this theoretical baseline ---i.e., a value $\alpha_0 = 3$ follows this simplifying theory, whereas a value $\alpha_0<3$ means that there is some reduction in relative volume as the object gets taller, relative to the simplifying theory.
Comment: As BMI is quite a standard concept and much analyzed, proposing to bypass it have a low probability of success ... at the wikipedia article I linked, there is a proposal for a $\text{BMI}_\text{New}$ that uses height to the power 2.5, which the proposer says fit the data better ...
Comment: Fair enough, but I'm not terribly interested in whether it's popular, only whether it's right.  The problem with BMI or BMI-New (now with raisins!) is that it fixes the proportionality coefficient rather than just fitting the underlying variables to the data and seeing what happens.


What's in-between silence and clamor?

Question: What's in-between silence and clamor? Sometimes, in a room for example, there's no sound except 1 person talking at times, do we still refer to that as silence. If not, what is it called? I suppose it's something between silence and clamor, but I can't think of a word? Is there a word that means almost-silence or the state of being able to hear a sound distinctly while hearing nothing else?
Comment: I wonder if you know what clamour means? To me, silence and clamour are at opposite ends of the spectrum, so the quick answer to your question as written is: everything.
Answer: Which word you choose depends on the quality of the sound in the room.  For example:

murmur (n): a low, continuous sound, as of a brook, the wind, or trees, or of low, indistinct voices.

Other options:  buzz, hum, mutter, rumble, fizz, hiss, whir, ping, splash, whisper, babble, drone, and a few more less common words like sibilation or susurration.
You might find this interesting:  Writers Write: 106 Ways To Describe Sounds
(Edit_1)  You may also use modifiers to adjust the relative volume of these kind of words.  This gives a wider range of possible descriptors. Examples:

a loud hum
a muted roar
s sharp hiss

(Edit)  Xerxes makes the fair point that none of these really describe the source of a "distinct" sound, such as "the sound of one person talking in a room".  There is no single word to describe this, since of course, any kind of sound might be produced by any number of sources.  In writing, it's fine to separately describe the quality of the sound and the source of the sound:

Through the wall he could distinctly hear the murmur of Jessica discussing the latest gossip with her friends, although, try as he might, he could not make out any details.
Comment: @Xerxes  On the contrary! A murmur -- like a *hum*, or a *babble* -- is a **distinct** kind of sound, often **made up of** a number of indistinct sounds.  You can **distinctly** hear someone *droning* on in another room, even if you can't **distinguish** the words.  But, then again, I suppose it all depends on what blackbird meant by "distinct".  It's a fair point.
Comment: This is not correct, since the question specifies that the sound is able to be heard distinctly. A murmur by definition is indistinct.
Answer: There is the concept of background noise. Although this phrase has a technical meaning when it comes to audio recordings and signal processing, that expression can also be used colloquially; it is defined by some dictionaries as:

background noise (noun)

any type of noise that is not the sound that you are specifically listening to or monitoring (Collins)
noise that can be heard in addition to the main thing you are listening to (Macmillan)

Wikipedia has an entry for it, which says:

Background noise or ambient noise is any sound other than the sound being monitored (primary sound).
Examples of background noises are environmental noises such as waves, traffic noise, alarms, people talking, noise from animals or birds, and mechanical noise from devices such as refrigerators, air conditioners, power supplies, or motors.

If you are not paying attention to something else in the room, you can focus on the background noise and hear it distinctly.
Answer: "Silence" is complete absence of sound. If there is the sound of a person talking, even quietly, it wouldn't be called silence.
"Quiet" could also be interpreted to mean silence, but usually "quiet" would include an environment with a low level of sound. I think one person talking at a time, in a soft voice, would be accepted by most people as an example of "quiet".
Answer: I don't believe there is a single English word suitable to this purpose. I would use a short phrase to add an exception to "silent". For example: "silent but for a single voice" or "all was still except for the tapping of the hammer" or "a shrill, clear note broke the silence".
Comment: This is a fair point.  I actually had trouble coming up with a single word to describe something like "the sound of one person talking in a room", until I reframed the question with ways to describe the quality of the sound, rather than its exact source.
Answer: Clamor to be a mixture of enviro, mechanical, biological-based noise of the muted kind.
A quick mind map of the answers given above:
Comment: The OP asks, "What's in between silence and clamor?" I'm still a little unsure of how this mind map answers that question.
Comment: Updated map to show difference between the two words

What's in-between silence and clamor?


IE 8/jQuery UI Dialog not initializing EXCEPT when called on localhost

Question: I have a couple of pages with a rather simple design. A div contains an iframe or some basic form elements (a textbox and a select with a button). When I'm working on this via http://localhost/myapp everything works perfectly IE 8, FF, Chrome - it all works. However, when I switch to my machine name OR FQDN of the server it stops initializing the dialog in IE 8 only. I can see a quick error icon popup in the window, but it goes away before I can try and debug it. The code is in a try/catch and no errors are thrown there. I've tried making sure the machine name/fqdn is "trusted" or "intranet" but no difference. Again - works PERFECT on FF/Chrome when called by anything - just not IE 8. Thoughts?
Comment: You will be able to see the error that comes up by pressing F12 in IE for the developer console
Answer: Apparently - the extra comma on the last parameter of the dialog init causes this error. Next time, I'll slow down and use JSLint.
Answer: Had a similar problem in IE 11: the site worked when addressed as localhost, but not by machine name. In the developer console I noticed a message that intranet sites are running in compatibility mode. Apparently that is a default setting for IE.
Turned the setting off (Tools -> Compatibility View Settings -> Display intranet sites in Compatibility View -> uncheck) and the initialization went through fine.


Do you get a pay raise at the same time or after getting new responsibilities?

Question: Management is thinking of giving me more responsibilities. I am open to this. When exactly should I ask for a pay raise? When it is confirmed that I will be getting new responsibilities (e.g. I am scheduled to be trained on them)? Or after the fact, for example "hey, now that I'm doing more I would like a raise"? The downside I see to the first option is management may just find someone else who didn't ask for a pay raise.
Comment: Does this answer your question? [How should I properly approach my boss if I'm feeling underpaid?](https://workplace.stackexchange.com/questions/1025/how-should-i-properly-approach-my-boss-if-im-feeling-underpaid)
Comment: How much more responsibilities?
Comment: When "asking" for a raise, I'd recommend phrasing it in a manner like: "These new responsibilities sound like a great opportunity! What is the compensation difference that comes with them?" There won't always be one, but it'll start the conversation as well as set the expectation that you're looking to be adjusted for it.
Answer: Have this discussion with management when you talk about your new responsibilities. Could be a real step up, could be a lateral move or could be just normal growth of your day-to-day work.
Have a career discussion with your manager, determine what the next step up for you is, what's required to take the step and how the new responsibility fit in there.
Answer: Do your new responsibilities warrant a raise? Answer that question first.
If the answer is yes, then ask for a raise to coincide with these new responsibilities.
As you've stated, the downside is that they could find someone else to give these responsibilities to. That's a risk you'll need to take if you want the raise.
The upside for the company is that you won't ask for a raise, and that nobody will ever ask for a raise, and that they can continue to pay people the same while giving them ever increasing responsibilities and workload.
My point being, don't worry about whether or not asking for a raise is risky. If the responsibilities warrant a raise, then ask for it.
Answer:
When exactly should I ask for a pay raise?

You indicate that currently they are only "thinking about" giving you more responsibilities. So don't ask now.
When you are formally told that you are promoted/more responsible, see if it comes with more money. If you don't hear that it does, just ask "Does this change come with a salary increase?" Be ready for how you intend to react in either the Yes or No case.
Some companies increase your wages at the same time you get promoted. Others increase your wages later.


Branch version editing in ArcGIS Online

Question: I'm trying to figure out if you can publish a particular version for users to edit on an ArcGIS Online map in a branch versioned environment. It doesn't look like there is a way to select the version on Portal that you use in your web map. It only makes edits to the default version when I test it in an ArcGIS Online map. I know that you can publish a specific version to Portal/AGOL in traditional versioning and it is really handy because you can compare edits done to that version by, say, a field worker editing on a mobile device, with the default version in the office instead of automatically committing those edits to the default version.
Can this be done with branch versioning?
Answer: No this can't be done with branch versioning
Answer: Yep, put a branch version feature service in a map in pro, create the version you want and publish the map.  Then you have a webmap with the versioned feature service.

Branch version editing in ArcGIS Online


How to find phone when mobile data switched off and ringtone off

Question: My phone fell out of my pocket while I was out walking the dog. The kids use my phone sometimes, so I had switched mobile data off. My wife is a very light sleeper, so the phone was on silent. This made it very difficult to find my phone.
Answer: Key parts of this solution:

I had previously used my wife's phone as a hot-spot.
I could call the lost phone and knew it was receiving the call.
I had a way to visit android.com/find to find my own phone and make it ring loudly.
I knew it had about 25% battery left, so I knew I could keep calling it.

The approach:

Enable hot-spot on a friend's phone which you've previously used as a hot-spot.
Keep calling the lost phone.  This will keep the lost phone "awake".  While it's awake, it'll look for WiFi.
Retrace your steps while carrying your friend's phone. Keep looking at the "Connected Devices" screen on your friend's phone.
When your phone appears in the "Connected Devices", you're close.
At this point you can use android.com/find.  How you do that will depend on what resources you have available.  You might have to phone home and ask someone to do it on a laptop, or you might be lucky enough to have an old Android device with you, connected to the hot-spot on your friend's phone.

To figure out the method, I went out to the beach with my wife's phone and an old Android of my own (no SIM).  I put the old Android on the ground and walked away with the hot-spot so I could figure out what the conditions needed to be for it to regain the WiFi connection to the hot-spot.  The key thing was that after leaving the old Android on the ground for a while, it didn't matter how close the hot-spot was, the old Android wouldn't pick it up ... until I pressed a button and made the screen light up.
It took a bit of experimentation, conviction that I would succeed, and a lot of walking, but I eventually found it.  Phew!
Edit
A note on battery consumption
When I first left the house with my phone for the dog walk, I noticed the battery was on 37%. I made a short call while I was out but didn't use it otherwise. While hunting for the phone, I must've called it 30 or 40 times, letting it ring for a minute each time. When I picked it up, the battery was on 20%.


Do i really need to hack core to install Amazon S3 Module?

Question: I want to run my site through Amazon's Elastic Beanstalk but to do so i need to configure an S3 bucket and the Drupal Amazon S3 module requires that i have to hack core. Surely there must be a way around this? Would Storage API module be a way around this?
Comment: +1 from me for avoiding core hacks. Good thinking. And good you asked, it might help others with the same problem but to shy to ask :)
Comment: I think that this was fixed in core, see this patch and entire thread to read more about the issue: https://www.drupal.org/node/2305017#comment-9004649 and also the module listed in the answer below is what I have used before for this type of issue and it works pretty good.
Answer: I think you should give a try to S3FS module

S3 File System (s3fs) provides an additional file system to your
  drupal site, which stores files in Amazon's Simple Storage Service
  (S3) or any other S3-compatible storage service. You can set your site
  to use S3 File System as the default, or use it only for individual
  fields. This functionality is designed for sites which are
  load-balanced across multiple servers, as the mechanism used by
  Drupal's default file systems is not viable under such a
  configuration.


Seperating Charges in a Cell

Question: Sorry for not being detailed for my question here but how do charges seperate in a cell and when the electrons are pumped out of the battery does it return and become positive ? Yet again sorry if I don't make sense but I'm just wondering how it works.
Comment: You can get an idea how batteries work from articles on the web.
Comment: To what does  the "it" refer, in the second line of your question?
Answer: you might be confusing batteries and capacitors. While both always stay relatively neutral, the capacitors store charges on thin metallic sheets separated by dielectric and usually made into rolls to save space while the batteries store chemical energy and a chemical process drives electron current between the terminals. in case of lead battery the negative terminal is connected to the plates made of lead and which can react with sulfuric acid and release electrons which should travel through the circuit, the same reaction produces hydrogen ions that travel through the electrolyte toward the plates made of lead dioxide and meet there with the electrons that traveled through the circuit and getting converted into water while lead dioxide gets converted into lead sulfate. When a lead battery is completely discharged most of its lead dioxide is converted into lead sulfate.

Seperating Charges in a Cell


Rewarding a badge for creating a tag

Question: I think there could be a badge for creating a new tag. Since creating a tag would require 1.5k reputation, i think it might make sense to have at least a bronze tag for this. This would encourage people to ask questions in their domain which haven't been explored before.
Answer: There's already a silver Taxonomist badge for creating a tag that ends up getting used by at least 50 questions.
Comment: @lokoko: Trust me, just because it's a 1.5k user doesn't mean they create *good* tags. We actively destroy newly created ***misspelled*** tags all the time. So no, *just* creating a tag is not worthy of a badge, because all you have to do is literally type something in. The minimum question parameter is there to prevent abuse and ensure it's a *real* topic. Otherwise our system would be cluttered with unused tags waiting to be deleted by the system.
Comment: Dude, 1/2 to 2/3 of all new tags created every single day on SO end up getting nuked because they are *awful*.  New tag creation is not something we want to *promote*.
Comment: Yeah but that is for 50 questions. IF that might be the case then why not allow creating a tag when you reach say a score of 100 and if its not too popular in the next say 30 days then remove the new tag.
Comment: If we could have a badge for creating 2 accounts on stack exchange then i think we could give one to this :) I do get the point of spamming tags but still.
Comment: @lokoko I remember several months ago there was a community event to clean up old tags ambiguous tags, I participated in this event by removing the 'vb' tag and adding 'vba', 'vb6' or 'vb.net'. Less, more defined tags are much more useful as opposed to tags with < 50 answers.

Rewarding a badge for creating a tag


Is OAuth on a mobile phone using a proxy server just too much trouble?

Question: I have spent the last few days getting an OAuth implementation up and running.  Not on Android, but on my web server that will act as the proxy to the OAuth protected service.  I'm just about to implement my Android client and my head is still churning over security and implementation issues.
OAuth is messy enough when the client is just a web browser.  You have the following series of steps:

(client web browser) make request to my proxy server
(proxy server) request unauthorized token from OAuth provider (e.g. - web service API)
(proxy server) ask OAuth provider to have user authorize the token.  Redirect web browser to OAuth provider's 'authorize' URI
(OAuth provider) after user completes authorization, redirects browser to your callback URI
(proxy server::callback URI) Exchange authorization token for an access token and then store it for future calls
Make API calls to OAuth provider and return response document to client web browser

Now that's quite enough as it is.  But when using the same mechanics with a mobile app as a client it gets even more involved.  The problem is of course that you have to do some acrobatics to inject a browser session into your mobile app's code flow while doing the OAuth dance.  This means you have to further complicate the OAuth dance as follows (I am using an Android app for this example to make things concrete):

(mobile web app::native code) make request from proxy server using Java/HTTP
(proxy server) request unauthorized token from OAuth provider (e.g. - web service API)
(proxy server) return a response document to the mobile web app that contains the redirect URI for user authorization by the OAuth provider, preferably obfuscated to hide the consumer key and other details to deter "over-the-air" snooping.
(mobile web app) Launch a web browser activity with the authorization URL with an intent filter installed.  However, store and then replace the proxy server's specified callback URI with a special "phony" URI crafted for easy URI identification by an intent filter (see following steps)
(OAuth provider) after user completes authorization, redirect browser to your "phony" callback URI.
(mobile web app) Intent filter detects "phony" callback URI and uses that signal to regain control.  Rebuild the proxy server's callback URI and use Java/HTTP to execute the request.
(proxy server::callback URI) Exchange authorization token for an access token and then store it for future calls as before
Make API calls to OAuth provider and return response document to mobile web app

This is rather hideous as you can see.  If there is a much simpler way of doing this then I am eager to hear it.  As far as I know there only two other alternatives, each with their own significant problems.
1) Forget about a proxy server and do everything directly from the mobile web app.  The big security hole here is that you have to "bake" in your OAuth consumer key and secret into your app.  If an attacker decompiles your code and hunts down those strings,  a fairly easy operation for someone who is experienced at reverse engineering, they can wreak havoc with your application and users.
2) Switch to XAuth where the user provides you with their login name and password, and you "agree" not to store them and exchange them directly for an access token with the XAuth server.  The first problem is gaining user trust to provide that information, the problem OAuth was created to solve, and of course what about people that don't honor their commitment to discard the login details?  Worse, the XAuth server must support XAuth and offer HTTPS (SSL) connections and I have seen tons of web API's that don't support either.  An SSL connection is necessary of course because without it you'd send the user's login name and password over the wire in plain text when making your XAuth request.
http://blog.zyber17.com/post/1283741364/why-xauth-is-a-really-dumb-idea
FYI, although it does not use a proxy server the following example illustrates the technique I described above for injecting a browser session into your mobile app OAuth interaction and intercepting the callback URI:
http://blog.doityourselfandroid.com/2010/11/10/oauth-flow-in-android-app/
So it seems pretty ugly any way you look at it and I didn't even get into the additional annoyance of creating and managing your own user ID for the user so you can look up their access tokens stored on your proxy web server properly (including the messiness of one more PIN or access code for the user to manage).
Interesting side note:  When doing some research on an Android web browser session security I was pleased to find out that you are not allowed access to the current web page HTML.  If you could access it, then a hostile Android coder could easily sniff out the user's login and password thereby defeating the purpose and intent of OAuth entirely.  I was dismayed to find out that there may be a way to get that HTML by way of the CacheManager object.  Curiously enough that object is now deprecated and schedule for removal according to the Android docs so hopefully that means Google discovered the (potential) security hole and is taking steps to remove it in an upcoming build:
http://developer.android.com/reference/android/webkit/CacheManager.html
In closing, I'd like to hear the thoughts of those out there that have struggled with these very same issues when creating their OAuth applications.
-- roschler
Answer: Janrain has released a library which provides some UI glue and a proxy backend login system; it supports a bunch of popular OAuth identity providers (e.g. Google/FB). At the end of the sign in flow you get an HTTPS POST from the device supplying you with a token exchangeable for a user identifier and other info, and a channel to return an access token to the device.
http://www.janrain.com/products/engage/mobile
https://github.com/janrain/engage.android
Disclosure: I work at Janrain, on this library.