The Michelson-Morley experiment

Question: A fundamental assumption in special relativity is that the speed of light is constant in all inertial reference frames, which was first established empirically via the Michelson-Morley experiment. From a general relativistic perspective, we would say that the speed of light is constant in the absence of a gravitational field. Now, since the Michelson-Morley experiment was carried out in the presence of Earth's gravitational field, wouldn't their findings of the constancy of the speed of light then contradict the fact that general relativity implies that the speed of light is in fact not constant in the presence of the gravitational field?
Comment: I am suggesting that the force of gravity on the surface of the earth does not change.
Comment: I believe that the entire Michelson Morley experiment was carried out on the surface of the earth.
Comment: Are you suggesting there's no gravitational field on the surface of the Earth?
Comment: Related: http://physics.stackexchange.com/q/59502/2451 , http://physics.stackexchange.com/q/133482/2451 and links therein.
Answer: The speed of light is always locally the same i.e. $c$. The term locally means that any observer measuring the speed of light at their localtion will always get the result $c$ - just as Michelson and Morley did.
You are correct to say that the speed of light is changed by a gravitational field, but this means that an observer measuring the speed of light at some distant location in a gravitational field will get a value that differs from $c$.
For more on this see Does gravity slow the speed that light travels?, or a search will find you many other related questions.
Comment: @dezign: yes. In GR the term *local* means the region around the observer where spacetime looks approximately flat. On the surface of the Earth the spacetime curvature is small, so the size of the *local* region is actually quite large for most measurements. However really accurate measurements can detect the curvature over even small distances. For example atomic clocks can detect a difference in the elapsed time over vertical distances as small as a metre. Needless to say the MM experiment was nowhere near that accurate.
Comment: Is this because the observer measuring the speed of light at their location is making the measurement over small distances, so that the curvature of spacetime due to a gravitational field is negligible?
Answer: Your statement is not precise enough.  It should read "general relativity implies that the speed of light is not constant when the observer is in a different place in the gravitational potential than the light is".  Also, Michelson-Morley does not measure the value of $c$.  The experiment only determines that the speed of light is constant in inertial frames related by a velocity boost.
If you are in free fall in the Earth's gravitational field (or being weakly accelerated by the Earth pushing on your feet), there is a locally Lorentz frame around you in which you will measure, using your meter stick and clock that you are carrying, the standard value $c$ for the speed of light as it passes near you.
However, an observer somewhere else in the gravitational potential, say far from the Earth, will see a different value of the speed of the light that is passing by you.  He will use his own meter stick and clock to conclude the speed of light is slower than the standard $c$ as it passes you.  He will also conclude that your meter stick is squashed, and the time between ticks of your clock expanded.  The observer will conclude that you did your division correctly (number of squashed meters)/(number of expanded ticks)=$c$ (standard value), but using his own meter stick and clock he measures $<c$ .
You are standing beside the Michelson-Morley interferometer on the Earth, the fringes don't change as you rotate the arms to be along or against the flow of the supposed ether,  you conclude the speed of light is a constant no matter what velocity boost inertial frame you are in.  You don't conclude any thing about the actual value of the speed of light which you could measure by other means to be the standard $c$.  In fact, the far from Earth observer also sees the fringes do not change as the interferometer is rotated, and also concludes the speed of light (which he measures by other means to be $<c$) is independent of the velocity boost of the interferometer.

The Michelson-Morley experiment


When the blockchain upgrades the runtime, the upgraded height uses which metadata?

Question: for example
the blockchain is upgraded at 1000 height(including systems code updates event), and I need to decode the storage data by metadata at 1000 height, which metadata do I need to use,  is it the latest one? or the old metadata of 999 height?
Answer: If you do the upgrade at block 1000, aka setting the <code>:code</code> storage item, the new runtime will be used for building block 1001.
There is actually an open issue about this topic, as the block that sets the storage item isn't running potential migrations directly. So, you currently get the "wrong" metadata when querying block 1000. Substrate will already return you the metadata of the new runtime while it should return the metadata of the old runtime.
So to your question, to decode items at height 1000, you should use the metadata of height 999.


Bus to wire in quartus

Question: I sometimes run into a problem with altera's Quartus that I would like a better solution to. Sometimes I use the graphical interface for design and I have a bus that I would like to pull off just one route it to a block. Usually I create a custom block and put one wire in and multiple wires out. This seems a little excessive, is there a better way?
Answer: Just connect it up directly with a wire (you will see a little blob appear to show it is connected). Then, name the bus something like name[msb..lsb], and then name the wire name[whichbit]. That will tell Quartus to connect them because they both have the same name and tell it which bit it should connect to. You will get errors if you choose a whichbit which is less or more than the msb and lsb of the bus.
Better still, don't bother with the schematic and wire it all up in a Verilog (or VHDL) file.
Comment: I can only partially agree with the last sentence. I usually prefer code because it is easier to create, modify, maintain, share etc., but a well drawn top level block schematic is definitely something which a big project should have.
Comment: @VladimirCravero I agree with that - generally all my projects have a single top-layer schematic, but it is usually nothing more than input/output pins and a single main module.

Bus to wire in quartus


Cant access ubuntu as i overloaded my drive- ecryptfs is read only

Question: So finally after hours of reading around and listening to tons of advice I found out how to access my account and mount ecryptfs. So okay, I'm closer to my goal of deleting image.img, which is clogging up Ubuntu. Now I'm stuck with a problem. When I go to tmp/ecryptfs, and do rm sdimage.img a it says the filesystem is read only. How can I make my ecryptfs drive read/written?
Answer: ecryptfs-recover-private mounts the decrypted filesystem in read-only mode by default.  To get read-write access to your ecryptfs directory, add the read-write option as follows:
sudo ecryptfs-recover-private --rw

This is described at the end of the man page, for future reference.  Since you know the location of your path, you can save some time by adding it as follows:
sudo ecryptfs-recover-private --rw /home/.ecryptfs/thomas/.Private

If your volume is still mounted read-only, you will have to unmount your current volume before remounting:
sudo umount /tmp/ecryptfs.LImkydJ6
sudo ecryptfs-recover-private --rw /home/.ecryptfs/thomas/.Private


Missing animations

Question: I have just installed the Ubuntu 18.04.4 (actually few times already) and I still find all of the animations missing. The Ubuntu has disabled them right after install, or they disappear after a while. I have checked tweaks, it says the animations are on, but they simply are not showing. Anyway I cannot figure out how to turn them on, so if anyone could help me I would be very glad. https://drive.google.com/open?id=1TfQM7LLuda53tB7uGSenBn-10hiLXOQQ
Comment: Simply, there are no animations. No animations for opening/closing/switching desktops/opening app drawer or literally anything
Comment: I am aware of fact that there is the button "show applications". But I am talking of missing animations, like scaling the window of a program
Answer: If animations still do not work, than probably you have problems with graphics driver.
To install Nvidia driver you could use this question answers. You need to know your driver version. It could be different.
The information about it you could find in comments to this question.

Missing animations


what is the difference between .apply and .call

Question: I find myself using jQuery objects with regular js objects often; I'm trying to figure out how I can utilize .call and .apply more often in my scripts when appropriate.  I've been testing code to see how it actually works.
However when I run my code below (which essentially just hides all the divs on the page) in firebug on sites I know have jQuery I get varied results; I'm wondering if it's the version of jQuery or is this code just 'buggy' I am to decipher why .call always works but .apply doesn't thought it would be the other way around based on code below
var myApp = {} // instantiate an empty objct
myApp.hide = function (whatever) {
   that = whatever
   $(that).hide()
}
var Numbers = function (object) {
this.object = object;
}

Numbers.prototype.div = $('div');
var numbers = new Numbers();
numbers.div
myApp.hide.call(numbers, numbers.div)
myApp.hide.apply(numbers, numbers.div)

When I firebug the code above either using .call or .apply I get different result depending upon the site.  Every site that has jquery .call will work but for some sites like jQuery.com and twitter both will work using .apply and .call but other sites like New York Times and Netflix only .call works - I'm guessing it's the version of jQuery that's causing the difference but am slightly confused because numbers.div always returns an array of all div elements on the page so I would think that would work all the time.  Any explanation is appreciated as I am still grasping the concepts of .call and .apply - I always reference Douglas Crockford's book but truthfully he doesn't go into much detail about .apply and .call
Answer: .apply need you to pass the arguments as an array.
SO
myApp.hide.call(numbers, numbers.div)

should be same as
myApp.hide.apply(numbers, [numbers.div])

But, in your myApp.hide function, there is no this, so the first parameter of .call or .apply can be anything else, it doesn't matter.
Comment: .apply uses an array as the second argument and passes everything in that array as parameters to the function. .call on the other hand passes the second parameter and all parameters after that as parameters to the function.
Comment: thanks xdazz but why does it work on some sites but not others which confuses me, why does .call work at all if it returns an array - does .call still work with arrays where as .apply only works with arrays what the advantages of using one over the other
Comment: @JamesDaly No, just check the signature, `foo.call(obj, param1, param2, ...)` vs `foo.apply(obj, [param1, param2, ...])`
Comment: ahh I think I finally get it you can use multiple parameters for .call but for .apply you would just store those parameters as a js array; Didn't realize you would utilize multiple parameters for .call - Thanks again xdazz and Kevin B.  Guess I'm still slightly confused why it worked on some sites but not for other I'm sure it has to do with the version of jQuery but I get why .call works now over .apply
Answer: The Power of call / apply really lies in what Context you want this to be within the called function. For the first parameter determines what it will be. They are a good example of how in Javascript functions, it doesn't matter when/where a function is invoked, but how. (So in your instance, this would be numbers)
Both .apply() and .call() work regardless, the 2nd parameter for either of them is actually optional.
Like everyone is saying the only real difference between the two of them is whether you want to pass the arguments/parameters as an Array (numerical Array [], not an associative array {}).
.apply(contextYouWant, [oneParam, twoParam, etc]);
Or in the instance of .call(), you pass the parameters individually.
.call(contextYouWant, oneParam, twoParam, etc);


