Webservices to monitor Windows Azure

Question: Does anybody of you know if there are any Webservices (or other interfaces) to monitor an, for example ASP.NET application, which is hosted within Windows Azure from a NON .NET environment?
Comment: Do you mean a non-Windows environment or an environment on which .NET is not allowed to be installed? Mono might be viable if not in the Windows environment.
Comment: No, I have to access it from a mobile device, so Mono is no option, but thanks.
Comment: What mobile platform do you need to monitor it from?
Answer: If you're talking about monitoring things like performance counters and diagnostics (logging), those may be accessed from any language, as that information is ultimately stored in table Storage (you need to just set it up in your Windows Azure app as it starts up). Storage is accessed via a REST interface. Additionally, there are SDKs for PHP and Java to facilitate this. There are a few additional open source project I've seen as well - for instance, Ruby.
For a desktop monitoring tool, check out Cerebrata's Azure Diagnostics Manager.
Note: the Management API is also REST-based, so you can control deployments from other languages as well (e.g. scaling instances up/down, stopping/deleting a deployment, creating a new service, etc.). You'll see that the PHP SDK already wraps most of the Management API. See here for detailed API documentation.
Answer: Dirk, it depends on what you're trying to monitor. There are many partner products like AzureWatch from Paraleap that can monitor applications in Windows Azure, or you could always write an application yourself to monitor your Windows Azure application using the Windows Azure APIs (try AzureMonitor on CodePlex] as a start). You can find out more information about Monitoring on MSDN and the Windows Azure Managed Library Reference.
Comment: AzureWatch also has an HTML5 app that allows for monitoring on the mobile devices (Android or IPhone)

Webservices to monitor Windows Azure


Use of apostrophe and "of" in same sentence to form possesssive

Question: To form possessive constructions with adjectives and pronouns, the rules are unambiguous:
e.g. "My (adj) daughter" and "daughter of mine (possessive pronoun)" are both standard usage.  However, when the "owner" happens to be a proper noun, usage gets slightly murkier. The use of an apostrophe in the case of "John's daughter" is standard English; however, in the periphrastic case, I have encountered both in common speech and in writing something like, "daughter of John" and "daughter of John's," the latter in which both an apostrophe and the preposition "of" are used.  What is the rule here?
Answer: The double possessive, or double genitive, dates back to Chaucer's time, and mostly gets used without being remarked upon by native speakers. If you want a 'rule' then let that be that the double possessive is only used for people and animals, and you use 'of'. You can say a daughter of John's, but never a leg of the table's. The usage is not restricted to proper nouns: you can say a friend of my sister's or a servant of the king's.
Sometimes a double possessive is useful to avoid abiguity - consider a dream of Mary and a dream of Mary's.
You will find pedants and stylists who object to the double possessive, but, as I wrote above, it has been present in English since the 14th century, and does not give native speakers any trouble.
Double possessives demonstrate the power of 'of'
A guide to double possessives


Show speed in Finder Copy progress window

Question: Is there a way to show more details in the Finder copy window? I'm mainly interested in the speed.
Comment: great question . i have been trying to find this for a while. I think google should point us to some app
Answer: AFAIK here isn't any "builtin/hidden solution".
You can get (probably rough) numbers:

open Applications -> Utilities -> Monitor Activity
Select Disk Activity and you get actual IO/Data speed.


How many celestial bodies can I see with a 90x telescope?

Question: I am a 9th class student so I'm a beginner at using a telescope, hence please help me.

How many bodies can I see using a 90x telescope?
How will I know when and where I should point a telescope to see planets?
Comment: What do you mean by "bodies"? The magnitude limit of your telescope does not depend on magnification, it depends on the aperture (light-gathering power) of the telescope.
Comment: On spring break, quite a few.
Comment: Yeah, magnification means almost nothing. It would be much more useful to know what's the aperture of the telescope, and perhaps the type of instrument. Basically, what's the "make and model" of that instrument? Example: "it's an Orion SkyQuest XT8".
Comment: to locate the planets.. use Google's Sky map app for Android phone ..
Comment: Or just look for bright things along the ecliptic and have a peek at 90DX.
Answer: The key issue for a telescope is not magnification but light gathering capability - which is (crudely) the size of the main aperture. Thus a 90x magification on a very large (wide) telescope would let you see a very large number of things (if you are in an area where the sky is dark), but 90x on a small telescope would let you see a number of interesting things (the Moon, planets, some nebulae and star clusters) but not relatively faint objects.
Small, cheaper, telescopes are still worth buying if you want to dabble, seeing the Moon through a telescope is always amazing and a small telescope can show lots, for instance.
Also, for a small telescope don't go for big magnifications - 90x would be fine for a low cost 50mm refractor for instance.
As for where the planets are - Venus, Mars, Jupiter, Saturn are generally easy to spot if you look up their positions online and know your way round the constellations. Because the planets are not, as stars effectively are, points at infinite distance, but small disks they (on most nights) do not twinkle as the stars do.
Comment: Yeah, 90x is actually pretty close to the limit for a 50mm refractor; if it's low-cost it's quite possible it wouldn't work very well much above 50...60x or so, depending on a number of factors.
Comment: Wouldn't location also play a large part of what bodies can be seen? I can't imagine using any kind of telescope on the Strip in Vegas would be very useful compared to that same telescope on a high mountain in the remote Nevada desert.
Answer: https://in-the-sky.org will help you spot what planets are visible from your location with direction and time. I could see Jupiter, Saturn using the naked eyes as bright spots.
90x magnification should be just fine for Jupiter and Saturn - you'd see the disc of Jupiter clearly with the four Galilean satellites and Saturn's rings
Comment: 90x magnification should be just fine for Jupiter and Saturn - you'd see the disc of Jupiter clearly with the four Galilean satellites and Saturn's rings.


Can I skip the jumpship sequences?

Question: When travelling to another system there are always a number of cut-scenes showing the ship dock to the jumpship, travel trough space etcetera. Is there a way to permanently disable these?
Comment: I've founf no way myself but would love it if you could. Likewise Why does it always load up into the title video rather than going to the title screen - how many times does it think I want to watch the history of the battletech universe?
Comment: If you're interested in '*hacky*' methods, I wonder if shortening the travel times in the config files would let you set them to 0 (or close to 0) to enable insta-travel. The only downside to this method would be that no in-game time would pass (or be skipped), and so repair/upgrade jobs wouldn't progress as you travel...
Answer: No, there is no way to do this.
Answer: you can press "esc" to skip the docking scene....but it does not work with the jump scene
Comment: Edits are done to improve the readability and clarity of your answer. Please don't roll them back.

Can I skip the jumpship sequences?


what type of gas masks are effective against fumes of muriatic acid?

Question: Some pool cleaning activities utilize a substantial amount of muriatic acid. The fume from this is quite dangerous. What should one look for in a mask that protects against the fume? What type of clothing is recommended?
Comment: Really , quite dangerous? We use muriatic to etch concrete, balance swimming pool PH , how is it quite dangerous? No gas masks are required for most of the usages! A rare down vote Btw.
Comment: @EdBeal I have used it for PH balancing at about 1/2 gallon by just avoiding he fumes. That I can handle. But I saw someone use 15 gallons in 3 hours to clean a pool, he had a mask but did not use it. It just did not look safe to me.
Comment: @EdBeal If you've never gotten a whiff of 34% MA fumes, then you're lucky. It's not pleasant, and it's absolutely not good for you. For one of many easily found examples, see https://www.doityourself.com/stry/10-muriatic-acid-safety-tips
Comment: @gene I have used muriatic acid thousands of times and you may even find close to 50 answers or comments on this site from me on using muriatic to etch. There are many things that are not good for you concrete when wet on your skin is not good for you. Bleach is not good for you. Yes if you sniff an open bottle it's not good but having used it many thousands of times with NO ppe it is not required. Do you need a mask to use or dilute it safely? NO.
Answer: Muriatic Acid is the trade name for diluted hydrochloric acid (HCL). So, basically hydrogen chloride in water. You need a respirator that will handle hydrogen chloride; look at those labeled for use with acid gases and make sure that HC is listed, such as this one:
Answer: I don't know the answer to your question, but the answer to the entire category of your question is consult the MSDS (Materials Safety Data Sheet).  Manufacturers are legally required to make them available and you will be able to find the precautions necessary for your specific product.  I'll let you surf the datasheet or look up the one for your brand.
Never mind, I couldn't resist.  For the brand I've linked:
"Wear rubber gloves and eye protection when handling. Goggles should be vapor proof. Wash hands after handling. Provide ventilation for storage and use areas. Wear impervious clothing when handling and using this product. Do not breathe vapor. Avoid contact with skin and clothing."
Comment: This is a better answer because osha doesn't require a mask but gloves and face shield are.


Stained concrete