If I erase all content and settings will I lose my contacts?

Question: If I erase all content and settings will I lose my contacts?
Comment: Stack exchange doesn't work well when there are multiple questions. Please edit your post to concentrate on one issue, & provide as much detail as you can. As it stands, there is little to go on.
Comment: I've removed the second question from your question. Feel free to search for an answer to the other question.
Answer: The answer depends on where the contacts are stored.

If the contacts are stored in iCloud, you will not lose the contacts. Log in to iCloud and the contacts will be restored.
If the contacts are on your SIM card, you will not lose the contacts. You can re-import the contacts from your SIM card.
If the contacts are stored on your device, you will lose the contacts.


How to set upload limit in sharepoint 2010 for site collection?

Question: I can set upload limit for web application in SharePoint 2010. But cannot do it for specific site collection?
Answer: OOTB there is no way to control this property at site collection level. You can set it at Web Application level but not for site collection.
as a workaround, you need to write some kind of custom code to do it at site collection level. check this
another workaround is, if there are multiple site collections which need higher upload limit, you can think about creating a new webapp and move all site collection their. but this has some pros and cons.


Disclosure of info

Question: If player a inadvertently sees player B's hand as they look at their cards is either player obligated by rule to disclose this info to other players at the table?
Answer: They are not obligated to tell other players about the information that they have, but it is the right thing to do. They can keep it to themselves, but it would be kind of scummy. Most players will announce if they see a card so that everyone has the same information because that is what they would want other players to do if their card was exposed.

Disclosure of info


How to reduce swap partition

Question: How do I reduce the size of swap after accidentally enlarging it by 100GB? I imagine it would be via fdisk somehow. Do I need to delete the partition and remake it?
Comment: Are you using LVM?
Comment: @user1700494 yes
Comment: add output of `pvdisplay`, `vgdisplay`, `lvscan` to your post
Answer: Use gparted, it's easy to use! You just need to find your swap partition (/dev/sda4 on my system as you can see in the screenshot below) and then resize it.

However, unless your swap artition is the last partition on the disk, this will leave unallocated space in the middle. Depending on how your partitions are set up, you may or may not be ab;e to add that to one of the other partitions. For more details, please edit your question and show us the output of sudo parted -l or a screenshot like the one above.
You can find a step by step howto on using gparted to reassign and move unallocated space here.
Answer: As you use LVM, the easiest (and safest) way is to simply lvcreate new swap partition with size you want, mkswap and swapon it, and then  'lvremove' old oversized partition. That sequence insures you won't run out of virtual memory in  the middle of process, and leaves you just with partition of wanted size. Do not forget to update /etc/fstab.
If you're  flat out of disk space though, you will need to swapoff and lvremove first (or use temporary swap file if you do not have enough physical memory)

How to reduce swap partition


Do my publications help my department/university?

Question: I am currently a mathematics lecturer at a state university in the US. I still do research and put a lot of effort into publications, although it is not required for my position. My question is: Will my publications (in good journals) be seen as a positive by the math department and/or university overall? Do they gain any benefits from my research? Is there some baseline for number of publications that they need to meet for funding, etc?
Answer: (Although OP is in the US, the question doesn't have a "united-states" tag, so...)
In England and Wales, there's a pot of government money called "QR funding", which is allocated to universities in proportion to the quality and quantity of their faculty members' research publications, as measured in an episodic exercise called "REF".
Answer: The publications of faculty add to the reputation of a university, more specifically, to a department. But there is no direct effect. In funding for a particular project it will help if they can show productive activity in that area and your papers might be cited. Likewise having research seminars in a topic is helpful. But there aren't cutoffs or similar.
Regular faculty are in a good position for getting salary increases and/or reduced teaching loads, but this is probably less available to a lecturer. But it might give you an edge in a number of ways. It might not be possible to bypass regular procedures to hire you for a TT position, but people will look favorably upon an application. Likewise, if you work collaboratively with the tenured faculty you will be in a good position to get good letters when it is time to move on.
So, benefits: yes. Formulas: no.
Answer: One positive side-effect of your publications pertain to world university rankings.
All such higher education rankings I know of take into account the number of scholarly publications (and citations to these publications). They do so in two ways:
First, as inclusion criteria for institutes to be listed in a ranking (e.g. the THE World University Ranking demands more than 150 publications in a single year [p. 6]; or the CWTS Leiden Ranking ranks universities only if they have at least 800 publications in 2015-8 [see here]).
And secondly, publications (and citations) serve as as core performance indicators. For instance, publications weigh 20% of a journal's score in the Shanghai Ranking (according to their Ranking Methodology).
And these university rankings, in turn, have their real-life impact - as many studies show.
Comment: Getting your university from rank 1201 to 1198 does not buy you even one coffee, and helping to get into the lower fifth of such a ranking is equally worthless.


How can I use flash[:notice] across domains?

Question: I have a website that is served via HTTP with a custom domain (e.g., mywebsite.com) on Heroku.
When a user wants to login, I redirect them to my Heroku application's non-custom URL via HTTPS (using Piggyback SSL, because I am cheap and don't want to pay for SSL Endpoint).
Then, after they've logged in, I redirect the user back to my custom domain since their traffic doesn't really need to be encrypted anymore.
Only problem is that before redirecting them, I display a message (e.g., "You've successfully logged in!") using flash[:notice] (with sinatra-flash). But I believe that since the user crosses from one domain to another in this process, though still on the same server, they don't see the message since their session data from domain X is not accessible from domain Y.

Is my understanding of the problem correct?
What is the right way to fix it?

Update on 2012-10-12:
So, the solution I ended up going with is a little hacky:
First, I added a new data model, OneTimeFlash, with a token field containing a random string for each record. Then I made it so that after the user logs in on domain X, I create a new OneTimeFlash instance and redirect to domain Y with the token in the query string:
# The model automatically generates a token before being created.
one_time_flash = OneTimeFlash.create(:message => "You've successfully logged in!")
redirect "#{DOMAIN_Y}/flash/#{one_time_flash.token}"

Then when the server detects this token in the request, it displays the flash:
get "/flash/:token" do |token|
  one_time_flash = OneTimeFlash.first(:token => token)
  flash[:notice] = one_time_flash.message unless one_time_flash.nil?
  one_time_flash.destroy
  redirect "/
end