Question: I went to change out my doormat (those coconut-husk fiber ones) and there was a stain and it's sticky. The stain is not size of the doormat, it looks like someone spilled a drink in front of our door. I thought it was dirt/mud(it's rained alot and our yard was a mud pit for months till the builder finally installed grass) and went to scrubbing it with water and alil dawn dish soap. Stain is still there, I think the sticky is gone(it's still drying). Do these doormats cause this?  Is the concrete defective?
Answer: Based on your description it's highly unlikely that the sticky stain was caused by your fiber mat or defective concrete.
Without knowing the cause, it's difficult to recommend a specific solution. You should talk to your builder. One of his helpers may have spilled something and didn't clean it well.
However, there are numerous concrete cleaners on the market, one of which will almost certainly remove the stain. It's always best to start with the mildest which you've already done with soap and water.
Next I would try a concrete driveway cleaner that you can buy at any home store in your area. Even the mild ones can be caustic so follow the directions carefully using protective gloves and eyewear as recommended.
If that doen't remove it you may have to go stronger with a muriatic acid solution. Be careful of the strength you're buying. They range from a weak muriatic acid solution to full strength. Again follow directions carefully. I've used full strength to remove varnish stains from a concrete entry but a weaker solution should do the job for you.

Stained concrete


Manage or "export" widgets to the theme options page

Question: I was wondering wether is was possible to some how "export" all the widget options or engine to the theme options page. So everything is in one place.
Got any idea?
Thank you for any help.
Answer: If you have ever had to transfer a large number of widgets from one WordPress site to another, then you know that there's really no easy way to get the exact same widget option settings added on another site. Manually adding all of your widgets on the other site can be quite tedious.
Widget Settings Importer/Exporter is a new plugin that aims to make this process much easier. It allows you to export your current widget settings and states as a json file and import them into another WordPress installation. If you already have widgets in place on the site where you're importing settings, don't worry because the plugin won't overwrite any data currently within the sidebars.
This plugin has the potential to save you quite a bit of time. Download Widget Settings Importer/Exporter from the plugin repository.


How to boil 40ml of water using a solar panel of 15v and 1amp?

Question: I am making an application to use in third world countries where there is unlimited sunshine
I need to boile a very small amount of water, up to 40ml, using a solar panel that generates 15v and up to 1 amp
If possible what resistor ahould I use and any information on how to build this will be appreciated
Answer: For every solar panel there is a particular combination of current and voltage that will maximize power output.  You can either look at the datasheet for the panel to find those values. Or you can test the panel with different resistors of known value and create your own graph like the one below. Once you know the current and voltage you need you can calculate the resistance of the load you need with Ohn's Law:$R=V/I$


Unity bowling pins detection

Question: I'am working on bowling ball game and I want to detect how many bowling pins has been knocked down by ball? What is the solution for this problem?
Answer: Here's an example similar to how I detected domino tipping in Last One Standing.
public class Tippable : MonoBehaviour {

    // roughly 1/sqrt(2), for a 45 degree angle.
    const float TIP_THRESHOLD = 0.707f;

    // This lets you register another script to
    // listen for "tip" events & tally them.
    public UnityEvent onTip;

    public bool tipped {get; private set}

    // Start with a loop to check if we're tipped over.
    IEnumerator Start() {

        while(!tipped) {
            // Wait till next frame.
            yield return null;

            // Check if our local up is not very upward anymore.
            tipped = transform.up.y < TIP_THRESHOLD;
        }

        // Report that we've tipped.
        onTip.Invoke();
    }
}

Comment: thanks for your answers it also helped me, I have to change my code slightly. And your **Last One Standing.** is very nice game.
Answer: Depending on precise requirements, the detection can be as simple as checking the transform.position.y:

(optional) add child Top at top of each bowling pin
When placed, record the vertical position of (Top of) pin
each Update() check if pin's original and current vertical position difference is greater than a threshold (e.g. 1/2 pin height)
bool isKnocked = Mathf.Abs(transform.position.y - originalY) > halfHeightThreshold;
(optional) when crossed the threshold, emit PinKnocked, a custom UnityEvent<Pin> which you have subscribed to in your game logic controller (e.g. GameManager)
if(isKnocked && !wasKnockedLastFrame) OnKnocked?.Invoke(this);
Comment: could you explain the 3rd step
Comment: I was using z for difference but as you guys suggested to use y axis for get the difference b/w current and original, it is working fine but still I didn't understand why and how y axis working in this problem.
Comment: @AbhinaySInghNegi it all depends on what is you `up` axis it can be either of the x,y,z or arbitrary combination of those. The default one for Unity is `y`, so I guess it would make more sense to include it in the answer.
Comment: hey thanks for updating your answers now it became more clear for me.

Unity bowling pins detection


Difference between 404 and Soft 404

Question: I want to know what is the difference between 404 error page and Soft 404
Comment: See Google Webmasters: [Soft 404 errors](https://support.google.com/webmasters/answer/181708?hl=en)
Answer: A "soft 404" is when a document describing a 404 error is returned by the server with a 200 OK status code in the HTTP headers.
This tells browsers, search engines, etc that it is a regular page (which should be indexed by search engines) and it takes a human reading it to realise that it is actually an error page.
Comment: Or in other words: A "soft 404" is an error page with the wrong HTTP status code. I think an error message with a `200` response is a terrible idea. Error messages shouldn't be indexed.
Answer: 404 is a HTTP response code which means the 'Not Found'. When Server unable to find a requested resource from the client, it returns a HTTP Response code 404.
Soft 404 is when server redirects to a customised page to stop user from viewing the requested resource. There might be cases like a 404 has happened or it may not happened. The page requested is available,but that page is not working properly, So rather than ,viewing the partly wokring page, user is redirected to a custom page without providing the resource asked for.In Google's own words: "This is like a giraffe wearing a name tag that says 'dog'. Just because the name tag says it's a dog, doesn't mean it's actually a dog. Similarly, just because a page says 404, doesn't mean it's returning a 404 status code." By soft 404 means, user will be redirected to a custom page or other location because of any reasons[might be 404 or anything else.].
These urls can be checked for reference::
https://www.hallaminternet.com/what-are-soft-404-errors-will-they-affect-rankings/
http://forums.seochat.com/search-engine-optimization-28/diff-between-404-soft-404-error-467526.html
Answer: The 404 or Not Found error message is a HTTP standard response code indicating that the client was able to communicate with a given server, but the server could not find what was requested.
Basically, Soft 404 is a page that looks like a 404 but returns a HTTP status code 200.  I mean, the website might show a "Page Not Found"-style page, but search engines such as Google will see the page and think that it's an actual live page.
Comment: can you please explain HTTP status code 200? and does Soft 404 affect seo
Comment: HTTP status code 200 means the web server processed the request successfully and transmitted content back to your browser. That mean the request you send to the server is working well and transferring your data.

And Soft 404 means when a non-existent page (a page that has been deleted/removed) displays a 'page not found' message to anyone trying to access it, but fails to return a HTTP 404 status code. that mean page will be load correctly but certain data will not able to load in your browser.
Comment: Soft 404 could effect to get HTTP status code 200 in that situation if your requested data to the server contain from deleted/removed page.

Difference between 404 and Soft 404


joints not showing up in rviz

Question: First of all, I'm not a native speaker sorry for my English, I'll try to fully demonstrate my problems. I wrote a urdf file that contains a base, four wheels, and a lidar. Everything is showing up normally as it should in Gazebo, but when I open up Rviz all my wheels will be in the center of my base, seems like the joints are somehow missing, I tried to publish joint state publisher gui to move my joints and got no luck since it's all stuck in the center. Any help is appreciated Ty.`
Comment: Welcome to Robotics Stack Exchange! Two comments: 1. It is better to paste the URDF in the text form rather than sharing a screenshot. Please note that images are not text-searchable. 2. Please share us complete information, such as which package and commands you executed. My guess is that you do not have a `joint_state_publisher` thus the bot can not be rendered completely.
Answer: As already mentioned, it seems that your are missing the tf2 tree, which rviz needs to render your robot.
You'll get this by adding robot_state_publisher to your launch file.
A tutorial of the robot_state_publisher with a python script can, e.g., be found in on docs.ros.org or in the demo repository of ros2_control or shipped with the gazebo_ros2_control_demos, what might be helpful for your setup as well.

joints not showing up in rviz


Is it possible to specify multiple home pages for the default android browser?

Question: That is, I want my browser to start with two tabs open, set to two different URLs.
I have tried putting "google.com | facebook.com" into the URL but that does not seem to achieve the intended effect.
Answer: No, it's not possible.
How did I get such result? As always I started to google this possibility but found nothing interesting. So I decided to check Android Browser source code. If you want you can download it by typing in console:
git clone https://android.googlesource.com/platform/packages/apps/Browser

After 5-10 minutes (I'm not new in programming) of looking repository I found 2 facts:
1) The homepage is saved as one String (Java type).
2) The homepage is opening by calling this function (in Controller.java):
@Override
public Tab openTabToHomePage() {
    return openTab(mSettings.getHomePage(), false, true, false);
}

So as you see (If you know programming a bit) it returns one tab, not several (like List<Tab>).
Comment: Kudos for taking the time to read the source. I should have done that but wasn't familiar with Android source tree to quickly find the browser code.


Problems with institution in the submission process of a paper to "Annalen der Physik"

Question: I wanted to the submit my newly written paper (my first paper) in the prestigious physical journal "Annalen der Physik". Incidentally, a problem arose. I filled out all of the boxes except the institutional information on the author login page. I am a school student from India, but I have no connection with any college, university, school or institution, thus I have no institutional information. I need another option for submitting my paper to this journal as an independent, self-taught researcher (nor as  professional information, nor a student, nor as a member in a research project group etc). How can this be done?
Comment: "_I am a school student from India,but I have no connection with any college, university, school, institution_" You have connection with your school.
Comment: You are right, but After typed my school name, I sow that my school is not in the instruction list
Answer: You can always approach Wiley directly to help with the submission process. However, it would seem to me that you might want to make sure that you are not wasting people's time.
You say that you are a school student from India. To be able to published in the Annalen, your work needs to be really good. And really good in Physics supposes a thorough understanding of modern Physics and Mathematics. If you are such an exceptional student that you have (presumably largely on your own) mastered these difficult subjects, then your teacher and your principal should be able to put you in contact with a good university. They after subjecting you and your paper to some scrutiny will be happy to give you an institutional address so that you can submit your article. If they do not succeed with an institution, they can surely find a physicist with a Ph.D. and some background in the field of your article to have a look at it. If that verdict is positive, then it will be easy to find a university interested in talking to you. Even if your paper is not good enough to be published, you might be recognized as a talent worth fostering.
If on the other hand you are not that exceptional, but maybe just a very bright student, your paper is not going to have the qualities needed in a publication there and if you overcome the lack of an institutional address, you will just receive a "desk reject", having wasted the time of a lot of people. If you have talent, that time would have been better spend on finding ways to groom you into a physicist. If you do not have talent, then you are deceiving yourself and the sooner you know this, the better for you.
Answer: However prestigious can be the journal, do you really want to submit a paper that has a close defined institutions' list?
In their submission login windows they claim to be prestigious "Based on the fame of seminal papers by Einstein, Planck and many others". Yes, they exploit the fame of some great minds of 100 years ago to exploit the work (and the naivety) of researchers like you to make a huge profit providing a platform where it is difficult even just to submit a paper.
Have a look at preprint servers, like https://arxiv.org/ , since it is your first breakthrough idea, this will put a kind of timestamp on it, protecting to some degree paternity of the idea, and it will as well make your contribution available to the physics community as soon as possible, so you can ask for feedback by providing a link to your arxiv submission.
Comment: However, arxiv will require an "endorsement" ... they try to minimize junk science.
Comment: If you "publish" on arXiv, you lose the advantage of the review/feedback process of a reputable publisher.
Comment: side note, nice but not necessarily necessary: submission to arxiv are free of charge, both to contribute to and to read from.
Comment: @GEdgar but they do it for free :) ! I am very much in favour of the "Having an endorsement" required by arxiv, I think is the right way to proceed for many reasons which are long to clarify. In short: OP will find out that publishing their idea is very important but not very urgent, since it takes a long way to "write a paper and submit to review"
Comment: @Buffy infact arXiv provides a more informal and honest channel for review/feedback, which is what Einstein&co were doing before submitting to the illustrious journals of the time: they were getting feedback on their ideas via snail mail and personal correspondence/discussions. Then after much debates and exchanges, the Einstein&co. were going to submit to a reputable journal to get the paper reviewed (maybe) and published.

Publishing on arXiv and getting feedback and comments and then, 5 years down  the road, OP is ready to rethink about submiting their work to another publishing venue.
Answer: It seems odd to me that a journal published by Wiley would restrict the authorship to any "approved" list. I suggest that you approach the editor of the journal through their system (or through Wiley) and ask them directly how an Independent Researcher can submit a paper. I can't promise you success in this, but it would be an appropriate step.
This is just a guess, but their most famous author was Einstein, and I'm guessing that at the time he first submitted he had no academic affiliation. Historians of science might prove me wrong in that. He might still have been associated with U. Zurich, but was employed by the Patent Office at the time. But see: https://en.wikipedia.org/wiki/Annalen_der_Physik
Comment: I believe he submitted his first article a few months after graduating in 1900, whatever that means in terms of his affiliation. As far as I have read, their submission procedure for theoretical physics papers at the time boiled down to sending a letter to Max Planck, who presumably cared more about the science than such things. In addition, none of the Annalen der Physik papers I've read from the time have affiliation bylines.


Animating paths in After Effects

Question: I have an illustration that I would like to animate in AE. Not sure how to do this however. I have three paths (simple lines) I made in illustrator with the pen tool, then used to width tool to thicken at one point and taper at the end (they're tentacles!). Anyway, I just want to animate the tentacles so they squirm and writhe around. So far all I've been able to do is use the usual transform properties, but those aren't very dynamic or useful for this project. How do I go upon doing this in AE?
Screenshot of illustration.
Comment: You might also look at using the Puppet Tool on each of your tentical layers.
Answer: Probably the most dynamic and full control option would be to use taper stroke in after effects - just redraw the path and apply taper like here - https://i.ytimg.com/vi/jFBKMRncG80/maxresdefault.jpg
then you have a multitude of options to displace them (like wave warp, mesh warp, wiggle-shear, or even map the end points to nulls and use wiggle position).
Tapered stroke is only available in CC 2020 and 2021 if I remember correct.
Another option would be to expand shapes in AI and copy path into AE which you can then animate later, but it would be more time consuming.
Answer:
Add a solid layer
Add Red Giant 3D stroke to it
Make a path with Bézier curves in it on the same layer.
Adjust the taper settings in 3D stroke to look like the original tentacle
Select your Mask Path in the 3D stroke
Create Nulls from Paths
Click the Points Follow Nulls button
Now a null will be created for every point on your path.
Go to a null you want to animate
Right click on its Position and select Separate dimensions
Add an expression to the Y position by alt/option clicking on its keyframe icon
Put in an expression like "wiggle(1, 100)" where 1 is the frequency of the wiggle (one wiggle per second) and 100 is the amplitude in pixels (how far it should move from its original position).
Do this for each tentacle
Mask out your original tentacles once you've done this.
Adjust the wiggles until they look nice

Animating paths in After Effects


Which is the best Java Data structure for my application?

Question: My problem statement is like that when i get a data , i store it in a data structure and keep a counter.If something similar comes then by searching it in the data structure if similar thing is already present there then just increment the counter and there is no limit of my data. The data can be sometimes very larger.So being a beginner in java i want to know which data structure would be good/efficient for my problem.
Answer: You want a HashMap, with whatever your "data" as the key, and a counter as the value.
http://docs.oracle.com/javase/1.4.2/docs/api/java/util/HashMap.html
The reason it's a good choice is because it has O(1) "contains" checking, retrieval, and insertion time. As long as you don't need to sort your data, it's an excellent choice.
This untested code should get you started. Replace String with the type of your data. If it's a custom class, you must overload hashCode() and equals().
HashMap<String, Integer> map = new HashMap<String, Integer>();

...

Integer i = map.get(data);
if(i == null) {
   map.put(data, 1);
} else {
   map.put(data, i + 1);
}

Answer: Sound like you need to use a HashMap<YourClass, Integer> (link).
The value is the counter, that's why it is integer.
when something comes you check to see if an item with that key exists. If not you add it (with a value of 1), otherwise you add it with a value of one plus the previous value.
You can optimize on that by instead of Integer make your value be a custom class, which wraps an integer and allows to be incremented. This way you won't have to insert into the hash map every time when you increment.
Comment: Cool optimization; never thought of that. +1


Will Ubuntu erase my my current OS if I install it from a bootable usb?

Question: Okay, so I have the demo Ubuntu up and running on my bootable USB device. But I want to install it so that Ubuntu will save my files that I install and download etc. But if I choose to install Ubuntu, will it install on my USB device or will it install on my hard drive and erase Windows 8?
Answer: On a ubuntu live-usb,if you run the Ubuntu installer,it tries to install the Ubuntu Os on the hard-disk.

If you choose install Ubuntu alongside windows option,the installer formats all the partitions other than windows partition(C partition) and install Ubuntu on it.
If you choose erase the disk and install Ubuntu option,the installer formats the whole disk and installs only Ubuntu.
If you choose something else option,the installer force you to manually select the partition where Ubuntu is going to be installed.
Comment: Does it have an install alongside option for Windows 8? Ain't tried it yet...
Answer: If you want to Install it on your USB here some tips
1.Your installation Media (Installer) and your installation target (whre youwant to install) must a diffrent disk (e.g your Installation media is USB A and your Installation target is USB B)
2.If you want to install it on a USB drive install it from a Virtual Machine or on a machine that have no OS.If you install it from a computer that already have an OS (Windows for example) it will overwrite it's current bootlaoder and switch it to GRUB bootloader
3.Make sure your USB drive is fast enough
So if you want to Install your Ubuntu on a USB Flashdisk install it from VMWare,or you can install it directly from your computer but maybe you want unplug your HDD first so your Installer won't read your Windows (atleast that what i do )
Answer: when you chose "install ubuntu" it will ask whether you want to install it "alongside" your current OS or if you want to replace the OS with ubuntu. choosing alongside will keep your current OS and will install ubuntu. It will let you take a piece of a partition on the computer for ubuntu.
...it won't install ubuntu on the live usb itself
Answer: If there is space on the USB stick, you can install on it. The same for the hard disk as well, though this would create a dual boot on one hard disk.
You chose when you reach this stage - go for 'Something Else':

For the memory stick:
If you select the something else install, to install to your memory stick, make a / partition (where the system files go) and a /home partition (where the user's files are stored). Make sure your memory stick is selected as the boot loader device. The memory stick should really be bigger than 6Gb, and it might be helpful to have the installer on another USB drive.
A better guide may be found here.

Warning - may be a bit complicated to do...
For the hard disk it may display a dual boot option (something like this).
If not, chose 'Something Else', and create a /home partition, and a / partition. You can put swap in as well, which is where data will go if the RAM is full, or if the computer is hibernated (I did not think this would be worthwhile on a memory stick).
If there is not enough space, you should be able to resize existing from the install disk, or from Windows Disk Manager. Try to create a space bigger than 10GB, especially if you are doing swap.
As I have not tried anything like this for a while, corrections are welcome.
Comment: Installing directly on the USB is tricky, if the installation image is on the same USB. There is a full answer here: http://askubuntu.com/questions/16988/how-do-i-install-ubuntu-to-a-usb-key-without-using-startup-disk-creator
Comment: Its not that tricky @Rmano... The main thing to remember is to do it so that the bootloader is on the USB as well.


Measure, volume and cardinality on Minlos' book on statistical physics

Question: The following content was based on Minlos' book on statistical physics. Let $\Lambda \subset \mathbb{R}^{d}$ be fixed (Minlos takes $d=3$ but I think the ideas follow without change to $d \ge 1$). We denote by $\Lambda^{N}$ the $N$-fold cartesian product of $\Lambda$ with itself and $(\Lambda^{N})'$ $N$-uples $(x_{1},...,x_{N})$ in $\Lambda$ with different entries, i. e. $x_{i}\neq x_{j}$ if $i\neq j$. Also $\Gamma_{\Lambda, N}:=\{\omega \subset \Lambda, \hspace{0.1cm} \mbox{card}(\omega) = N\}$, where $\mbox{card}(\omega)$ is the cardinality of the set $\omega$. Define $\Pi: (\Lambda^{N})' \to \Gamma_{\Lambda, N}$ by $(x_{1},...,x_{N}) \mapsto \{x_{1},...,x_{N}\}$. For every subset $A$ of $\Gamma_{\Lambda, N}$, Minlos set:
$$ \mu_{\Lambda}^{(N)}(A) := \frac{\mbox{Vol}(\Pi^{-1}(A))}{N!} $$
Then, he states that
$\mu_{\Lambda}(\Gamma_{\Lambda, N}) = \frac{|\Lambda|^{N}}{N!}$. The problem is that he doesn't seem to define $\mbox{Vol}$ or $|\cdot|$ anywhere and it is getting me a little confused. At first, I thought $\mbox{Vol}$ was just the Lebesgue measure on $\mathbb{R}^{dN}$. But it would be a little odd because if I take $A = \{x_{1},...,x_{N}\}$ it seems that $\mu_{\Lambda}^{(N)}(\{x_{1},...,x_{N}\}) = 0$. Besides, how come does the second statement about $\mu_{\Lambda}(\Gamma_{\Lambda, N})$ follow? If $|\Lambda|$ is the cardinality of $\Lambda$ (which I don't know for sure), does it follow from de definition of $\mu_{\Lambda}$?
Comment: Note that there are pedagogically better sources to read about such topics. For instance, [these lecture notes by S. Adams](https://warwick.ac.uk/fac/sci/maths/people/staff/stefan_adams/lecturenotestvi/cdias-adams-30.pdf). In the lattice case, I'd recommend [our book](http://www.unige.ch/math/folks/velenik/smbook).
Answer: If $\text{Vol}$ denotes the Lebesgue measure on $(\mathbb R^d)^N$, if $|\cdot|$ denotes the Lebesgue measure on $\mathbb R^d$, and if $\mu_\Lambda=\mu_\Lambda^{(N)}$, then indeed $\mu_\Lambda(\Gamma_{\Lambda,N})=\frac{|\Lambda|^N}{N!}$. This follows because (i) $\Pi^{-1}(\Gamma_{\Lambda,N})=(\Lambda^N)'$ and (ii) (say, by the Fubini--Tonelli theorem) $\text{Vol}((\Lambda^N)')=\text{Vol}(\Lambda^N)=|\Lambda|^N$.
As for $\mu_\Lambda^{(N)}(A)$ with $A=\{x_{1},...,x_{N}\}$, it is undefined. Indeed, for $\mu_\Lambda^{(N)}(A)$ be defined, $A$ must be a subset of $\Gamma_{\Lambda,N}$, whereas $\{x_{1},...,x_{N}\}$ is a subset of $\mathbb R^d$ but not of $\Gamma_{\Lambda,N}$. On the other hand, if $A$ is the singleton set
$\{(x_{1},...,x_{N})\}$ with pairwise distinct $x_j$'s in $\mathbb R^d$, then indeed $\mu_\Lambda^{(N)}(A)=0$, and there is nothing odd about that.
Comment: This is a very good answer! In summary, it looks like $|\cdot|$ is not the cardinality of the set, but it $|\cdot|$ and $\mbox{Vol}$ seem to be two Lebesgue measures on different spaces. It makes sense to me!


In ASP.NET page is redirecting to the empty page or server can't display the page after updating record in datagridview

Question: After updating the record in the datagridview i had redirected it to the same page using server.redirect. But its remaining on the same page and showing the error 'server cannot display the page'. But the record is updating in the database. and if I copy the url and paste it in the other instance of the browser the datagridview shows the record with updated values. When I run the solution on local machine its working fine but after posting on the dev server the above error is coming.
Please, suggest any solution on this.
Thank you.
Comment: Please show us code and exception stack trace.
Answer: Why are you using server.redirect?  If it's the same page, just complete the operations and allow it to post back.
Regarding why it's crashing, please post code...although simply using post back will probably fix the issue.


Azure Application Gateway limitations - wildcard SSL cert

Question: We have ~60 client apps, each with its own  subdomain URL in a common domain, i.e. client1.domainname.com, client2.domainname.com... - all covered by a single wildcard SSL cert *.domainname.com. Currently hosted on-prem with a pair of LBs and 2 backend IIS nodes using  host headers for subdomain URLs and cookie session affinity.
We need to migrate this environment to Azure and utilize Application Gateway. Unfortunately, AG has some drastic limitations https://docs.microsoft.com/en-us/azure/azure-subscription-service-limits?toc=%2fazure%2fapplication-gateway%2ftoc.json#application-gateway-limits, namely:
<code>1) HTTP Listeners   20
2) Number of sites  20  1 per HTTP Listeners
3) URL Maps per listener    1
</code>
Questions:
A) regarding #2, can wildcard domain  *. domainname.com be treated as 1 site / used in Hostname property of Listener definition?