(The ORM is DataMapper, in case anyone's confused.)
Like I said: it's hacky, but it works. Can anyone think of any serious problems with this approach?
Comment: why saving things to the db just for a temp message to the user?
Comment: @RailsN00b: because I couldn't think of a better way! Can you?
Answer: you can't use flash between domains in that situation since flash is only saved for the next request.
you could use HTML5 localstorage - some random localstorage explanation or w3schools website on html5 localstorage


Whats the difference between reversible process in thermodynamics and reversible chemical reactions?

Question: We know that in thermodynamics, reversible process never occur since entropy should be conserved. However, in chemistry we do have a lot of reversed chemical reactions that forms reactants from products, previously formed by a direct reaction. So, what is the misunderstanding here?
Comment: Your first statement is not true. Overall entropy is not conserved and reversible processes do occur in thermodynamics.
Comment: Can you clarify? Are you asking about reverse reactions that happen simultaneously with the forward reaction (eg in an equilibrating system) or are you talking about converting products back to original reactants in a second process? If the latter, that second process is necessarily different from the reverse of the first process. Something must be done to make it favorable.
Comment: yes, I am talking about equilibrium
Comment: @porphyrin according to this answer and other sources, all real process are irreversible
https://physics.stackexchange.com/questions/111071/do-reversible-processes-exist-in-nature
Answer: There is no misunderstanding at all.
The second law of thermodynamics can be roughly expressed as: in a given process the entropy of the universe will always increase (defining universe as system + surroundings).
Reversible processes
For reversible processes the entropy of the universe remains constant. Most natural occurring processes are irreversibles.
A reversible process is a process where you can change its direction by inducing infinitesimal changes to the system. Throughout the entire process the system is at equilibrium, so from one state A to a state B you will not observe macroscopic changes.
The system goes from state A to state B in the following way: A + dA = B where B is infinitesimally different from A. These changes are applied over properties of the system like temperature and pressure by modifying its surroundings.
Reversible chemical reaction
In the case of a reversible chemical reaction it means that if you combine the products of that reaction you'll obtain at least some of the reactants again. Usually these reactions require the same amount of energy that was consumed or released to obtain the products (This means that you must take into account the enthalpy of the forward reaction).
A typical example are lead batteries where lead reacts with sulfuric acid to form lead sulfate and $\ce{H+}$ ions while the battery is discharging and then you apply a direct current to revert the reaction and obtain lead, sulfuric acid and lead oxide again.
Even when a reaction is thermodynamically possible you must take into account the kinetics parameters. For example: it is thermodynamically possible to turn graphite into diamond but kinetically at standard conditions (1 atm, 25$^\circ$C) it will happen in millions of years.
Comment: Related: https://chemistry.stackexchange.com/questions/16917/relation-between-thermodynamic-reversible-process-and-reversible-reaction


How do I add materials to a glTF model in Godot Engine?

Question: I'm using glTF Embedded files because I was told they are the best files to use with Godot, so I got a pack of a bunch of really lovely trees and other things to use in my game. But when I import it, it has all the materials on the side with the base being completely white. I know how to add textures onto things but it seems there is no way to add anything to the model? How would I use these materials then? Is this my fault or the model creator's fault?
Comment: Welcome to GDSE. It looks like there's multiple revisions of the gtFL spec - if you have any additional info about the file your using, please edit to include it as it makes it easier for others to troubleshoot the situation.
Comment: It's glTF Embedded
Answer: This answer applies for the Godot 3 branch.
Open the model scene. Godot will ask if you want to open an inherited scene, or open anyway. Either works※.
Once you have it open, find the MeshIntance nodes in the scene tree. They have a material attribute where you can load or modify your materials.
Once you have it set up. Use Save as to save a copy of the scene as a new one. It is the new scene the one you will use.
※: What is the difference? The inherited scene will reference the original, and keep track of the modifications. Which is good if you are also doing 3D design and you want to work on it after it was imported in Godot, and have Godot re-import it automatically. The inherited scene also has the limitation that it will not let you remove anything. If you are not doing 3D design, I suggest to avoid that option. There have been discussion on changing this, since the way models are imported causes confusion to many users, which is why I specify this answer is for Godot 3.

If you are using Godot 3.2.4, you have the new fbx importer. It solves a lot of problems that Godot had with fbx in the past. I would still suggest gltf or glb because they are an open specification (fbx is a provative format), yet you won't have go out of your way if you want to import fbx into Godot, most of the time (some material attributes are not supported at the time of writing).
Comment: It wont let me save the model
Comment: With the changed materials, it just says it doesn't know what a glTF file is
Comment: unless i'm being dumb and using Ctrl + S doesn't work
Comment: ok yea it works thanks Theraot


Time Machine disk is filling up to quickly

Question: Every time Time Machine does a backup of my Yosemite working disk (140 GB), it adds about 20 GB to the size of the contents of my backup disk, and it fills up very quickly. This happens even during the night when both I and my computer are sleeping. I don't think it should work this way!
Comment: Do you have a virtual machine running? Or another very large file changing continuously?
Comment: you might backup some enormous files you are not aware of. Use http://grandperspectiv.sourceforge.net to check the contents of your Mac. Exclude directories from TS backup in the TimeMachine settings.
Answer: You can use a program like BackupLoupe to browse the changes added in each backup version.
Otherwise, the tmutil command (specifically tmutil compare) can be used to observe the differences between two TimeMachine backups (or a backup and the current state).
Comment: BackupLoupe found the answer: Google was maintaining a 20GB Library in my machine. Getting rid of gMail solved it.  Thanks!!! (Is this how google buildes its Cloud?!)
Comment: I have seem that Chrome has options for caching offline Gmail and Google Drive. BTW, if you like my answer, please accept it.


Ma Po Doufu without Pork

Question: In China there is a famous dish called Ma Po Doufu 麻婆豆腐 and most of the recipes I find online have pork. I was wondering if anyone knew if pork was an essential part of the dish (in terms of flavoring) or if there was something you could do to make it a vegetarian option? Would the dish work with chicken/beef?
Answer: A number of Chinese restaurants are happy to prepare it without pork or beef. I've seen it with pork (most common) or beef (sometimes).
A vegetarian Chinese place that I occasionally visit uses a "vegetarian ham" along with some vegetables like peas to augment the custardy texture of the soft tofu. I like to add some ja tsai (zasai, depending on romanization preferences) pickles in there, though I'd guess that's not that common.
Pork is not absolutely essential to the identity of the dish, but it's certainly the most likely version to be served.
Answer: Kenji Lopez-Alt at SeriousEats.com has a very nice article about coming up with this recipe for a vegan Mapo Tofu that he (otherwise a happy meat eater) claims is even better than the pork one.
The main replacement for the pork is mushrooms (he recommends a mix of wood ear, morel, and porcini), because of the good match in flavour. To get the texture he uses the Chinese technique of "dry frying", typically used for meat. I'll leave it to Mr. Lopez-Alt to explain the details - he does it better than I!
Answer: Using a combination of mushrooms as Kenji suggests (reconstituted shiitake plus plenty "normal" mushrooms), combined with finely crumbled (squeeze in your hand until you disintegrate the block, then drive the back of a fork through it) and well sauteed firm tofu (yes, adding tofu twice) yields an excellent texture here.
Dicing the mushrooms finely (brunoise-like size is best, but doing that to a pound of mushrooms is more work than you think :). DO NOT attempt to use a food processor, that tends to leave you with much mush and little room.) helps, as does sauteeing the tofu separately and adding some of your salt/sugar budget for the dish at that stage (it helps drive out the water).
Small TVP flakes also work reasonably well, as a substitute for the crumbled tofu or as an addition.
If one wants to avoid having soy tofu twice in the dish, burmese tofu (which you make from chickpeas) can be used as the topping too, but caution not to overcook it is advisable.
For some extra umami, adding some finely cut/broken douchi (salted black beans) in with the aromatics works great.
Answer: There a a lot of variants of Mapo Doufu.
I know of a vegetarian/vegan version that replaces the minced pork with fermented black beans (Douchi). Works very well. There is a recipe in the book Every Grain of Rice by Fuchsia Dunlop. An online version can be found here
Another version i know is with minced beef. I don't know the source.

Ma Po Doufu without Pork


Does Linux work well with encrypted ntfs drives?

Question: What I want to do is to fully encrypt my external HDD.
My only system ATM is on Debian testing so I need to be able to set up the encryption from Linux.
My questions are, can that be done from Linux?
If I need to transfer the files to a friend, can I just plug in the USB, input the password and will his windows PC be able to read the encrypted filesystem?
Comment: If your only system is a Linux system, then why do you want to use NTFS in the first place, as opposed to a native Linux-compatible file system?
Comment: It is an external USB hard drive. I want to be able to connect it to my fathers PC. my friends PC's etc... while the drive itself is still encrypted.
Answer: Linux doesn't support NTFS file-level encryption. Bitlocker using the recovery key sorta works but is still very new(look here for more info). Windows in turn can't read LUKS-encrypted devices. If you need to share your encrypted drive between Windows and Linux, I'd recommend VeraCrypt or one of the other TrueCrypt forks.
Comment: Will my friends have to also install VeraCrypt on their machines?
Comment: Either that or they use VeraCrypt in portable mode, maybe from a small unencrypted partition of the disk


How do I get more dwellers to automatically come to my Vault?

Question: There were a few dwellers that came to my Vault when I started the game a few days ago. But after that no more dwellers have come, even though I have lots of space for them to join in and work. Obtaining more dwellers via babies is not working well, so I need walk in dwellers.
Answer: When you have 20 dwellers living in your vault, you can build a radio station. This will attract people from the outlands to you.
Comment: Just a note.  The sheer time radio station needs to work is really huge.  Two 10 Cha with +5 armor takes approximately 4 hours per dweller.  The percentages are abysmal.  If you are having problems growing babies, the radio tower is usually not a valid solution.  It might be better to fix your baby problem.
Answer: Another way is to complete objectives by getting enough caps to earn lunch boxes — or you can buy them — which sometimes contain cards that award a new dweller with nice skills and equipment.
Answer: radio station not working for me ... I'm baby making all the way
just make sure your not trying to mate family as this don't work
.... just try upgrading a 3 wide living quarters and filling it with both sex they will pair up and start the process :)
Answer: there is also another way but it works only few times. close fallout shelter and open it again . you may see a dweller coming to your vault. this can only work if you wait atleast 1 minute.
Comment: Do you have any reason to believe this works? It sounds like a random occurrence wrongly interpreted as cause and effect.


How to make the .eps file smaller

Question: I'm working on the large sign 24" X 60" in Illustrator CC 2014. My problem is the size of the .eps file. I'm still new to Illustrator and learning new things with every project. I'm trying to achieve the water bubbles effect on the background of my sign - image attached. I created one bubble and added gaussian blur effect and a drop shadow. I then copied and pasted this bubble multiple times all over the artboard. Now, after I saw the saved file size I started reading, I know now, that I shouldn't use drop shadow, especially when working with huge signs/banners. The question is, how can I easily replace these effects with something less heavy?
Thanks!
Answer: Create one bubble, drag it to the Symbols Panel to create a symbol of it.
Then duplicate and place the symbol to create additional instances.
Symbols are used effectively to duplicate the same thing repeatedly. This way Illustrator only stores 1 copy of the artwork, then merely replicated that artwork as many times as you want.
Without symbols, Illustrator has to store each and every bubble.
Related questions here:
How can I have a vector shape that is smart-cloned and kept in sync in Illustrator?
automatically duplicate and scatter a shape
For what it's worth, raster effects will always increase a file's size, especial in a flat format such as .eps.
Comment: Well.. I did a quick check and unfortunatelly, the file size didn't improve much using this technique... but thanks anyway, I learnt something new here
Comment: Eps is a flat file format... everything will be expanded and flattened in the EPS format. using Symbols will *dramatically* reduce file sizes for .ai files.
Comment: Usually a pdf file is much smaller than eps file. Can you explain why?
Comment: PDFs are *not* inherently a flat file format like EPS is.
Comment: Pdf is compressed, eps is not.

How to make the .eps file smaller


ASLR in Ubuntu 11.10

Question: In many of the exploits I see nowadays, brute forcing is a common method of bypassing ASLR on 32 bit machines. However, many of these exploits crash the current process, for example, PHP. Isn't the process re-randomized as soon as it crashes and wouldn't this prevent brute force attacks?
Answer: I am not aware of a single exploit that using "brute forcing",  the chances of this working on a 64 bit linux system is about 1 in 16^8th,  which would never happen.
The most common forms of ASLR bypass are Heap Spraying and ROP chains (and there are others).  ROP chains being by far the most popular method for exploits found in the wild (which basically means found in metasploit).
Comment: You are completely correct. I should have mentioned the most common forms of ASLR bypasses. Your remark about 64 bit is also important. +1.
Answer: Schacham et al. have shown that bypassing ASLR by means of brute force is nothing but a "small slowdown" (see abstract). Even the exploitation of applications running on remote machines is said to be feasible, as long as the service is restarted on crashes.
This attack comes closer to the force part of the term brute force rather than the notion of an exhaustive search, in which would look through the whole address space and determine the correct position. This exhaustive search is, as you correctly said, impossible due to re-randomization.
According to Symantec's Analysis of Windows ASLR, re-randomization might, over time, suffer from low entropy though.
In addition, I'd recommend you exploiting a very simple stack overflow on your local machine. Just write a simple wrapper (script languages come handy in here) and re-run like this:

./stackoverflow (nopslide)(shellcode)(ptr)

..changing the ptr for each run.
There are several youtube videos and tutorials available, once you search for 'ASLR brute force', which might give some more hands-on advise.
Comment: Yeah in Schacham's paper he states that when an Apache process crashes and the parent process fork()s a new child in its place, the child has the same randomization data as before so brute forcing does become more realistic even w/ the 8190 byte request cap Apache imposes.

ASLR in Ubuntu 11.10


A brown dwarf world