if not, then does it mean I need to create 1 Listener per client, i.e. HTTPSListener1-> client1.domainname.com, HTTPSListener2->client2.domainname.com and so forth?

if the answer is 'yes', can I use same wildcard cert *.domainname.com in SslCertificate property of multiple listeners while only changing Hostname field to be client (subdomain) specific?

if true, that means, given 20 Listeners per AG limitation, I'd need to create 3 separate sets of AGs to fit my 60 subdomains meaning I'd incur unnecessary cost running additional AG pairs

B) there are only 2 backend nodes on-prem and we prefer the same in Azure for cost savings; my understanding is that multiple AG sets cannot point to the same backend VMs. Can a workaround for this be having multiple vNICs per VM and pointing to different AG sets, i.e. AG1 set->vNIC0 primary, AG2 set->vNIC1 secondary, AG3 set->vNIC2 secondary?
Sorry for loaded question but I'm hoping that others will find this post  very useful as detailed information on this topic does not appear easily obtainable.
Listener example:
<code>"httpListeners": [
    {
        "name": "appGatewayHttpsListener1",
        "properties": {
            "FrontendIPConfiguration": {
                "Id": "/subscriptions/<subid>/resourceGroups/<rgName>/providers/Microsoft.Network/applicationGateways/applicationGateway1/frontendIPConfigurations/DefaultFrontendPublicIP"
            },
            "FrontendPort": {
                "Id": "/subscriptions/<subid>/resourceGroups/<rgName>/providers/Microsoft.Network/applicationGateways/applicationGateway1/frontendPorts/appGatewayFrontendPort443'"
            },
            "Protocol": "Https",
            "SslCertificate": {
                "Id": "/subscriptions/<subid>/resourceGroups/<rgName>/providers/Microsoft.Network/applicationGateways/applicationGateway1/sslCertificates/appGatewaySslCert1'"
            },
            "HostName": "domainname.com" ,
            "RequireServerNameIndication": "true"
        }
    },
</code>
Comment: Just came across this post  which implies wildcard SSL cannot be used in  _Hostname_ property of AG listener. Sad!
With that being said I still need answers on all of the questions posted above :-)
Answer: If I understand your question correctly, you are not REQUIRED to put a pathname for the listener. You can instead have a single global listener to cover your entire *.domain.com.   Does that help?


What is the PostGIS equivalent of ArcGIS "Intersect" tool?

Question: I am looking for the PostGIS ST_function that will give me the same results as running the ArcGIS Analyis-> Overlays-> Intersect tool on two polygons.
Answer: What your looking for is ST_Intersection.

ST_Intersection — (T) Returns a geometry that represents the shared portion of geomA and geomB. The geography implementation does a transform to geometry to do the intersection and then transform back to WGS84.

<code>geometry ST_Intersection( geometry geomA , geometry geomB );
</code>
You can see a query that implements it in this question (down at the bottom).


How to control the state of databases in between API Tests?

Question: I'm somewhat new to Automated API Testing and have been experimenting with doing some API (functional?/regression?) tests in SoapUI and Katalon against multiple microservices (no-UI, just API), along with using assertions to check for a valid response. However, I'm not sure how to handle the state of the database before and after a test is run.
For example, if I upload something through a POST to an endpoint and it's supposed to create 5 entries, then I can assert that those 5 were created by calling another endpoint with a GET and checking whether 5 objects are returned in the array. However, if I run that same test case again then I'll receive 10 entries (since the old 5 entries still exist) but my old assertion will fail since it's expecting 5.
I guess I can try to use DELETE calls to manually clear the state before a run but then I have to first track down the ids of what I want to delete. Or I can have some sql that runs to make sure those records are deleted but I run into the same issue, and both options feel janky. The only other option seems to be to restore the databases from dump files but that limits one to only running such tests on a test environment, which I guess might be a good thing? However, I haven't seen such support in SoapUI or Katalon for restoring database so far.
What is the best way to handle the state of databases behind microservices while running API tests whether it's on a local machine or in the cloud?
Answer: You seem to have a REST design problem that is affecting the testability of the system.
Firstly, the POST could return the created entities (or references to it).
Secondly, the GET could have a filter option, such as createdSince parameter.
Hiding these problems will make them accumulate until your system is barely testable.
Now, if you want to proceed without fixing these issues, SoapUI offers the possibility of running Groovy scripts which you can use to manipulate a database.
Answer: You can set up a test listener that will run before the test case.
In Katalon Studio it will look something like this
class NewTestListener {
    /**
     * Executes before every test case starts.
     * @param testCaseContext related information of the executed test case.
     */
    @BeforeTestCase
    def sampleBeforeTestCase(TestCaseContext testCaseContext) {
        // Here you can send a GET request and note the number of records
    }

}

Than in the test case you compare the number of newly created records with the number frome the @BeforeTestCase hook.


What is the minimum titer of typhoid?

Question: What is the minimum titre of typhoid that can cause damage internally,  which are the organs that are prone to get affected by this?
Comment: i think for all the questions same person down voted , i am asking the reason for down vote , when you are down voting atleast suggest what is wrong with question.
Answer: The minimum infectious dose for a disease like typhoid is hard to obtain, because the most controlled method of obtaining this information is via human challenge studies, and those are essentially no longer performed due to some ethical issues. That means one must look at older data or observational studies, which have some methodological drawbacks.
A somewhat older review suggests the necessary dose to provoke clinical disease was <10^3 organisms. Public Health Canada characterizes the infectious dose for enteric fever (which is another name for typhoid fever) as ~ 10^5 organisms.
In terms of which organs can be effected - in the most severe cases, complications can be fairly systemic, with the most dangerous complication being haemorrhage due to intestinal perforation.

What is the minimum titer of typhoid?


Why do gas stations charge different amounts in the same local area?

Question: I've noticed there can be a 5%-10% difference in the price of gas where I live. For example right now the cheapest premium price is $3.85 and the most expensive is $4.17.  It's the same state and county, and the product being sold is considered a commodity.  I know the simple answer is "what the market with bear," but what specific factors account for this price variance?
Comment: I used to live near 3 gas stations on 3 corners of the same intersection. Two even had the same company name. They each had different prices. They all got business.
Comment: BTW, if you don't have [GasBuddy](http://gasbuddy.com/) on your phone then you are paying too much for gas.
Comment: http://www.kssfuels.com/ sells the softwere to help the gas stations decide what to charge, there website expain some of the factors.
Comment: I was always told it had to do with the fact that gas prices fluctuate so they based their price on how much they had paid for their gas and what the expected cost of the next shipment of gas would cost. That does seem to make sense, of course some people might also be price gouging.
Comment: Something else to consider is the price listed on the big sign may not be the same as what the pump would show.  I've seen a few times where there would be a difference between the sign and the pump price.
Answer: This is known as "Zone Pricing" or "Geographical Pricing".
http://articles.latimes.com/2005/jun/19/business/fi-calprice19

Such price variations may seem odd, but they are not unique to Anaheim. On any given day, in any major U.S. city, a single brand of gasoline will sell for a wide range of prices even when the cost to make and deliver the fuel is the same.
The primary culprit is zone pricing, a secret and pervasive oil company strategy to boost profits by charging dealers different amounts for fuel based on traffic volume, station amenities, nearby household incomes, the strength of competitors and other factors.
It's a controversial strategy, but the courts have thus far deemed it legal, and the Federal Trade Commission recently said the effect on consumers was ambiguous because some customers got hurt by higher prices while others benefited from lower ones.

http://en.wikipedia.org/wiki/Geographical_pricing

Zone pricing, as practiced in the gasoline industry in the United States, is the pricing of gasoline based on a complex and secret weighting of factors, such as the number of competing stations, number of vehicles, average traffic flow, population density, and geographic characteristics. This can result in two branded gas stations only a few miles apart selling gasoline at a price differential of as much as $0.50 per gallon.

But the short answer is "because they can". It's legal, provided that some people are paying less while others are paying more. Essentially the larger, richer audience is subsidizing the product for other areas. It's not terribly different than the way most drugs are priced in the world.
Comment: Great answer! I figured multiple factors were in play, since no single factor explains the variance.  Now if some Industry insider would publish the "secret weighting of factors"...
Comment: This is an application what they call "price discrimination" via "market segmentation" - essentially getting people with more money to spend more for the same stuff, sometimes by tying the price to the availability of "amenities" or other conveniences (e.g. being near the freeway). Price discrimination figures most prominently in the hard-to-comprehend areas of air travel and college tuition; with commodities like gas, though, the market can only support a certain level of price discrimination before people start pumping their gas elsewhere...
Comment: Gas stations are not the only one. Grocery stores that are part of the same chain will see the same products for different prices within the same city because for the same reasons.
Comment: Well, not just drugs,  most products are priced at what the market will bear. No sense selling for less right?
Comment: @Jim Oddly, this is not the case in East Asia. Most franchise stores (e.g. 7-11, Tesco) will have the exact same prices on most items. That's actually their main benefit over smaller stores (which have varying prices, sometimes not posted, but made up on the spot by the owner).
Answer: Location, Location, Location.
The closer to the highway, the more they can charge. People want to go less than a mile from the exit to get gas. Therefore  they save time, but spend more money. That is understandable, so the gas station takes advantage of the situation.
Comment: Always relevant, XKCD: http://xkcd.com/951/
Comment: It also costs them gas & wear & tear to drive farther from the highway.  Assuming the dropoff in price isn't too fast it can make sense to buy from the nearby station even though you know it's more.
Comment: Ah, xkcd. It doesn't matter how much you make in *salary* unless your going to get gas *reduces the amount of money you make at work*. Really, what you're probably making is a tradeoff with additional leisure time: you're paying several cents extra for that time. Worth it? Up to you, but it has nothing to do with minimum wage except as a random comparison point. Also remember: a penny saved is tax-free, so consider that too. :)
Answer: There are many factors.
Most gas stations price their gas based on what it will cost them to replace it.  So when their supplier raises the price that it charges the station the station typically raises its prices proportionality.  The suppliers tend to have their own rates.  The business needs to make a profit so the business sets the price where it feels it will make the most money.
Some stations buy bargain gas.  Many people say they find this gas to be just fine.  Personally some stations gas seems to make my cars run much worse.  I can say that my mileage can vary by as much as 4 miles to the gallon based on where I get my gas.  So I pay more to go to those stations that consistently have provided me good gasoline.  However higher prices do not necessarily mean better gas.  We have a BP just down the street that seems to have bad gas while one about a half a mile away that I prefer because I have never had a bad tank of gas.  Both are priced about the same.
Also some localities have special tax zones.  These are local taxes levied based on the location.  We have 4 different zones here in Peoria IL (150k pop).  That does not take into account the smaller cities around us.
Comment: "gas stations price their gas based on what it will cost them to replace it" +1 - exactly right
Answer: I only have anecdotal evidence here as members of my family used to own a grocery store / gas station, but they were often time charged much more to have the gasoline delivered to than many gas stations which were just a mile or two away (up to 15% more).  Also depending upon the branding of the gas station, they are required to use certain distributors (i.e. if you are an Exxon gas station you can only use a few select vendors) which gave them less control of their final cost.  All in all the gasoline often had smaller margins than items in the grocery store, which are already extremely low.
Answer: When I ran a gas station, our price was largely set by our neighbors-- the other gas stations in the area. We couldn't go below the current cost of replacement gas, but other than that we wanted to be at .05 over the average. (We got away with charging more because we were the last station on a major road.) Everybody else did the same thing.
Also, we only set prices once a day, early in the morning before the commuter rush. Changing prices while somebody is pumping gas Was Not Done, for fairly obvious reasons.
So, you'd get these ripples of price-changing, as one station changed its price, and then all its neighbors would react to that the next day, and then THEIR neighbors would change the day after that, and so on.
Answer: One factor I haven't seen mentioned is volume.  Suppliers will charge a slightly lower price to the station if they buy in full tanker truck loads instead of smaller quantities.  Where I am this is probably still the largest factor in price spread with all newer bigger stations being 20-30 cents cheaper than the old small ones (often a repair shop with 2 pumps out front); the only reason it's slowly becoming less pronounced is that the old small stations are steadily closing up as their tanks fail leak inspections because they don't sell enough gas to justify repair and replacement.
Answer: Some of this is demand management.
The local BJ's wholesale club sells gas $0.10-0.15/gallon less than the prevailing rate. Typically there are lines of 3-5 cars waiting for a pump during busy periods. People are price-conscious when buying gas, which draws crowds and the retailer actually wants a line -- the whole point of the gas station is to draw traffic to the warehouse club.
Other gas stations have the opposite problem -- big crowds lead to fewer people buying food and drinks in the convenience store, which is where the business actually makes its money. They want a steady stream of people. In my area, there is a gas station that is on a busy intersection right off the highway ramp going to the airport. Their problem is that people returning rental cars used to swarm the gas station and cause traffic tie-ups on the road -- a problem averted by marking up the gas $0.30.
Answer: I'll echo: many factors.
Brand: There are generally two levels of pricing: "major brand" and "discount brand". You can generally expect the "discount brand" to cost about 5-10 cents less per gallon in the same neighborhood as "major brand" gas. This is for a number of sub-factors; chief among them is that not all gasolines are created equal. A lot of the major brands (Shell, Texaco, Chevron, BP, Exxon) have proprietary detergents and cleaning agents that the discount brands do not. They're also generally closer to the real octane rating of the gas, have less ethanol (you'll see the sign that says "contains up to 10% ethanol"; the bargain brands are right up at that limit while the top-tier brands keep it lower) and have stricter requirements about storage tank maintenance. Anyone who tells you that all gas is the same, send em my way; I tried to save a few bux buying the cheaper stuff and now my car needs an engine overhaul because of fouling causing premature wear. A couple of my co-workers got a fuel system overhaul free from the local supermarket because the storage tank wasn't properly purged, and they got water into their gas tanks.
Market Price: Yes, this is of course a factor. Generally, gas prices at the pump rise very quickly when the market price of crude or gasoline goes up, then fall more slowly than the market price, because the margins on gas sales for a C-store are very slim. When prices change, the C-stores lose either way; when prices rise they have to pay more than they got from the last tankful to buy the next one, and when prices fall they don't recoup the cost of their current tank. By quickly increasing the price to match commodities market prices, then gradually lowering them over time even if the market collapses, they mitigate the losses both ways.
Overhead: A gas station right next to a highway probably had to pay more for that land, both to buy/lease it and in property taxes. Nicer (newer, cleaner) stations generally have to pay more to stay that way. The higher your operating costs, the more you'll have to charge for your gas. You can usually do so because the nicer station will attract customers willing to pay a few cents more for the nicer facilities.
Taxation: Most States charge a tax on gasoline, in addition to a Federal tax on gas. That revenue either goes into the State's general fund, or is earmarked for transportation costs like road maintenance. California's gas prices are sky-high across the state, because they have the highest gas tax. I'm not sure Colorado, Wyoming and Montana have gas taxes at all.
Proximity to other stations: No matter what you have to pay for the land and facilities, if there's another station across the street, you have to be within a penny of their price or people will vote with their feet. While "predatory pricing" (taking a loss on sales in one area, buffered by profits elsewhere, in order to drive out competition) is technically illegal, you see it all the time in the C-store industry and it is very difficult to prove. This is a primary cause of neighborhood-to-neighborhood changes; a C-store will look around the other stations on their street corner, and the ones down the road a block or two each direction, when determining what they can sell gas for that day. The guy five blocks down has a completely different pool of competing stations.
Population Distribution: With a lot of people in a particular area, there's a big "pie" of customer dollars for C-stores to compete for. This generally leads to increased prices because the stations don't have to be AS cutthroat; regardless of how good your price is, you have only so many pumps, and at some point people will pay more to use the open pump than wait for the cheaper one. The reverse is true in rural areas; with only two stations in an entire small town, those two stations will become extremely cutthroat. However, rural prices also vary more; with only one station in easy walking distance from where you ran out of gas, they can charge you $6 to fill that gallon gas can if they want, and you'll pay it because the next gas station's another 20 miles down the road and probably has even higher prices. This, along with overhead, is generally why the Rockies states have the lowest average prices; land's cheap and people are scarce in Wyoming. But, the "price-gouging" can be seen in the rural Southwest, where there's a LOT of ground to cover between gas stations, and so the "last chance gas" along major highways just outside of town, each a nickel to a dime more than the previous station, is a common stereotype.
Transportation costs: Prices are higher on the East and West Coasts than in the Gulf States for a very simple reason; the bulk of the U.S. refinery capacity is along the Gulf Coast between Galveston and the Florida border. The further you are from there, the more it costs to get the fuel from the refinery to the gas station, and that cost is reflected at the pump. In fact, the East Coast imports gasoline by tanker even though the United States is now a net exporter of gasoline, because it's cheaper to buy it from foreign sources than it would be to watch it drip through the limited pipeline capacity that exists between the Gulf states and the Eastern Seaboard.