Question: I'm thinking about making a detailed world on Luhman 16 B (not around the star, right on it). This brown dwarf's mass is 28.6 times that of Jupiter and has a radius 104% that of Jupiter. It has a temperature of 1210 degrees K, with methane and iron rain in the atmosphere. What would the surface (or something similar) of such a world look like?
Comment: Would there be a surface? Luhman 16 B is still a star, so it's made of mostly H+He.
Comment: Any time you have a section of atmosphere that is hot enough to vaporize a material, with a cooler layer of atmosphere above it, you'll get rain of that material. The problem I've had with that statement is that, when you describe something as "rain," there should be a surface for it to rain upon. There is an ocean of compressed hydrogen somewhere deep inside of a gas giant, but the same forces that keep it liquid would keep iron from vaporizing.
Comment: It would have less of a surface than jupiter, and it wouldn't be nearly as hospitable. I don't think you'll really get iron rain either, but you might get a trace of vapor in what passes for an atmosphere.
Comment: I'm going to add my voice to those doubting that you'd get any meaningful "rain" on a star.
Answer: I'm not an astronomer, but I'll try to answer.
As far as I know, stars are made of mostly hydrogen and helium. This makes them just a large clouds of gas. Typically, stars's density is quite low: for example, our Sun has density almost like water's (1.4 vsd 1.0 g/cm^3). But you would not swim in the Sun, obviously, it's tad bit too hot.
'Brown dwarfs', or 'failed stars' are still stars, they are made of star stuff too. Their feature is that they are much, much more dense: 10 to 1000g/cm^3  (according to the Wikipedia). Its 'surface', if we can call it that, would be just like star's: very hot (thousands of Kelvins); and it's still hydrogen.
Your numbers fit nicely into these definitions, so far.
It's dense, but will it be solid? Most likely no, hydrogen needs very special conditions to become a solid. It won't be in the liquid state as well: Wiki states that you need a much lower temperatures and much higher pressure for it to condense. It will be in a 'metallic' state, most likely. But it's called that because it conducts electricity, not because you can make spoons or nails out of it. As far as I've researched, it's still a gas.
(It makes me wonder how having an gaseous atmosphere that is much denser than densest construction materials on Earth would feel like. Unfortunately, it seems that I won't experience that in my life)
In other words, there will be no solid 'surface' with well-defined boundary, like Earth's walkable surface. It will be more like Earth's atmosphere: there is no clear boundary; but much hotter, and once you descend deep enough, very dense.
To sum up: its surface will look like any stars'; it will get much denser quickly if you decide to dive deep, but that's it.

Anyways, good question! Yes, Jupiter is a 'small brother' of brown dwarfs; yes, your star has to be order of magnitudes more massive than Jupiter to be a 'brown dwarf'. Numbers are chosen well, but it there won't be enough iron to have an iron rain. It is still a big gas cloud, a boring star. No cities on the surface, since there is no one.
If you need a cool setting for your story: I could not find how diffuse a brown dwarf's 'edge' is; but assuming your star is cold enough, and density gradient is extreme enough (~kilometer to reach >~ 10g/cm^3), you can make a habitat just above the star 'surface' that is supported by long pillars made of tungstein. It won't melt at 1000K, and it is less dense than brown dwarf's hydrogenic body, so it will 'float' in it, providing bouancy for the whole habitat. Add some shielding for the habitat (large sun shades at the bottom) and coolind (enormous radiator metal plates at the top). Now, you got almost what you requested, and it is unusual and cool (almost as walking on a star surface). Still no iron rains, unfortunately. Maybe some devices that capture evaporating tungstein vapor (due to reverse sublimation) - if you need it for some reason. With some handwaving, you can make it work.
Comment: Brown dwarfs are not stars, they are considered to be a separate class, more massive than planets and less massive than stars.  So a brown dwarf would be somewhere between a gas giant planet several times as massive as Jupiter and a very small and low mass star star.
Comment: Gasses and fluids in a mechanical sense both adhere to the laws of fluid dynamics. An extremely dense gas as you will find here, is probably behaving pretty much the same as a fluid of the same density.
Comment: Brown dwarfs are "only" 13 times Jupiter's mass or greater, not multiple orders of magnitude greater than Jupiter's mass — a body with 100x Jupiter's mass is almost certainly a red dwarf, a true star, and not a brown dwarf.
Comment: *"our Sun has density almost like water's"* — surely you must mean average density, which would include it's atmosphere, which is pretty sparse the further you get from the sun.

A brown dwarf world


Is "it is no calculus" correct grammar?

Question: I often hear people saying, it's no big deal, or I am no […], etc.
I was wondering if it is acceptable to say it is no calculus in a college essay.
Comment: Seems awkward - why not, "It is not calculus?"
Comment: I don't think so... "big deal" etc. are countable nouns, so it makes sense to speak of one, two, or none of them. But there is exactly one calculus.
Comment: Based on a meme like: **Senator, you are no Kennedy**
Comment: To clarify: my first comment above was about why you can say "not calculus" but not "no calculus". I assume that's what the question is about.
Comment: @ShreevatsaR Depending on how you look at it, there are 1 or 2 additional "calculuses" today; namely the calculus of variations (a sub-filed of the standard calculus) and the propositional-calculus.
Answer: I think you're probably looking for an idiom like

It's not rocket science.

or

It's not brain surgery.

or, as some wags have it,

It's not rocket surgery.

This is one of those cases where modifying a cliché to make it fresher doesn't quite work. Saying "It's not calculus," while reasonable in a certain context, would not have currency among the general population and would not be readily understood to mean something easy or inconsequential.
EDIT: I answered with "not" constructions because I figured the OP would accept any negative construction, and as Scott Mitchell points out in his comment "not" certainly works better than "no" in the OP's example.
Comment: Note that he's actually asking about *... **no** calculus*, not *... **not** calculus*.
Comment: oh, I agree; I just think it would improve your answer if you explicitly noted why you're using *not* instead of *no*.
Comment: @Martha: I considered that, but figured he might accept any negative construction that meant the same. *Not* certainly would make more sense than *no* in his example, as Scott Mitchell points out in his comment to the OP.
Comment: @Martha: Well, you levered that out of me in the comments, so it's in the record. Nevertheless, it wouldn't hurt to add it to the answer, so I'll go ahead and formalize it. :)
Answer: I would not risk using "It is no calculus".  You might be meaning "It is not as hard as (differential or integral) calculus", in which case, say so.  Or you might be referring to a logical system and stating "That isn't a calculus; it is merely an algebra", in which case, say that instead.  Your original is ambiguous, therefore (at least, without the larger context to guide us), and probably too informal for a college essay.
Answer: It would depend on context. This is certainly no idiom.
… that I am familiar with.
Answer: I think you can certainly say "it's no calculus" if the context is correct. (What can't you say if the context is correct?)
For instance, the following sentence seems entirely plausible to me:

Horseback riding may have been challenging, but it was no calculus.

The implication here is that calculus was very difficult for you. It's important to note, though, that the emphasis of the sentence switches from horseback riding to calculus itself; the reader would probably expect the paragraph to transition into a discussion of the difficulties of calculus.
Contextually, it would make most sense as the introductory sentence to a paragraph about learning calculus, coming on the heels of a paragraph about the challenges of horseback riding.
So to answer your question, you can absolutely say it. Just be sure it's what you want to be saying.
Answer: I would say that the phrase "it is no calculus" could be used in an essay, but only under very specific circumstances, and for courses (Mathematics or Computer Science) that do not normally call for the types of essays that such a phrase would be used in anyway.
Most non-mathematicians use the term calculus to refer to a specific type of calculus -- that of differential and integral calculus developed by Isaac Newton.
Mathematicians (and Computer Scientists) use the term calculus to refer to a set of formula that can be used to define the changes in systems that incorporate some element of change. Examples of systems of calculus that have been defined include:

Relational Calculus: formulation that define ways to define a relational system and queries on that system. This is the basis of SQL databases.
Lambda Calculus: provides a formal definition system for data, functions and recursion. This calculus is the basis for the computer language LISP.
Predicate Calculus: is a formal definition of first order logic and the inferences and deductions that it is capable of. The computer language Prolog is based on this form of calculus.

So, if you have a system of equations of formulas, but it does not have the properties that it needs in order to be considered a type of a calculus, you could say that the system "is no calculus". But that is stretching things a bit.

Is "it is no calculus" correct grammar?


When to use "Elven", "Elvish" and "Elfic"?

Question: Well, these are three adjectives for "something from the elves". But I'm Spanish and in my language there's only one adjective for these (élfico), and I can't understand what the difference is.
Comment: Note that I don't believe "elfic" is an English word. Were you thinking of "elfin", maybe?
Comment: Which elves are you referring to? Santa, Tolkien, Blizzard...
Comment: @Theist: Yes, believe it or not. Unfortunately, I do not have the time to go look them up. The answer is essentially, "Find out what the relevant fictional world uses and use that." Elfen/elven/elvish fans can get pretty touchy about their terms.
Comment: @MrHen: I hope he means Tolkien's... Or Blizzard's, at least. :D
Comment: @MrHen : There's a linguistic difference among different kinds of elves? Perhaps that's the answer.
Comment: If I were writing, and I often do, I would never use 'elfic' for anything. But that is entirely due to my own prejudices.
Comment: The questions is whether there are 12 of whatever.
Comment: Seconded. In full.
Comment: Thirded. I'm not even sure about **elfin** when you specifically want to invoke actual *elves*. To me, **elfin** bypasses the elves themselves to conjure up images of 'real' people like Liza Minnelli.
Answer: Okay, here goes: Etymonline's comments on elf reveal usage from the 1550s and stemming from the words elf, ælf, ylf. The plural mentioned there is "elves" which would match the traditional pluralization of lf: shelves; wolves. Unfortunately, there is no word for wolven so that doesn't help us much.
The same site does have an entries for elven:

elven - O.E. ælfen; see elf) [sic] + -en (2). Apparently obsolete until revived by Tolkien.

And elfin:

elfin - 1590s, from elf; first found in Spenser, who may have been thinking of elven but the word also is a proper name in the Arthurian romances (Elphin).

And elfish:

elfish - c.1200, alvisc; see elf + -ish.

Tolkien's usage of elven strongly implies that this is the appropriate term for his elves. The c.1200 usage of elfish seems appropriate for mythological or physical references to elves (his ears are elfish; their attitude is elfish).
(Edit per Martha's comment): That being said, Elvish is also the Tolkien proper term for their group of languages with the prime examples being Quenya and Sindarin.
As far as non-Tolkien usage, Wowpedia consistently uses elven in their article on Elves. Dungeons and Dragons appear to use elven for the language and adjective. Other fictional universes could easily vary. It would be best to check with their experts.
The summary: Elvish for physical attributes or mythological references; elven for Tolkien and most other fictional universes. Elfic is unused in English and not advisable.
Comment: To me, *Elvish* means the language of Tolkien's elves, and other Tolkien-wannabe universes' elves (D&D, Dragonlance, etc.). Standard spelled-with-an-f elves are not usually depicted as having their own language, so *elfish* doesn't really have the language connotation. I still prefer *elfin*, just to avoid ambiguity.
Comment: @Martha: Good point; added. In random trivia, someone in the circle of friends where I live named their daughter Elfin. I thought it odd.
Comment: Poor child. Couldn't the parents at least have spelled it as Elphin?
Comment: Thanks!. Sorry about the "Elfic" stuff, a bit more of research (googling) about the word reveal that many of the ocurrences of that word were from hispanic sources. Perhaps is some kind of miss concept deeply fixed on spanish minds. But I didn't know elfin either!
Comment: I don't think your source for D&D is very good---a [new question on the RPG stack exchange](https://rpg.stackexchange.com/a/151376/33008) has a very well-cited answer for D&D saying that, in the D&D world, *elvish* is the language, *elven* is the adjective.
Answer: The spelling with 'v' for dwarves and elves is from Tolkien.
I suspect (but am not remotely geeky enough to know) that he used the different spelling to give his imaginations a distinct identity compared to Santa's little helpers.
Comment: programmers are notoriously picky about languages. Both kinds.
Comment: @TimLymington - although the PC term is probably BORG (Barbarian Of Restricted Growth)
Comment: @tchrist - But the popular usage is due to Tolkien. He deliberately used old english and anglo-saxon versions -= that was rather the point of writing the stuff,.
Comment: Your avatar is cut from an xkcd cartoon, you're pretty geeky ;-)
Comment: But not enough to read The Silmarillion! Interestingly there is a very strong correlation between this site and stackoverflow - of all the non-computer SE sites this one has the largest population of programmers
Comment: Tolkien says somewhere that he invented *dwarves* and *dwarvish* to distinguish the racial term from the English words *dwarfs* and *dwarfish*. (So presumably Middle Earth may contain dwarfish dwarves, who are not considered dwarvish because they are dwarfs...)
Comment: *Elves* is from English, not Tolkien.
Comment: @mgb What, so you think people used to say *elfs* before Tolkien? I think not.
Answer: I think the two are commonly used interchangeably, but I think this is the difference.
If something is elfin it is "of, or relating to or made by an elf"

These shoes are elfin.

Something is elfish if it has characteristics of an elf.

Tom is short, and very mischievous. He is elfish.
Comment: Not to be confused with Tom keeping everything for himself, or Tom the crab ;-)
Comment: Tom is arguably Maiarish.
Answer: elfish/elvish use the common general adjective suffix -ish
I would recommend using either elfish or elvish as the corresponding adjective to elf/elves in general or if you're uncertain. These words are formed with the common English adjectival suffix -ish which has a quite general meaning: they can mean "of an elf," "like an elf," "of elves." So it's hard to go wrong with one of them. (Using "f" or "v" doesn't make a difference in meaning, only a slight difference in connotation: "elvish" is probably more commonly with "Lord of the Rings" or "Dungeons and Dragons" elves, while "elfish" may be more commonly used in contexts like "Santa's elves." Also, "elvish" may sound silly to some people due to the similarity to the name "Elvis.")
don't use elfic
As others have mentioned, "elfic" is basically never used in English. Using it would seem like an error caused by trying to translate the word directly from Spanish élfico.
elfin ususally has connotation of "otherworldly" or 'diminutive"
The adjective elfin is fairly common, but there are some nuances to its use. Applied to real people, it usually means "fine-featured," probably with some kind of otherworldly appearance. In fantasy contexts, elfin can also be used as an adjective that is basically synonymous to elfish/elvish.
elven: originally a noun, later reinterpreted a an adjective
As other answers have mentioned, "elven" seems to have been popularized by Tolkien. The etymology and the way he used it make me a bit leery of using it as an adjective, but that's just my opinion. It is commonly used as such in much of modern fantasy literature. Since it is associated with fantasy literature, it might seem a bit odd to use it in relation to "Santa's elves".
The Oxford English Dictionary entry for elven says it is a noun from Old English ælfen, ęlfen that was originally a femine form of the word "elf," but later used to refer to any elf in a gender-neutral fashion. It says it is used in the works of J. R. R. Tolkien in the following ways: as a combining element that is appositive (the OED's example: elven-kin) or attributive (the OED's examples: elven-king, elven-tongue; elven-wise). So basically, "Tokien" used "elven-" as an archaic element for forming compound words with an appropriate feel for his fantasy.
There seems to have been some conflation of these compound words with sequences of adjective + noun, giving rise to the use of elven as an adjective.
Interestingly, the -en suffix of the re-analyzed adjective elven has also been applied now to at least one other word: modern fantasy uses the adjective dwarven, derived from dwarf/dwarves, as an alternative to dwarfish/dwarvish.  I asked a question about the history of dwarven and it seems the first known use in a published text was in 1976, in the Greyhawk "Dungeons and Dragons" supplement; the form seems to have also arisen independently in some works of JRR Tolkien that were written earlier but not published until 1984 in The Book of Lost Tales, Volume II.
Summary

Don't use "elvic".

There is no big difference in meaning between elfish, elvish, elfin, elven. Any can be used for the general meaning "somehow related to elves."

Elfin is best if you're describing a real person and you want to convey that the person has a delicate, otherworldly look. E.g. if you're describing the face of someone who is not literally an elf, "elfin face" is better than "elfish face," and much better than "elvish face" or "elven face."

Elfish is probably not the best choice if you're talking about "Lord of the Rings" or "Dungeons and Dragons" style elves. E.g. to express the idea of "magic of the elves," it sounds better to say "elfin magic," "elvish magic," or "elven magic," and it doesn't sound as good to say "elfish magic."

Elven is probably not the best choice if you're talking about Santa's elves.
Comment: Old English *ælfen* was mandatorily pronounced [ˈælven] with [v] never [f] there. The spelling was immaterial: all fricatives used the corresponding voiced allophone between vowels or voiced consonants. Tolkien knowing this also despised the diminutive Tinkerbell connotations of the Modern English *-in* suffix seen in *elfin* as a latter-day corruption and misunderstanding of older and nobler tales such as those of the Norse Ljósálfar of Álfheimr (the "Light-elves of Elf-home"), and so was ever careful to spell *elves, elven, elvish* "phonetically".  *Elf, elves; oaf, oaves* share an origin.
Comment: The Old English plural of *ælf* [ælf] was apparently *ylfe* [ylve], which is not the normal i-mutation; normally /ae/ i-mutates to /e/ while /u/ i-mutates to /y/. It is possible that the female form *ælfen*, *ęlfen* represents the more normal i-mutation for that vowel and so *elven* is therefore simply the "phonetic" spelling.
Comment: @tchrist: It looks like "ylfe" shows a [West Saxon change of ie > y](https://en.wikipedia.org/wiki/Germanic_umlaut#I-mutation_in_Old_English), which seems a bit weird to me (where does the rounding come from?). Another Wikipedia article suggests that the ["unstable i"](https://en.wikipedia.org/wiki/Old_English_phonology#Diphthongs) represented by "y" in later West Saxon manuscripts was maybe just /i/.
Answer: I don't think there is a word, elfic. You may be referring to the Old English (OE) ælfisc.
The words elfen, elfin, and elven are all spelling variations of the same word and when used as an adjective (or noun), can be swapped at will with no loss of meaning.
The root word is elf (from OE ælf), plural is elves. (Mark the f to v!)
After that, it gets twisted.
From OE, the original adjective was elfish (OE ælfisc).
In OE there was also elfen (plural was elfenne) ... a female elf, a nymph. That morphed in an adjective in Middle English with the original sense of feminine, child-like. It was also spelled elfin and elven.
During this time we also see the 'n' drop and a female elf is an elfe ... with the plural of elfen! Confused yet?
Naturally, if you have elfe, there is a spelling variation of elve (f to v)... with the plural of elven.
There are also compounds like elfsheen (adj. - supernaturally beautiful, noun - supernatural beauty).
So if you're keeping count:
There is only one male form: elf. (However, you can also call a female elf, an elf.)
There are four possible adjective forms: elfish, elfin, elfen, and elven.
There are five possible female forms: elfe, elve, elfin, elfen, and elven.
It's little wonder that folks are befuddled!
Answer: Elfin- Something from elves
Elven- Elf like
Note: The people who printed Tolkien's books changed elfin to elven and vice versa quite a bit, so there is no telling how accurate anything gotten from there is.
I got this from the "note about the text" in my copy of LOTR, so if you want more info you could probably get some from the most recent version of that.
Also, dictionary definitions would probably help you a lot.
Also, I'm just using Tolkien because that seems to be the basis for a lot of these answers. Real definitions may not actually apply in books, so if you want clarification about actual meaning, a dictionary is definitely the way to go.
Comment: The people who made Tolkien's films changed fell beast (adjective + noun) to fell beast (compound noun). Perhaps all these experts realise Tolkien's limitations as a linguist.
Comment: This answer mentions only one of the OP's 3 words and focuses exclusively on one source of evidence about it.


ImageView Share Intent

Question: Hi I have a gallery in my app which shows the image in an image view when you click on the thumbnail. I am setting up a Long Click Listener for an alert dialog that has 2 buttons one to set as wallpaper and one to share. I have the share intent and the get drawing cache somewhat working. It works in the emulator but not on my phone. I have used many of the examples on this site to get this going but its not working at all. it keeps force closing the app on my phone. any help is appreciated.
                alertDialog.setButton2("Share",
                    new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog,
                                int which) {
                            imgView.setDrawingCacheEnabled(true);
                            Bitmap b = imgView.getDrawingCache();
                            File sdCard = Environment.getExternalStorageDirectory();
                            File file = new File(sdCard, "image.jpg");
                            FileOutputStream fos;
                            try {
                                fos = new FileOutputStream(file);
                                b.compress(CompressFormat.JPEG, 95,fos);
                               } catch (FileNotFoundException e) {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                               }

                            Log.d("Save Example", "Image saved.");

                            Intent intent = new Intent(Intent.ACTION_SEND);
                            intent.setType("image/jpeg");
                            intent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file:///sdcard/image.jpg"));

                            startActivity(Intent.createChooser(intent, "Share Picture Via.."));
                        }

            });

            alertDialog.show();
            return true;

Update: it seems to be a problem with
b.compress(CompressFormat.JPEG, 95, fos);

it keeps saying null pointer.
Turns out the null pointer is actually a read_only error..So its not actually writing the file i get a  ioexception read-only file system. Why is it doing this?
Answer: imgView.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED), MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)); imgView.layout(0, 0, imgView.getMeasuredWidth(), imgView.getMeasuredHeight());

See if this helps before
 Bitmap b = imgView.getDrawingCache();

ALso see if this helps
Android drawing cache

ImageView Share Intent


Why automatically adjust brightness doesn't work after I change the brightness

Question: Why automatically adjust brightness doesn't work after I change the brightness manually using the hot keys although it's set to do so in the displays configuration?
Comment: It's supposed to.  I just tested mine and it does.  Maybe you're not waiting long enough for the sensor to do its work.  Or there's a piece of software that's hooking in and doing something else with that signal.
Comment: So, what was the actual issue? If it's really solved.
Answer: Theoretically it should, but it is all relative. The ambient light sensor turns the display brighter when its bright outside and dim when it's dark inside. The thing is, the Mac is designed to cater to the user, because supposedly a human being knows what it wants better than a little $.005 photo sensor, so the buttons on the keyboard (F1 and F2) override the ambient light settings for a set period of time, and then still until the light conditions change drastically enough to cause the auto-adjust to kick in again. Going from dark screen to bright screen is almost immediate, but the Mac will take a while to go from bright screen to dark screen except on opening the clamshell or waking from sleep. This kind of makes sense when you think about the real world situations where this would happen.
So try this with auto-adjust ON and make sure "dim screen after inactivity" in Energy Saver prefs is off:

In a really dark room (no light except from computer), open the computer and manually raise the brightness to maximum, screen and keyboard backlight too if equipped.
Hold a small headed, bright flashlight (Mini Maglight or smaller) to the ALS, which is located to the left of the iSight camera on glass-paneled macs or in the speaker grille on older macs.
If the keyboard backlight goes off then the ALS IS WORKING
Lower DISPLAY backlight only to 1 above minimum level (minimum turns backlight completely off)
Put flashlight over ALS
You should see IMMEDIATE increase in backlight to full level.
Remove flashlight, display should readjust immediately to ambient level. Notice how after auto-adjusting the manual override is overridden so you can repeat steps 5 and 7 over and over again for entertainment ;)

If the steps above produce no results, restart computer and repeat tests. If still no results take to Apple certified repair center or Apple Store for repair which will likely be covered under warranty.
Comment: perhaps you know the answer to this?  http://apple.stackexchange.com/questions/12855/why-does-iphone-and-ipod-touch-auto-brightness-setting-work-relative-to-a-brightn
Comment: Super light sensor diagnostic
Comment: This happens on iOS and it drives me bonkers. I turn off auto brightness and set it to max brightness. it still ignores my settings and uses the ALS. Then every once in a while it will kick into high gear like it's outside and actually be bright. It's a huge issue some i have eyesight issues. I have to try the flash light thing but i wish there was a fix.
Answer: I have noticed a few times that if I turn the brightness up very high, the auto adjust is not nearly as noticeable as it is on lower settings.
Answer: From my experience, if you put your head between the camera and the light the sensor will trigger the auto adjust no matter what.
Comment: @SeniorShizzle you missed a "the"
Comment: @SeniorShizzle "... **the** sensor will trigger ...". Your *head* goes between the camera and the light. Light source, that is.
Comment: You'd have to have a pretty small head to fit between those two, they're like 1cm apart...
Comment: No, I don't think I did.
Comment: Oh. Now I see. Awkward wording :S
Comment: @SeniorShizzle I agree. And there are too many "the's" in there. But maybe a simple comma would have clarified it.
Answer: After manually changing the brightness you need a way to trigger the light sensor. Just place your hand on the camera area, which will make the brightness dimmer and once you remove your hand, the screen brightness will automatically adjust itself.


Did Snoke have any other apprentices before Kylo Ren?

Question: We know that Kylo Ren is Supreme Leader Snoke's apprentice, but recently I was wondering: Did Snoke have any other apprentices before Kylo Ren?
Answer: Snoke has had at least one other, and potentially several other apprentices over the years.
The Star Wars Insider Last Jedi: Special Collector's edition contains the following cryptic note

"Force sensitive, and highly attuned to the dark tide but not a Sith,
Snoke has trained Kylo Ren and least one other apprentice."

And the Visual Dictionary for The Force Awakens states that Kylo Ren is the most gifted of (presumably) several apprentices.