Identifying insect of old egg pod

Question: Can anyone tell me what insect this old egg pod would belong to? Found it in cavity of exterior wall, want to see if I should investigate further
Comment: I'm voting to close this question as off-topic because we are not entomologists on this Stack!
Comment: Off topic? I'm not asking for its Latin name, just generic type: termite, carpenter ant, wasp, etc. I'm only asking so I can know if it's a potential hazard to the house (wood damage).
Answer: Looks to me like a  mud dauber wasp nest, not egg pod. Mostly harmless to your house, though the nest may trap a bit of moisture; you could knock the nests off during the winter if so inclined, or when they'te no longer occupied. Mostly harmless to the occupants too; these are fairly polite wasps.
Answer: I think it is on topic as the OP said worried about dammage. If you are in the U.S. most counties have an extension office or extension service office. (That's what they call it here anyway). I have taken both plants & critters I could not identify. The plant turned out to be a poisonous broad leaf plant (they came out and killed the plants for free). The bug was a type of boring beetle not native to this area and they came out and put up a bunch of traps in the area that I found it in and arround the neighborhood, again for free. I recieved a letter about 6 months later saying the beetle could not survive our winters and they had identifyed the truck it came in on from Mexico.

Identifying insect of old egg pod


Change sound depth in windows 7

Question: I remember Windows XP having some default sound settings like "Auditorium" that will change the sound depth, add echo etc. How to achieve this in Windows 7?
Basically, I wanted to add some depth to the sound when using headphones.
Comment: I'm pretty sure that was a function of the software associated with your sound card, and not part of Windows XP.
Comment: +1 agreed, this is a function of the OEM utilities that come with the hardware and not Windows XP itself
Answer: As mentioned in comments, this was a function of your previous sound card, and not something built into XP.
That said, you may be able to enable similar effects in Windows 7 if the drivers for your sound card provide them.
Go to "Sound" in the Control Panel (easiest way is to search for it in the start menu).  Click on the entry for "Headphones" (some sound cards won't provide separate settings for headphones, so you may have to select "Speakers").  Click "Properties".  If you have an "Enhancements" tab, then your driver supports changing the sound in various ways (it will depend on the driver what options you get).
Example:

Change sound depth in windows 7


Regarding CTS Error

Question: How to kill a running CTS instance.Suppose one CTS instance is running
on a terminal and if we abruptly close that terminal, that CTS
instance will not be closed and when we try to start CTS again in a
fresh terminal,we get this error[CTS_ERROR >>> Error: CTS is being
used at the moment. No more than one CTS instance is allowed
simultaneously] so how to go to CTS Host this time or kill this
running instance.
Answer: type command: ps -al -> it will show all running instances, and select appropriate running instance id (a integere value) like adb instance and kill that instance with following command: kill -9 id(integer value)

Regarding CTS Error


Does the MySQLdb module support prepared statements?

Question: Does MySQLdb support server-side prepared statements? I can't figure this out from its manual.
Answer: Check the MySQLdb Package Comments:

"Parameterization" is done in MySQLdb by escaping strings and then blindly interpolating them into the query, instead of using the MYSQL_STMT API. As a result unicode strings have to go through two intermediate representations (encoded string, escaped encoded string) before they're received by the database.

So the answer is: No, it doesn't.
Answer: It has some kind of parameterization, yes.
Even then, I advise you switch to oursql. It brings a lot of advantages over MySQLdb:

oursql has real parameterization.
oursql allows text or binary data to be streamed into the database and streamed out of the database, instead of requiring everything to be buffered in the client.
oursql can both insert rows lazily and fetch rows lazily.
oursql has unicode support on by default.
oursql supports python 2.4 through 2.7 without any deprecation warnings on 2.6+ (see PEP 218) and without completely failing on 2.7 (see PEP 328).
oursql is licensed under the BSD license.
Comment: oursql is a dead project - https://launchpad.net/oursql redirects to https://github.com/python-oursql/oursql with last commit in 2016


Bodies missing from bones?

Question: I have a model that has an armature but the bodies of the bones are missing and there are just these points in space where the tails and heads are supposed to be and these dotted lines between them. If I move the points the rig moves but only that point instead of moving the knee and ankle like other skeletons I made.

Is there a way to create or replicate the bodies of the bones so that they interact with each other correctly and not scrunch up the model? Extruding from an existing bone has a body and works how I expect. I also am self-taught so any links to documentation will be very helpful.
Comment: I guess these blue dots are custom shapes given to these bones. Plus it looks like they don't act the way you want. So maybe delete them and recreate a more classical armature on this part of your character?
Answer: This sometimes happens when importing rigs from other software.
For the bone shapes, simply select all the bones in pose mode, go in Property Editor → Bone Tab → Viewport Display panel. Hold the ⎇ Alt key while pressing the cross icon to delete the custom object from the entire selection:

Then switch to edit mode, and open the Relations Panel. Still with every bone selected, hold the ⎇ Alt key and check the Connected option. Now all your bones having a parent is forced to stay connected with it. Which means you can't move a bone off his parent, and so the bones' heads are on their parent's tail.

Bodies missing from bones?


For how many days Govt of India keep travelers under observation who have transit in Singapore and travelling from Australia to India via singapore?

Question: For how many days Govt of India keep travelers under observation in airport in India who have transit in Singapore and travelling from Australia to India via Singapore ?
Answer: They don't. Per IATA, as of March 5th, measures for travellers from Singapore are limited to medical screening on arrival:

Passengers arriving from China (People's Rep.), Hong Kong (SAR China), Indonesia, Iran, Italy, Japan, Kore (Rep.), Macao (SAR China), Malaysia, Nepal, Singapore, Thailand or Viet Nam must go thorough medical screening upon arrival.

Source: https://www.iatatravelcentre.com/international-travel-document-news/1580226297.htm
...and this is obviously subject to change at any time, although Singapore seems to have things pretty well under control.
Answer: I have been to India from Singapore recently. They won't isolate or quarantine healthy travelers without symptoms from Singapore. This is the process they follow.

As soon as you depart from the plane, from the Jetway itself, you will be given a form.
Fill the form with details including your flight number, seat number, address, phone, email and so on.
A security personal will screen each passenger for fever using a non-contact IR thermometer.
Another person will stamp the form and advice you to avoid crowded places.
You have to walk through a separate immigration counter.

If you have a fever, you will be isolated and medical personal will take over.
Note: India is tightening the process, more restrictions can be placed in future.


What starts the conversion between GPE and KE?

Question: When researching GPE and KE conversion, lots of websites say that as an object with GPE (Gravitational Potential Energy) falls, that GPE is converted into KE (Kinetic Energy), so there is less GPE and more KE. The problem I have with this principle is, what starts the conversion, because all the websites say "When the object falls", but there needs to be KE for it to fall, but for there to be KE, the object needs to convert that GPE into KE, which means the object needs KE to fall etc, etc.
Comment: While anything that already *moves* has kinetic energy, it is not true that objects need kinetic energy to *start* moving - it is perfectly acceptable to have vanishing velocity but non-vanishing acceleration.
Comment: @ACuriousMind So basically, the object with GPE will start moving as long as there is nothing with equal or a larger force going against it. If I'm understanding you correctly.
Answer: The answer was in fact covered by the Curious Mind, but for you to see the process how the potential energy transforms into kinetic, here is an elementary elaboration.
The equation of motion in the gravitation field says that
$ \ (1) \ h_0 - h = \int _0^t v(t) \ \text d t $
Multiplying this equation by $mg$ which is constant
$ \ (2) \ E_P(0) - E_{P}(t) = m \int _0^t g \ v(t) \text d t $
Since $g = \text d v(t)/ \text d t$ we can write the expression under the integral in a more convenient way
$ \ (3) \ E_P(0) - E_P(t) = m \int _0^{v(t)} v(t) \text d v(t), $
where the lower integration limit is zero because the object starts from velocity zero. So, we get
$ \ (4) \ E_P(0) - E_P(t) = \frac {m v(t)^2}{2} - 0 = E_K(t).$
At $t = 0$ on the LHS you have zero, s.t. no kinetic energy on the RHS. As the LHS increases, the RHS will also increase.
Answer: Writing down the relation between KE and PE and taking the time derivative yields:
$$\frac{m\dot{z}^2}{2} - mgz = 0 \Rightarrow$$
$$m\dot{z}\ddot{z} - mg\dot{z} = 0$$
If we assume $\dot{z}$ is non-zero, we conclude that $\dot{z} = g$. However, if $\dot{z}$ is truly zero, this equation says absolutely nothing about what the body should do. Indeed, a totally stationary body (that is not accelerating) in a gravitational field would not violate energy conservation. However in this case we just have to apply common sense to argue that classical physics is continuous and insert the $g$ manually (or just take the limit).
Answer: An object at rest will start moving whenever there is acceleration. And there is acceleration whenever there is non-zero net force, according to
$$\sum \vec F=m \vec a$$
As @ACuriousMind mentions in the comments, kinetic energy is a "result" of velocity, but velocity is not caused by kinetic energy.
When you (in the comments to the question) say

as long as there is nothing with equal or a larger force going against it

then remember that if there is something "with equal force against it" then the net force will be zero. If there is something "with larger force against it", then there will be acceleration since the net force is non-zero. But acceleration might be upwards (could be a strong wind blowing the falling object up preventing it from falling).
Answer: Your statement "but there needs to be KE for it to fall" is wrong. What it need is a force in that direction to fall. That force on it comes from the negative of the gradient(change with respect to distance in the maximum increase direction) of potential energy which is always present as long as the potential energy is changing with distance.


Backup iPhone contacts etc to move to new iPhone

Question: I'm going to replace my iPhone 5c with another new one. What should I do to keep my contacts, events, notes, etc. and then restore it on the new iPhone? Should I just backup my phone with iTunes or something else?
Comment: Which account are these Contacts, Notes, Events (I guess you mean Reminders)??? because if they're on iCloud then there's no need to do anything.
Comment: @PinchusGelbman Unfortunately the problem is wider. Could you please take a look? http://apple.stackexchange.com/questions/246879/backup-iphone-contacts-etc-to-move-to-new-iphone-no-icloud
Comment: please explain more detailed about what makes the problem wider as you didn't yet answer my first question
Comment: @PinchusGelbman I explained the problem in my another question (the link provided above)
Answer: iCloud is your most hassle-free bet. On your 5s, go to Settings > iCloud. You'll find the following settings.
• iCloud Drive: Any apps turned on here may store content in iCloud without the use of iCloud Backup. This means when you get your new phone, you can set it up as new and still have access to the same content if you redownload the apps.
• Photos: This one's a bit trickier. You have switches for both iCloud Photo Library and iCloud Photo Stream. These are two separate things and the only reason to have both on at the same time is if you have devices on both iOS 8 or later and devices prior to iOS 8.
iCloud Photo Stream is available starting with iOS 6 (I believe) and only stores your most recent 1000 photos. It does not keep track of which photos are in what albums, does not keep track of edits, and when you get your new iPhone it will only download the most recent few hundred. iCloud Photo Stream does not take up your allotted iCloud storage space, which is 5GB if you're not paying monthly for more.
If you're willing to take up more of your allotted space, assuming you have enough, iCloud Photo Library is a better option available on iOS 8 and later. It has no limit on how many photos it can hold, also stores videos, keeps track of edits and albums, and allows your new phone to get all of the same content with no limits.
• Mail: Stores emails from any iCloud email accounts. If the accounts are not email, you will likely still be able to get your stuff on the new phone when you sign in again.
• Contacts, Calendars, Reminders, Notes: Stores the associated app's content without the need for a backup.
• Safari: Stores bookmarks, reading list, history, iCloud Tabs, etc.
• News: Stores information on what you've subscribed to and liked/disliked.
• Wallet: Stores passes, cards, etc.
• Keychain: Securely stores your saved passwords from websites and apps to the cloud.
• Backup: Everything above will work seamlessly without needing a backup, and when you get your new phone you can just "Set Up as New" and it's all automatic. If there is some stuff you want to keep not covered above though, such as an app not supporting iCloud Drive, you can turn on backup and in Settings > iCloud > Storage > Manage Storage > your backup you can choose which apps specifically you want backed up. If that app is already turned on in a step above, it probably doesn't need turned on in Backup.
If you use Pages, Numbers, or Keynote make sure Use iCloud is turned on in Settings > Pages, Settings > Numbers, and Settings > Keynote.
If you're using Backup, when you get your new phone you'll need to do "Restore from iCloud Backup" instead of setting up as new.
• If you don't have enough iCloud space, you can always experiment with other clouds like Dropbox, but iCloud is the most seamless. There's also iTunes Backup like you mentioned which is easy but not quite as seamless.
Comment: Thank you for the detailed answer. It is completely clear.
Comment: Unfortunately the problem is wider. Could you please take a look? http://apple.stackexchange.com/questions/246879/backup-iphone-contacts-etc-to-move-to-new-iphone-no-icloud


Where can I find the 'Terminator Truck Chase' game mode?

Question: In this video. Alternatively, how can you make a similar game mode (one team needs to get to x, other team tries to kill them)?
Answer: It's just one of the many gamemodes in GTA V. I'm not sure where they are located on the map, but you can easily access them with your phone. It's called "Hasta La Vista", which actually is mentioned in the description of the video.


Trying to put a guide layer within a mask

Question: I'm doing an animation with a planet revolving around an object. I used a guide layer to create the animation so that the planet goes along the ellipse. In order for the planet to go behind the object, I of course need a mask. But it seems that I can only use either a guide layer or mask layer for an object, not both. I tried Googling the issue; it's coming up dry.
Answer: Instead of using the mask, you could duplicate the object the planet is orbiting around on a different layer. Put one layer above and one layer below the planet in the stacking order and then use opacity to switch between them.
Answer: I don't know why I didn't think of this before. I put the animation of the planet and the guide in its own symbol. Then, I applied the mask to the symbol.


What are some tricks you can use to write a good story if you don't know how people talk and behave?

Question: What are some tricks you can use to write a good story if you don't know how people talk and behave? Are there some tips and tricks on how to be able to still write a good story if you try to avoid making your characters talk as much as possible to not show how clueless you are about how normal people react in certain situations? It feels like if you put your characters in tense situations and you're clueless about what's normal behaviour, it just invariably make the story worse.
Comment: **Plotting** makes the story impact the characters. People behave differently in different circumstances and under different stresses. Modern stories follow a conflict arc, beginning when characters don't know there is a conflict (their normal state), then experiencing an escalating conflict until they are forced to react and deal with it…. Abstract your character problem into a *conflict* with a beginning, middle, and resolution. **Plotting will help you connect the dots.** Characters change because their circumstances change. (Talk doesn't change anything, it just reveals character biases)
Comment: You could always populate your story with aliens. No one knows how they talk and behave.
Answer: There are no normal people. Everyone's going to react differently, so it's your choice what they do.
But for tips, think what you would do. In fact, that's how I almost always write, basing nearly all my characters off of people I know or myself. If you don't know how they would act, ask them!
Answer: A few basic tricks:

think about your story arc
think about the specific scene
get to know your characters

think about your story arc
This is perhaps the first thing to do. Ask yourself:

What is the starting point, what is the end point?

Without a story arc in mind you're doing a wild form of exploration writing, which given your question would seem to be highly discouraged.
think about the specific scene you are trying to craft
While you are writing, it is always a good idea to ask yourself three questions:

What is the goal of this scene?
What should the reader feel about this scene?
How does this scene progress the story arc?

get to know your characters.
Before you start writing your story, place each of your characters in various situations and craft their actions in a manner that is coherent and consequential to how you imagine them. These scenarios may have nothing to do with your story, that is you could imagine them going to the local mall, or out for fine dining, or blasting an asteroid that is about to hit their home planet.
Characters do not need to feel real, but they need to feel consequential and coherent. A reader can follow the Joker despite him being way larger than life because the Joker's behaviour is coherent with what is expected of him. The same goes for the alien in Alien, or Sauron.
While it may help to craft certain stories in certain genres, in the bigger picture knowing how people talk and behave is irrelevant: you just really need coherence.


Are JAD decompiled files 100% accurate

Question: Are JAD decompiled files 100% accurate. I am decompiling some jar files to get the source code and when i am trying to build the project with these java files it is not showing the accurate build. Does i am doing it wrong or the decompiled files are not accurately same as the original one.
Comment: The source file could be obfuscated. Anyway try using jd-gui
Comment: Bytecode for while() {} and for() {} is not clearly distinguishable, the decompiler may replace one for the other (semantics stay the same). Some bytecode is impossible to decompile properly to java (e.g. generated code, code generated by other VM-based languages compilers).
Comment: no, there is no comments, local variable names (if you don't have debug), original line numbers,  original compile time constants, original formatting etc.  These are all because they are not in the byte code.
Comment: In addition compiler generates helper methods to make inner classes work ([see this](http://stackoverflow.com/a/663147/5128464))
Answer: Short answer: 99% of the time, decompiled code will not look like the original code, but it should behave the same way. So, assuming the decompiler doesn't make any mistakes, it should be accurate in function, but not in implementation.
Long answer: When the Java compiler translates your source to byte code, it performs certain operations that change how to code looks. I am not an expert on the details of the Java compiler, but A simple optimisation that many compilers perform is inserting small methods into the location in code where they are called.
For example, lets say we compile this code:
public class c
{
   public int add(int a, int b)
   {
      return a + b;
   }

   public static void main(String [] args)
   {
      int i = add(1, 2);
   }
}

Since b is only one line, and it can safely be substituted with it's contents, a smart compiler may change the main method into this:
public static void main(String [] args)
{
   int a = 1, b = 2
   int i = a + b;
}

or this:
public static void main(String [] args)
{
   int i = 1 + 2;
}

This would be done because the overhead for calling a method is worse than the overhead of putting the method's contents directly into the place it's called.
I have no idea what the Java compiler would do in this situation, but it does make changes to the code like this. It isn't necessarily inaccurate, because it does do the same thing as the original code. Since the compiler doesn't leave the details of these changes anywhere in the .class file, there is no way for a decompiler to know whether an optimisation was performed at any given point in the code, of if it was written that way.
There are also a number of other things that may not survive the transition to byte code (variable names and comments, for instance).
So yes, when you look at decompiled code, you are looking at what the .class file looks like, rather than what the .java file looks like. Even though it seems inaccurate, it should run the same.
Comment: The Java compiler itself will **not** perform inlining in the way that you described. It could *theoretically* do this if the method was `private`, but even then, it will not do such a change, because it has to preserve the structure of the class (for example, for the case that the method is accessed via reflection). Inlining is done by the JIT.
Comment: The most common differences you'll see will be subtle changes in branching, e.g., you might see `while(a) { if (!b) f(); }` where the author had originally written `while(a) { if (b) continue; f(); }` or `a = b ? c : d` where the author had written `if (b) a = c; else a = d;`. You may see more intermediate variables introduced, and some values inlined. But you should **never** assume that the decompiled output is functionally equivalent to the original code. It is intended to be, but decompilers are not infallible.
Comment: Yeah, I haven't studied the Java compiler closely, so I wasn't exactly sure what to use as an example. I decided on that one because it was easy to explain, and it gets the point across that changes are made to the structure of the code, even if it isn't as applicable to Java as it may be for other platforms. If someone who knows more about Java compilers has a better example, I would be happy to add it (or change my answer to a community wiki).
Comment: @MikeStrobel I've changed my answer to a community wiki, as you guys have proven I don't know quite enough about Java compilers to write a good answer. Feel free to improve it.

Are JAD decompiled files 100% accurate


Will using a 1:50 cycloidal drive on a 10,000 RPM brushless motor actually spin the output shaft at 200 RPM with 50x the torque of the motor?

Question: In short, I'm trying to build a high-torque and high-RPM robotic arm, and I think brushless motors are the best compromise. The motors I'm considering are 400KV, and are supposed to run on 6S. Are there any glaring errors with my idea?
Answer: Almost...
You will have some losses in torque due to fiction and the elastic deformation needed for the cycloidal drive.
Your math, other then losses, is fine, but you have to consider also the technological parameters. You have to make sure that the gearbox supports 10.000 rpm (it might overheat if it was designed as a lower speed gearbox) and that it is rated for the torque input and output (the internal components and gears might get damaged if you are over the rated torque). Furthermore, there is more to a gearbox, then just axial load and rpm. You have to make sure that the radial loads on the gearbox are also in spec, otherwise you might snap the shaft off or damage the bearings.
As far as I know, current large scale industrial robots, use even higher gearbox ratios.
Comment: Awesome, thank you! I'll be designing my own cycloidal drive, do you think phosphor bronze, which has a low coefficient of friction, will work well for this drive? Thanks!
Comment: No idea, that is not a robotics question
Answer: You need to consider both the max rated input speed of the drive (as another answer suggests) as well as the rated torque of the cycloidal drive.
The rated torque is the torque at which the drive can operate for some number of input cycles - typically 1 billion.  Reducers (aka gearboxes or drives or transmissions) also have peak and max input torque ratings as well.
The speed may be the killer here, though.  If you check out the specs of the Nabtesco RV-N series, for example, the allowable output speed is only 100 rpm or so (i.e. 5000 rpm input).
10000 rpm is really high, I think.  Speeds of 1000 rpm or less are more typical I believe.


Using both a firewall and vpn on android

Question: Is there a way to use both a firewall and a vpn app on android. I have tried allowing the vpn through the firewall but one invaraibly goes off when I start the other. Is there some way around this -- to establish two tunnels at the same time.
Comment: You would also need to clarify what kind of firewall you are using. A VPN-based "no-root" one, or one that requires root like AFWall+.
Answer: The firewall not stablish a tunnel, this only open or close ports, you can use but you need not close ports of VPN and maybe network of VPN can use other proxy if for example is you home network and you use firewall on your home router. You can use firewall and VPN, both, but is important that firewall not close ports of your VPN.
Comment: FYI: Lots of Android "firewalls" are actually a VPN routing the requests.
Comment: but they don't provide the encryption. Is there any way to establish a tunnel within a tunnel. Or do you know any firewalls that also encrypt.
Answer: No, is isn't possible on Android to do this. But I would suggest setting up your firewall policy on the other endpoint of the VPN tunnel (the remote end) which will have the same effect as a local firewall policy.
I suspect you use the VPN to tunnel home? In your VPN router or home firewall that you tunnel to, there you can put rules which traffic are allowed to exit from VPN interface to internet.
Comment: I need a local firewall policy. Are you sure it wouldn't be possible even with a custom android rom


How to configure Apache2 to download files directly?

Question: :-)
I have a server running Ubuntu Server 14.04, and I have the apache2 webserver running on it. I would like to have a personal website for me and a few friends to host a few files. I created the website and all is running smoothly. To test file hosting, I created a "test.txt" file in the /var/www/html directory and created a link on the page to the file. In the file, I had this string:
This is a test file.

When I click the link in my browser on my computer, however, instead of the file downloading, the string "This is a test file." appears in my browser. Tested on multiple browsers. Any suggestions? I am very new to website hosting... is there something I forgot? Thanks in advance.
-Ryan
Answer: You can force it to be downloaded by making Apache report it's content type to be application/octet-stream, instead of the usual text/html. This is not something I would recommend doing to .txt files. In your .htaccess  (or other Apache configuration files) add:
AddType application/octect-stream .txt

Another approach is to use ForceType within a Files or a Directory block, as outlined in this SO answer:

<Files *.mp4>
  ForceType application/octet-stream
  Header set Content-Disposition attachment
</Files>

The advantage is that the matching criterion for a Files block is more flexible than that of a plain AddType.
Answer: A text file can be read by apache and will be read and displayed by it, you can still save the file with the browser, though.
Try again, with another ending like text.zip. Doesn't even need to be a real zip, changing the ending will change the behaviour.
On a personal note: Make sure to secure your server with .htaccess and a user/password combination if these files are not for the public!
Answer: if you need to push file that is simple text down to client in the browser you'll have to use something like php and create some for ex. index.php file in root: /var/www/html directory and add something like this:
<?php
$file = 'test.txt';

if (file_exists($file)) {
    header('Content-Description: File Transfer');
    header('Content-Type: application/octet-stream');
    header('Content-Disposition: attachment; filename='.basename($file));
    header('Expires: 0');
    header('Cache-Control: must-revalidate');
    header('Pragma: public');
    header('Content-Length: ' . filesize($file));
    readfile($file);
    exit;
}
?>

I'm afraind that you'll have to install php on your apache first to be able to use the code for that..
I google-ed it and it's something like this -> sudo apt-get install php5
Good luck, and let me know if it worked..
k


Angular diameter of a relativistically expanding star?

Question: I was curious about how relativity might affect how our eyes perceive an expanding star. With regard to the angular diameter, my current understanding is as follows: from an inertial frame's perspective, the top and bottom of a sphere are moving perpendicularly, and hence the angular diameter's rate of change is determined by the velocity transformation in the perpendicular direction. However, light rays enter our eyes at an angle. Will this affect our eyes' perceptions of the angular diameter? Similarly, how will this affect our perception of the star's shape? Please help me clear my doubts, thank you!
Comment: Can you be clearer. Are you viewing the star from some distance where it would have an appreciable angular diameter? Are you considering a hypothetical star/sphere with a surface expanding at relativistic speeds?
Comment: Hello, it was more of a thought experiment for me, but I guess if were to put numbers into it, the star is a relativistically expanding sphere with radius increasing at speed v, and an observer who is a distance L>>R away?
Answer: This problem appears to be treated nicely by Rees (1966) in the context of an expanding spherical source at the centre of an active galactic nucleus.
I reproduce the main figure from this paper below. It shows the apparent surface of the expanding object (S, in this case a star) as viewed by a distant observer O. i.e This is the locus from which an observer would see the emitted light at some instant of the observer's time. The visible part of the star is marked in bold on the diagram.

The key points are that the apparent surface (which obviously can't all be "seen" by the observer) is distorted into a spheroid with the centre of the star at one focus. The angular size of the source is given by the visible diameter of $2\gamma v t$, where $\gamma$ is the usual Lorentz factor, divided by the distance to the observer. The surface moving at angles between $\pi/2$ and $\cos^{-1} (v/c)$ to the observer is actually not visible.
So at any given time, the relativistically expanding star appears bigger (in terms of angular extent) than a non-relativistic treatment by a factor of $\gamma$.
That means that if $v > c/\gamma$ (which equates to $v > c/\sqrt{2}$), that the motion can appear superluminal. This is a well known phenomenon seen in rapidly expanding shells or jets from astronomical sources.
Comment: Hello, thank you for the amazing reference and answer. A few clarifications I'd like to make: firstly, the ellipsoid was immediately quoted to have eccentricity \beta and semi-latus-rectum vt. I can intuitively understand S being the focus, but where do the other values come from? Is this from applying velocity transformations for a general point in the sphere? My second question is, why does the diameter increase, and not decrease, by a factor of \gamma, the Lorentz transforms for the perpendicular direction would result in the factor being in the denominator?


Type of thermodynamic process

Question: This is a doubt on question 5.13 from the 5th Chapter of the book Heat and Thermodynamics by Zemansky and Dittman. The question says we have a cylinder with a movable piston, on either side of which we have a monoatomic ideal gas. It is given that heat is supplied slowly to the left side, due to which the nonconducting piston expands. My doubt is not about the calculations, I am just not able to understand what thermodynamic process takes place on the left side. On the right side, we see there is no addition or loss of heat, so it's an adiabatic process, but what about the left side? I am guessing it is an isothermal process due to slow heat addition, is it correct?
Comment: Slow heat addition doesn't imply an isothermal process. Just because the temperature is uniform doesn't mean it's constant.
Answer: There is no reason the process on the left should be isothermal. It is a quasi-static (if slow enough) heating process. The presence of an ideal gas implies that the temperature will increase (the ideal gas has no phase transition). Thermodynamic processes are not limited to isothermal and adiabatic transformations.
Answer: I checked my copy of Zemansky. You left out a couple of important points. One is not just the piston is non conducting, but also the cylinder which, with the exception of one end cap where heat can be added, is thermally insulated. The second is the piston is frictionless which, together with the process being carried out slowly (quasi-statically) means both the expansion on the left and the compression on the right is reversible.
In any case the reversible expansion process on the left side can't be isothermal. A reversible isothermal expansion requires the external pressure be slowly reduced such that, on the left side, $PV=$constant. Here the external pressure is that on the right side of the piston, which increases from 1 Atm to 7.9 Atm during the compression, not decreases.
But to answer the questions you don't need to know the process on the left side since the process on the right side is a reversible adiabatic compression. There is an equation for that process and the work done by that process. By combining the ideal gas law and the equation for a reversible adiabatic process, together with the given initial and final conditions, you should be able to answer all the questions.
Hope this helps.
Comment: Thanks for the reply. But we are also asked to find the final temperature on the left side right? To do that, should I assume that pressure on both sides is equal(in this case, 7.59 atm) due to equilibrium so that I can apply the ideal gas law?
Comment: Yes. The pressure on both sides has to be equal at all times in order for the processes to be reversible
Comment: Ok, now it's clear!
Comment: So my answer is acceptable to you?
Comment: Yes, it is acceptable, makes sense now.
Comment: I only ask because you've not formally accepted my answer, which would be appreciated

Type of thermodynamic process