"Kylo Ren is the most gifted apprentice of Supreme Leader Snoke, a mysterious figure steeped in dark side knowledge who commands the First Order from a distance."
Comment: I knew I'd seen it somewhere before but you beat me to it...
Comment: Snoke trained Plageius: CONFIRMED!
Answer: The Rise of Skywalker has now shed new light on Snokes backstory.

 Snoke is not a real being but is in fact a facet of the emperor Palpatine, it is not yet understood exactly how Palpatine controlled the being that is Snoke but it is strongly suggested that Snoke is in fact a clone and acted as either the puppet for, or was controlled by Palpatine. Therefore strictly speaking yes there where other apprentices, the most famous being Darth Vader.


How do I create absolute paths for INCLUDEs and REDIRECTs that will work regardless directory nesting level?

Question: I have a problem similar to the one mentioned here, except I need a solution for ABSOLUTE PATHs:
How to use a PHP includes across multiple directories/sub directories with relative paths
The additional bit in my setup is that I have multiple files ("config.php","functions.php",etc) that I'm including in my "header.php" file, then including only "header.php" in my sub-sub-sub-sub-etc folder items.  Basically the header file says "if not logged in then redirect to the top level index.php file".  The header itself is, however, in it's own subfolder called "common_inc".  The problem I'm experiencing comes in when I need to perform a redirect (which is managed in the header) from any non top-level directory.
The only solutions that come to mind are to 1) set 'allow_url_include' to true or 2) place all files in a flat directory structure and work from there or 3) remove the redirect from the header and manually place an absolute path redirect in all files.  Obviously all of these solutions are undesirable.  So can anyone think of a better way to establish ABSOLUTE PATHS (for both includes and redirects) that won't change based on their request location?
I'm sure there is something amazingly simple I'm overlooking, but my brain is rather fried atm.
Thanks in advance!
Answer: The dirname function may be of use here. It returns the pathname for the current directory.
dirname - php manual


How to connect to an AWS RDS database (deployed in VPC) with an SQL client?

Question: I am new to AWS and trying to set up and initialize an RDS instance.  Since I have a newly created account, it does not support EC2-Classic, which (from what I understand) means that my RDS instance must be deployed into a private subnet in a VPC.  However, once the RDS instance created, how can I connect to it from the outside world?  I understand that I can connect to it from the public subnets in my VPC, so my application servers will be able to use the DB with no problem.  However, I want to be able to say, fire up Squirrel or some other GUI client in order to initialize the schema, or add columns and tables as my application grows.  How can I do this if it is required to live in a private subnet?
Comment: You should still be able to connect to the RDS instance in the security group is set to allow connections from your IP.  All that will designate that the subnet is private is that it does have an Internet Gateway.  If it doesn't, and you don't want to set up a relay server to forward traffic, just create na IGW for that subnet.  BTW, dev support is going to be your best $50/mo ever spent.
Comment: You can make RDS instances that you can connect from the outside world from. You just can't change it. Once private, always private.
Answer: One solution (but not the only solution!) is to use what's called a Bastion Host.  A Bastion Host is an ultra-low-powered server that sits in your public subnet and is the only server that allows inbound SSH connections.
This server should be thoroughly hardened, and depending on your level of paranoia, there are a few techniques you can use to hide the fact that this server is listening for SSH connections at all.  See, for example, http://www.portknocking.org/view/details.  Of course, you don't need to harden it just to connect to your RDS instance.
Anyway, you can setup your EC2 Security Group rules as follows:

Bastion Host Security Group allows port 22 from your local IP only (so you can SSH into it, but no one else can)
RDS Security Group allows your incoming database connections on Port X (depends on your database) only from the Bastion Host

By the way, you can achieve "only from the Bastion Host" either by specifying the private IP address of your Bastion Host, or listing the security group name the Bastion Host uses.
Now you have two options from here:
OPTION #1: Set up local port forwarding as part of your SSH connection
For example, if you're on OS X or Linux, SSH into the bastion host and setup local port forwarding with:
ssh -l <bastion-host-username> -L <local-port-you-connect-to>:<rds-private-ip>:<rds:listening-port> <bastion-host-public-ip>

And let's say you're connecting to Postgres from an Ubuntu-based Bastion Host.  It might look like this:
ssh -l ubuntu -L 5432:<rds-private-ip>:5432 <bastion-host-public-ip>

Your local machine is now listening on port 5432 and will forward any of those connections to <bastion-host-public-ip> which in turn will forward it to port 5432 on <rds-private-ip>
OPTION #2: Look for this feature in your Database Client
I know DBVisualizer supports this.  I'm not sure about Squirrel.  Basically, instead of setting up the local port forwarding manually using SSH, your SQL client handles this for you.
Comment: It might be me being dim but I did get a bit confused with the comment "SSH into the bastion host and setup local port forwarding with". I took that to mean two separate actions of first ssh into the bastion host and then secondly run the port forwarding command. After a some head scratching and further reading I realised that the command does both these things and so it should be run on your local machine. This is the command that finally did the trick for me. Note I connect using my aws keypair file and I also added the verbose flag so I can see whats going on. ssh -i aws.pem -v -C -N -L 330
Comment: Another useful tool -- deploy the bastion, do your work, tear the bastion down. Minimize the exposure time.
Answer: This worked for me. Make sure you have psql client installed locally.
psql --host=myAwsDbEndpointUrl.ciqykqusf0nv.us-west-1.rds.amazonaws.com --port=5432 --username=myUserName --password --dbname=myDbName

When creating your db instance on aws, make sure to define the following:

username
password
database name
port number

I also had to create a security group for the VPC that the database was located in. After creating it make sure your db instance uses this for its security group. The security group has the following rules:
inbound--> type:PostgreSQL, protocol:TCP port range:5432, source:0.0.0.0/0

outbound--> type:All Traffic, protocol:All, port range:all, destination:0.0.0.0/0


Poker Calculator

Question: How would one go about writing a poker calculator?
Plug in 1-X starting hands then return the percentage of wins.
Answer: Features important to me:

total and pct on win loss tie
ratio for hand odds
give a tie 1/2 win
break down on all the hands
percent straight flush down to pct high card
need this for debug anyway
further break down on all hands
when it wins / ties did it do so as what hand (straight flush down to high card)
(my app does not currently do that - going to add it)
option to run as heads up against each
so instead of running like JJ against AA, KK, AK separately get it in one
(the boards are different - JJ veruss AA does not remove KK, and AK)

Design:

card class
properties rank, suit, and out
using a Boolean property for out (in a hand) was much more convenient than removing cards from the deck that were out
so on start just create a deck of 52 and use it for basically every thing
player class
properties wins, ties, losses
from those three every thing else is calculated
the Unicode symbol for a club looked a lot like spade so I used a shamrock
order the hands (hand score)
gave strait flush a value of 8 down to 0 for high hand
gave ace a value of 14 down to two a value of 2
in the case of a straight add the ace with a value of 1
for kickers include the made hand as part start of the kicker
hand and kicker are all just two digits
hand * 100000000 + kicker.0 * 1000000 + kicker.1 * 10000 + kicker.2 * 100 + kicker.3
so ace over king boat is
614130000
for flush and high card it could actually go into 5 kickers but I just let that be a tie
shuffle
rather than shuffle whole deck just grab the required number of card randomly
I just used .NET random
evaluate board
shuffle then one player at a time get the order (hand score)
record win, tie, and loss to the player

This took me about 20 hours but I am a developer
I moved to a new version of .NET and Visual Studio and wanted a project to practice with
I a mid range PC I get about 10,000 shuffles in 20 seconds.  A 100,000 takes about 3 minutes.
Can get up to a 10% error with just 10,000 shuffles but for just planning that can be enough.  On the higher % the error is smaller.  The smaller % like 2 7 off suite is a bigger error but that is the stuff you are not usually interested in.
On a faster machine with 8 core could process 8 hands in parallel so would get 100,000 down to the 10 second range.
The online calculators that are instantaneous I guess process all combinations at like 20 million shuffles each and store that.  I am not really sure how they do it.
For speed could stop calculating a hand when you know it is dead. But that would be a lot more logic and I wanted the detail on all hands.
In machine learning you can do something called pruning but I am not strong enough for that and again I wanted the detail.
4 hands is not twice as long as 2 as same number of shuffles.  And you get better accuracy for the same number of shuffles as there are less possible boards.
With the brute force approach running all board is not practical.  With two hands there are 48*47*46*45*44 boards = 205,476,480.  Even on at 100,000 in  10 seconds that is like 6 hours.
At 10 million a Monte Carlo method is going to be very accurate.
Answer: I'm not familiar with .NET and stuff. I probably should mention that I'm not a professional programmer myself. But there surely are a lot of great libraries in pure C.
Using C++ and i5 CPU I personally get about 4.4 million hands/s in Monte Carlo with 3 players and 2.3 million with 6 players. But that's just raw unoptimized Monte-Carlo. Brute-force enumeration goes at the rate of 190M hands/sec. So your 205,476,480 boards don't look too scary to me. This number is actually wrong: you should have calculated it as combin(48,5) = 1,712,304. At 190M/sec that's an instant. So I can assume that the bottleneck is hand evaluation algorithm.
Here you go:

A LOT of code on hand evaluation presented in the article "The Great Poker Hand Evaluator Roundup": XPokerEval. I would recommend you pokersource since it has been ported to all kinds of languages. TwoPlusTwo evaluator shows great enumeration benchmark but failes at Monte Carlo due to cache misses.
Back to good ol' C. Steve Brecher's Holdem Showdown. Really nice piece. I had great time disecting and optimizing it. Google it, I can post only 1 link :(
Ashelly's Ace_eval. It's a golfed program with size under 600 bytes and no lookup tables. Ungolfed version works quite fast. I really liked its hand value format, so I use it myself.
Andrew Prock's Pokerstove. This one made me wanna quit even trying programming. It utilizes highly optimized enumeration algorithm. Trillions of hands/sec is not out of the ordinary. Look up adrian20xx's posts on twoplustwo and PokerAI for detailed explanation.

As far as Monte Carlo goes I noticed that the bottleneck is also the deck shuffle. I've come up with this algorithm:
#define PUT_CARD_TO_BACK(X) {tmp=deck[N];deck[N--]=deck[X];deck[X]=tmp;}
//put card in the back of the deck
void shuffleDeal (int myCard1,int myCard2, int nPlayers, int*deck){
    int N=51,i,k;
    PUT_CARD_TO_BACK(myCard1);
    PUT_CARD_TO_BACK(myCard2);
    for (i=0;i<(nPlayers*2+5);i++){
        k=rand()%(N+1);
        PUT_CARD_TO_BACK(k);
    }
}

Here I have to generate only necessary amount of random numbers,given cards and randomly picked cards are put in the back of the deck in specified order and I can use them as board or hole cards like this:
#define BOARD deck[45],deck[46],deck[47],deck[48],deck[49]
#define HERO deck[50],deck[51]
#define OPP1 deck[43],deck[44]

In case of small numbers of hands needed to be evaluated (less than 100M) I think you should use exhuastive enumeration. Otherwise 100,000 of Monte Carlo iterations works just fine. The output of a program is entirely up to you depending on what you are trying to analyze. Hope I've helped in some way:)
Comment: Thanks.  I am getting some deviation on 100,000 and it does not even go away at 1 million.  I think you are correct about combin(48,5).  I need to think about how to enumerate them.  And I don't want to use a library or pre-run simulations.  I want to write a standalone poker calculator.
Comment: All combinations are enumerated like this `for(c1 = 0; c1 < 52; c1++) {  if (CardsExtracted[c1]) continue; for(c2 = c1 + 1; c2 < 52; c2++) {  if (CardsExtracted[c2]) continue; for(c3 = c2 + 1; c3 < 52; c3++) {  if (CardsExtracted[c3]) continue; for(c4 = c3 + 1; c4 < 52; c4++) {  if (CardsExtracted[c4]) continue; for(c5 = c4 + 1; c5 < 52; c5++) {  if (CardsExtracted[c5]) continue;` That's a naive way. The option is to optimize it in the way similar to pokerstove, but I don't know if it worth the effort.
Comment: Wow - somebody actually used my evaluator!  Glad you liked it.

Poker Calculator


Does tailless delta configuration retain any advantage over conventional configuration with straight wings at high subsonic speeds?

Question: For a model aircraft designed for cruise at say 0.75 Mach, do delta wings offer any benefit over straight wings. Is drag saving from elimination of the tail large enough to consider a delta configuration?
Comment: Does "straight" mean "non-swept"? Question would be improved by editing to clarify this-- as far as I can tell, all answers posted so far are actually comparing delta wings to swept wings.  Suggested edit: in body of question replace "straight wings" with "straight (non-swept) wings".  I'm not 100% sure that this is the actual intent of questioner so will leave it up to him/her--
Answer: Delta wings were studied in the early jet age for use in passenger planes but lost out to the conventional configuration. Avro in Great Britain studied a civilian version of their Avro Vulcan bomber. It was called type 722 Atlantic and could not compete with conventional designs. The tail drag of a conventional design is small when compared to the additional friction drag of the much larger wing area of a delta.
A tailless delta will need a much larger wing area for the same landing speed and have higher induced drag in cruise due to the shorter wingspan. This is slightly offset by a much better structural efficiency of the delta wing, so the empty weight of a delta airplane is quite a bit lower than that of comparable conventional designs. If ease of construction is important, the delta is far superior to a conventional design because it will not have the complex high lift devices which help the conventional design to get away with much less wing area.
Deltas shine in other areas: Their low lift curve slope makes them much better for low level flight because gusts result in smaller load factors. This is ideal for low level penetration of air defenses, but that is hardly something a passenger jet is used for. If you want to fly your model at low level and Mach 0.85, go with the delta wing. In dense air and at high speed, induced drag is minuscule, so that disadvantage of the delta falls away.
If you want to include flying wings in the comparison: A tailless straight wing at Mach 0.75 is a poor choice. There is little to compensate for Mach tuck in an overspeed event and the reflex airfoil is pretty much the opposite of what works well in transsonic flow, which is supercritical airfoils. The delta wins hands down. Its structural efficiency allows the use of thin airfoils and vortex lift gives it agreeable landing speeds even without the use of flaps.
Comment: @Abdullah ... and I edit my answer.
Comment: The question refers to a conventional configuration with straight wing
Comment: @Abdullah yes, I'll edit the question
Answer: The term "model" is one item preventing a resounding NO, but other wise evidence is strongly against the proposal.
The British V-bomber program of the 1950s produced 3 designs for high subsonic, long range (cruising) applications, the Vickers Valiant, the Handley Page Victor, and the delta Avro Vulcan.  The US had its similarly sized Boeing 707.
In terms of range, the delta Vulcan fell far short of the others.  Amazingly, the best design for cruising was not the 707, but the Handley Page Victor!  Politics, poor planning, lack of funds, and poor execution resulted in this advanced subsonic design being relegated to military use.
During operation Black Buck, it was the Victors who refueled the Vulcans on their way to the Falklands and back.  The greater strength of the Vulcan delta and its supersonic capability kept it in service longer, but it was the "ugly duckling" Victor design, with its cranked wing and wing root/fuselage jet engine air intakes, that could have given the 707 a run for its money.
The obsession of modern designers to save drag by eliminating tail volume makes about as much sense as a car saving weight by eliminating the steering wheel.
Trusting that a high subsonic "model" would have a Reynolds number greater than 10$^6$, the Handley Page or 707 design may be a good place to start.  For a slightly lower Mach specification, such as 0.55, a (relatively) tiny straight wing, such that seen on the DeHavilland Canada Dash 8 turboprop, will give best results for cruising, with traditional slats and flaps for landing.


Can you change a field label in the Django Admin application?

Question: As the title suggests. I want to be able to change the label of a single field in the admin application. I'm aware of the Form.field attribute, but how do I get my Model or ModelAdmin to pass along that information?
Answer: the verbose name of the field is the (optional) first parameter at field construction.
Comment: wondering: is this possible via admin only, when for example unregistering and reregistering a model? answer is yes, either with a custom form (drawbacks for more complex fields) or via a custom function property of the admin. looking for a more minimal solution, if possible...
Answer: If your field is a property (a method) then you should use short_description:
class Person(models.Model):
    ...

    def address_report(self, instance):
        ...
    # short_description functions like a model field's verbose_name
    address_report.short_description = "Address"

Comment: What you describe is a function that can make use of fields, not a field itself.
Answer: As Javier suggested you can use verbose name in your fields in model.py. Example as below,
class Employee(models.Model):
     name = models.CharField(max_length = 100)
     dob = models.DateField('Date Of Birth')
     doj = models.DateField(verbose_name='Date Of Joining')
     mobile=models.IntegerField(max_length = 12)
     email = models.EmailField(max_length=50)
     bill = models.BooleanField(db_index=True,default=False)
     proj = models.ForeignKey(Project, verbose_name='Project')

Here the dob,doj and proj files will display its name in admin form as per the verbose_name mentioned to those fields.
Answer: If you want change the field label only on particular admin model without changing field of the model:
class MyModelAdmin(admin.ModelAdmin):
    def get_form(self, request, obj=None, **kwargs):
        form = super().get_form(request, obj, **kwargs)
        form.base_fields["name"].label = "New label"
        return form

Comment: Might be a `not considered good answers` but it does the trick!
Comment: This answer was reviewed in the [Low Quality
Queue](https://stackoverflow.com/help/review-low-quality). Here are some
guidelines for [How do I write a good
answer?](https://stackoverflow.com/help/how-to-answer). Code only answers are
**not considered good answers**, and are likely to be downvoted and/or deleted
because they are less useful to a community of learners. Please [edit] your
answer to include an explanation of how and why the code solves the problem,
when it should be used, what its limitations are, and if possible a link to
relevant documentation.
Answer: from django.db import models

class MyClassName(models.Model):
    field_name = models.IntegerField(verbose_name='Field Caption')

Comment: It was asked for a change in the field name, not the class name. Therefore -1
Answer: As far as the changelist view is concerned, this can be done with a simple field function.
class MyModelAdmin(admin.ModelAdmin):

    list_display = (
        '_name',
        ...,
    )

    @admin.display(description='Customized field name here')
    def _name(self, obj):
        return obj.name

Answer: Building on Javier's answer; if you need one label in forms (on the front-end) and another label on admin it is best to set internal (admin) one in the model and overwrite it on forms. Admin will of course use the label in the model field automatically.
Answer: You can use verbose_name to change a field label in Django Admin as shown below.
# "models.py"

class MyModel(models.Model):                # Here
    name = models.CharField(max_length=255, verbose_name="My name")

In addition, you can put a field label to the 1st argument without verbose_name as shown below:
# "models.py"

class MyModel(models.Model):
    name = models.CharField("My name", max_length=255)
                            # Here