Bake a texture from a geometric property of the faces in a mesh?

Question: I'd like to be able to generate a Black and White texture using the distance the distance each face is from a specific point, scaled between zero and one (i.e. the closest face is a value of one, while the farthest face is a value of zero, while all other faces are linearly interpolated). The calculation for each face is easy enough to do using python, but is there a built in method of applying these values to a texture? Like a face-by-face texture bake?
Comment: One pixel per face? You can generate an image fairly easily in blender and set pixel values. Here's an example: http://blender.stackexchange.com/questions/47378/save-every-other-pixel-of-an-image-at-half-res/47594#47594
Answer:
This script will generate a vertex color map, where each face's color is represented by a grayscale value matching the normalized distance of that face's center from the cursor, inverted (closer is brighter, farther is darker).
You can run this, then bake the vertex color to a texture file to get the image texture based on the distance. You can of course also use another object instead of the 3D cursor as your distance reference.
<code>import bpy

o = bpy.context.object
d = o.data

if not d.vertex_colors:
    d.vertex_colors.new()

color_layer = d.vertex_colors["Col"]
curloc = bpy.context.scene.cursor_location

distances = [ ( p.center - curloc ).length for p in d.polygons ]

# Normalize distances
normalize      = lambda x, minX, maxX: round( ( x - minX ) / ( maxX - minX ), 2 )
minD, maxD     = min( distances ), max( distances )
distNormalized = [ 1 - normalize( v, minD, maxD ) for v in distances ]

for i, poly in enumerate( d.polygons ):
    for li in poly.loop_indices:
        color_layer.data[li].color = [ distNormalized[i] for c in 'rgb' ]
</code>
Answer: Baking with a lamp at the position of your specific point ? Approximated solution... to lower the faces orientations impact I added a transparent shader here.
The bake option can be diffuse or combine.
The result is not normalized between 0 and 1. But I hope that can help.


Have google tag manager fire event once per session

Question: I need to fire an event once per session on session start. I have googled this and tried some solutions to no avail. For clarity I am using a LAMP stack. I need it to be an event so I can set a custom metric on the event for reports
Comment: Are you OK using a cookie?
Answer:
Define what a session is. It's extremely unlikely that you want a counter that counts GA's sessions since GA already has a metric for sessions.

If your definition of session is just a time-between-actions story, then just:
2.1 Make a tag that sends the session event on every pageview
2.2 Make a tag that sets your session cookie with the expiration time set to the duration of the session.
2.3 Make CJS (or the cookie variable) that checks if that cookie is present.
2.4 Now finally make the 2.2 tag to autofire always after 2.1 fires. And add an exception for 2.1 to not fire it whenever your 2.3 CJS (or cookie) variable detects the session cookie.

Boom! Now you have a mechanism that fires the tag only if some time passed in between user interactions.

Well, ok, to be fair, I'm doing it only for pageviews in this example, but you can do it for all interactions by just making the 2.2 fire after all tags that you deem "interactional" for the purpose of your custom session tracking.
Comment: ' It's extremely unlikely that you want a counter that counts GA's sessions since GA already has a metric for sessions '. No...No that's exactly what I want. I need to associate a custom metric with the event so I can see the number of sessions per tenant. I am unable to associate custom metrics with my sessions so I do it through my events in GTM
Answer: I actually figured it out with the help of this tutorial:
https://digilitica.com/solutions-and-services/digital-marketing-solutions/fire-a-tag-just-once-per-session-only-on-first-pageviewgtm/
The only thing is their triggers are wrong. You need 2 triggers. Have it trigger on all pages but also add an exception to your tag :
Then create a GA4 event with the exact same triggers (The exception in the custom html may not be necessary but I add it to prevent the tag continuously firing)
The outcome will look something like this:
Answer: Shivanandana's solution linked to in Gary Kelly's answer is nicely done (of course I'd already checked with Simo and Julius : -)
However, in my case I wanted to make session timers - i.e., fire once X sec after session start, never again, once per session.
Since the timer is itself a trigger, this procedure with the session storage variable becomes more complicated.
My easy solution was to use the built-in Referrer variable. The timer fires after X sec on any page (matches regex ".*") but only if referrer doesn't contain my domain. Only the first page of a new session will trigger it.


Manga where the MC is transported to another world with three friends, but is betrayed and pushed off the transportation circle by one of the friends

Question: In the beginning, the main character (MC) and three of his friends are transported to a different world and the god gives them gifts and asks them to step inside the transportation circle. But one of the friends (a male) pushes him out of the circle, which makes his teleport to a different location. The god sees this all and gives the gift of the betrayer to the MC.
Comment: If someone posts a correct answer, you can accept by clicking on the checkmark by the voting buttons, as per the [tour].
Comment: Hi, welcome to the site. Was this in full colour or mostly black & white?
Answer: This sounds like Kamisama ni Kago 2-nin Bun Moraimashita. The synopsis below matches your description on all counts.

As he was being transferred to a different world with his classmates, Fubuki Amasaka was pushed out of the teleportation circle by his class bully, Yushin. When he woke up, he was alone and deep in a forest. However God, who had saw the entire thing and already warned them to stay in the circle, took Yushi's cheat skill away and gave it to Fubuki as punishment. Can Fubuki, who got two divine blessings, live in a different world safely?


Top menu link anchor href value change after online server?

Question: I was recently launch localhost server on my computer to create local website. If I create new link that add to top menu. The href value was http://localhost.com/something/something. Does this href value will change to my website name after I upload my website online ? http://mywebsite.com/something/something.
Comment: Depends on how the link is created. Some things will change, others will not. This is not going to be answerable without more detail.
Answer: Sure it will change if it was created using the default WordPress menu. Wordpress stores a site url, which is usually the domain or exact path. On your localhost it will be something like localhost/site/about and the moment you deploy your site and update your database with your domain, www.yourdomain.co.za/ - that will automatically update the rest of the pages or links, e.g. www.yourdomain.co.za/about
So, to answer your question: Yes, but only if your used the WordPress menu


Creating a module for raising class-specific errors

Question: In my rails projects, I often use this sort of behavior in my classes and models:
class Whatever

  class WhateverError < StandardError; end

  def initialize(params={})
    raise WhateverError.new("Bad params: #{params}") if condition
    # actual class code to follow
  end
end

The trouble is, this is both hugely repetitive and fairly verbose. I'd love it if I could just do this whenever I need to raise a class-specific error:
class ErrorRaiser
  include ClassErrors
  def initialize(params={})
    error("Bad params: #{params}") if condition
    error if other_condition # has default message
    # actual class code to follow
  end

  def self.class_method
    error if third_condition # class method, behaves identically
  end
end

I'm having major trouble creating such a module. My sad early attempts have tended to look something like the below, but I'm pretty confused about what's available within the scope of the module, how to dynamically create classes (within methods?) or whether I have straightforward access to the "calling" class at all.
My basic requirements are that error be both a class method and an instance method, that it be "namespaced" to the class calling it, and that it have a default message. Any thoughts/help? Is this even possible?
module ClassErrorable

  # This and the "extend" bit (theoretically) allow error to be a class method as well
  module ClassMethods
    def self.error(string=nil)
      ClassErrorable.new(string).error
    end
  end

  def self.included(base)
    set_error_class(base)
    base.extend ClassMethods
  end

  def self.set_error_class(base)
    # I'm shaky on the scoping. Do I refer to this with @ in a class method
    # but @@ in an instance method? Should I define it here with @ then?
    @@error_class = "##{base.class}Error".constantize
  end

  def self.actual_error
    # This obviously doesn't work, and in fact,
    # it raises a syntax error. How can I make my
    # constant a class inheriting from StandardError?
    @@actual_error = @@error_class < StandardError; end
  end

  def initialize(string)
    @string = string || "There's been an error!"
  end

  def error(string=nil)
    raise @@actual_error.new(string)
  end

end

Answer: How about something like this (written in pure Ruby; it could be refactored to use some Rails-specific features like .constantize):
module ClassErrorable
  module ClassMethods
    def error(message = nil)
      klass = Object::const_get(exception_class_name)
      raise klass.new(message || "There's been an error!")
    end

    def exception_class_name
      name + 'Error'
    end
  end

  def self.included(base)
    base.extend ClassMethods
    Object::const_set(base.exception_class_name, Class.new(Exception))
  end

  def error(message = nil)
    self.class.error(message)
  end
end


SSAS Reporting Services - Set specific language / translation

Question: in the data warehouse there's a default language for the measures, and I added a translation for German captions. In a Visual Studio Report Server project, when creating a query with my German OS, the cube and its measures are displayed in German language. When dragging measures to the mdx query windows, the default measure name (English) is used. That's what I expect, since when writing MDX queries I would like to use the default measure names. But when executing the query, the columns of the query result created for each measure are translated to German again. This resuls in having German columns names within my dataset, which I dont want. I'd like to have the default (English) column names.
I already tried to change the connection string to: Data Source=server;Initial Catalog=DataWarehouse;LocaleIdentifier=1033
But that doesn't help, I still see German translations.
Anyone knows how to set a specific translation?
Probably I now answer my own question:
This is what I found on the internet.
"Locale Identifier  The LCID specified MUST be supported by the operating system on which the data source object resides."
Does that mean I have to have the English language pack installed on my XP machine?
Answer: Yes, sounds like you need the english lang pack on your machine, since you are on a German OS


How to create a concrete surface texture to use as background

Question: I am trying to achieve this noisy background behind the cards. How can I recreate this effect?
Comment: Why are business cards _always_ levitating in these images?
Answer: Take a photograph of a concrete slab or purchase a photograph of concrete from any number of stock photography sites.
There's no reason to spend time and effort to recreate something if a simple photo will work. Often the photo works better anyway.
Comment: agreed: take a myPhone to Home Despot* or similar home improvement store and snap some closeups of their countertops. (*any similarity to actual products and services is coincidental)
Answer: It looks like a concrete or recycled paper texture. The best option is probably to use a Photoshop brush over a light gray background layer.
Some ideas:

Hard concrete Photoshop brushes
Concrete textures
Paper textures
Answer: I'd go with a simple tileable texture that you can expand or contract as needed. It's easy to repurpose that way and doesn't eat much disk space.
Try SubtlePatterns.com. Atle Mo creates and curates a very nice set of patterns there, some of which would work perfectly for this task.


Excel - Fromat Data after Double click and Hit Enter

Question: Hello I have Table with 8K rows and This table from xls file import to excel and When import the file I pick the column to YDM (This column Have date with persian Jalali Format like : 1399/05/29) and after import file I'm Using Format date to yyyy/mm/dd but can't use pivteTable Group date in this Column After sometime i figure out the problem is the excel didn't understand the cell have date value! after click on cells and Editable the cell and hit enter the format accepted and now my problem solve! but for 8k Rows I can't do that , So any Comment or suggestion have for me?
Comment: Sounds like you have a column of dates that are stored as text which you need to convert to numbers. Generally, this can be done with the `=DATEVALUE()` worksheet function, but that will fail on Jalali dates. There must be a way specify the date format that Excel should recognize, in this case `[$-fa-IR,16]dd/mm/yyyy;@`. I bet it's doable in PowerQuery.
Comment: @bkraines I use this method and not effected on rows other idea you have?
Comment: @FarhoodNaqizade,, you mean to say after applying new date format,,, when you try PT and group on date, it doesn't works ?? If YES,,, then U need HELPER COLUMN,,, get either Year or Month or Even Date as Helper value and use that to GROUP data,, check formula below,,, #FlexYourData has shown !!
Answer: For this I recommend just creating the columns with formulas. For example:

Year:
<code>=INT(LEFT([@YDM],4))
</code>
Month:
<code>=INT(MID([@YDM],6,2))
</code>
Day:
<code>=INT(RIGHT([@YDM],2))
</code>
Then you can use those columns in the pivot table.
Comment: This is not the answer I was expect.
Comment: "keep an open mind" https://superuser.com/help/how-to-ask
Comment: Your answer can use in answer or something like that but We need create new column . I have some data export every day and I need some straighten answer to solve the problem


Does Apache use any other dot ht files besides .htaccess and .htpasswd?

Question: I'm hardening my Apache server config and wondering if it uses any other "^.ht.+" files besides .htaccess and .htpasswd?
Comment: Rhetorical? Subjective. Unfortunately that doesn't help answer my question.
Comment: Shouldn't you be blocking web access to all dot files, regardless of what Apache uses?
Comment: The default in most Apache2 distros' configs is `` -> 403
Answer: .htaccess is the default AccessFileName used by apache. There is nothing special about `.htpasswd' just that most people use it so it makes the ACL to block access to them easier.  There is nothing that says you need to use those filenames, and if you have access to the httpd.conf file, you really shouldn't use them at all as they slow down access to the directories.  They are good to allow override access to people that don't have access to the server config.
That being said, if you haven't changed the defaults by using AccessFileName directive in your config, and have named all your password files .htpasswd than you should be good with the dotfiles.
Answer: Does Apache?  No.
The only one it does normally use is .htaccess, but that's really only due to the default of AccessFileName being AccessFileName .htaccess - change that configuration and Apache will have no special interest whatsoever in files that start with .ht.
.htpasswd isn't a normal standard, and really isn't even a good idea; the general recommendation is to keep the auth files out of your web root, since there are other ways (remote file inclusion vulnerabilities) to potentially get at the contents of the file, bypassing Apache's access restrictions.
Do other people?  Maybe.
Common usage of .ht* as "this is a restricted/inaccessible file of some kind" is expected/abused by some people/content/web applications, for many of the same reasons that .htaccess is misunderstood by many people as the "right" place to put access controls and rewrite rules, despite the fact that it's not intended for that.  So, if you disable the default behavior of <Files ~ "^\.ht"> (why would you need to do this for hardening?), make sure your content isn't abusing that file name convention to hide things.
Comment: I think the .htpasswd came up since it would be blocked by my default ACLS, and there are lots of hosting situations where you don't have access to anything outside the DocRoot. since in that scenario, .htpasswd makes sense.
Answer: here is how you can check if you're using any other .htaccess: core - Apache HTTP Server, also this is what should be used by any apache as it would prevent people accessing it:
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy All
</Files>


meaning of 'largest technical community'

Question: It is said on Stack Exchange Company Page that the company is behind the largest technical community on the Internet. How was that determined?
Comment: That's... marketese.
Comment: We defined the term "community" technically and we are the only group that fits that definition, so we are technically the largest community.
Comment: According to the [user page](http://stackoverflow.com/users), there are 1,926,000 user accounts on Stack Overflow (give or take a few socks).
Comment: @RobertHarvey HOW DID YOU KNOW IT WAS THERE!!! OMG!
Comment: What's the point of the bounty?  What are you actually expecting out of an answer?  It's a statement that can neither be proven true nor false, but makes SE look good.  What else is there to say?
Comment: I love several of the StackExchange sites, but I don't consider it a single community. It is a set of communities. I'm also not sure that it is the largest. On 2012-12-19, GitHub announced it had over 2.8 million users, and there is definite conversation and interaction that goes on there. However, it seems that StackExchange sites are more present in search engine results than GitHub. Also, it would seem that total time spent on all StackExchange sites by all users is likely greater than total time spent on GitHub by all of its users.
Comment: @RobertHarvey if it's just registered accounts, wouldn't GitHub be bigger ([3M+ users](https://github.com/blog/1470-five-years)).
Comment: Clearly it comes across as slimy market speak. Some people, probably including the bounty provider, prefer to be associated with organizations that do not make any attempt to bend the truth. Make clear statements of facts rather than unclear statements of sort-of-arguable-facts and these people will be happier.
Comment: @RobertHarvey So where's the list of the sizes of all technical communities in the world to compare that number to?
Comment: @Servy: In your back pocket.  No, really.  Have a look; it is there.
Comment: When you're writing your own marketing bumph and can define community and technical it makes little difference... the only word not open to interpretation is largest.
Comment: @Tshepang SE has 3.4 million, so at least we're almost there. ;)
Comment: There's a unicorn with a StackExchange shirt on that page, who in their right mind would have to "read" any further after that?!
Comment: @Rob I thought the mods nuked all the socks! Have you been slacking?
Answer: http://www.alexa.com/topsites/global;2
StackOverflow is #60 currently.  You could say it's market-ese, but no higher ranked site is even arguably a "technical community."  You're only rival would be sub-communities within larger sites, such as Facebook, but to my knowledge nothing like that really exists at large scale (and if it did, being at large scale, I would probably have heard of it).
In short:  It's market-ese in the sense that SE didn't really need to be rigorous to make that claim.  But any "reasonable person" attempts to be a little rigorous are consistent with their claim.  So, I don't think it's misleading or wrong or disingenuous.  Perhaps when some prominent rival (...like what?) makes that claim the two titans will start busting out metrics and rubrics and such.
I agree Alexa is not a good measure of "community size" although it made a good rubric by which to illustrate. It's not at all my intent to go through whatever metrics we can come up with; I strongly suspect SO will pass by a "reasonable person" test any metric that itself would pass a "reasonable person" test.
Regarding the word "technical" please note the full claim:

As the company behind the largest technical community on the Internet, we've been able to attract some of the top developers, sysadmins, and designers in the world.

Which very clearly puts the focus of the word "technical" on technological matters.  You could maybe sort of try to argue that IMDB counts as "technical" in the sense that it involves domain expertise - and only in the sense that they are discussing technical matters of cinematography, make-up, etc. and not movie and film knowledge in general - but the claim is clearly not interested in that liberal definition.
Comment: @returnPhaDaPhunk The exact claim is "As the company behind the largest technical community on the Internet, we've been able to attract some of the top developers, sysadmins, and designers in the world." Very clearly the focus of the word technical is on SO, SU, serverfault, etc.
Comment: @returnPhaDaPhunk Alexa is well-known, you can research their criteria yourself.  And you're missing the full point of my post.  I'm aware the metric I posted wasn't rigorous. That's my point. This wasn't done rigorously. I explicitly stated that. My point is if you come up with 10 ways to answer this question they're probably all going to point to SO as the winner. I stand by my claim. IMDB does not pass the "reasonable person" test as either being "technical" or a "community."  I don't even know where you're coming from with either of those terms applying to IMDB.
Comment: IMDB is a community of 43 million registered users. They go on this site to rate, comment and review (protip : *this is the community part*) movies, actors,directors or anything cinema related (protip : *this is the technical part*). I know Alexa is well known I was just wondering what criteria they used to judge which site is better than another to make sure it would not rule out any other technical communites. But I'm sure you knew all that.
Comment: There is like 10 different versions of google in that list. Same goes for amazon. What are the criteria used to make that list ? How do you know there is not a community bigger than SO after #98 that's not there just because of the unknown criterias used to build that list ?  Also, `but no higher ranked site is even arguably a "technical community."` : IMDB ?
Comment: @returnPhaDaPhunk see edit.
Comment: Still.. Do I have to remind you that we are talking about StackExchange here **and** that there is a [Movies & Tv](http://movies.stackexchange.com/) site ? So I guess it counts...
Comment: @returnPhaDaPhunk see edit, yet again. Anything else needed to be absolved of your downvote?
Comment: Alexa counts number of visitors to a site, and I think the majority of such visitors don't participate. That is, I don't think such a count matters when we discuss *size of community*.
Comment: @Tshepang my answer already states, "I agree Alexa is not a good measure of "community size" although it made a good rubric by which to illustrate. It's not at all my intent to go through whatever metrics we can come up with; I strongly suspect SO will pass by a "reasonable person" test any metric that itself would pass a "reasonable person" test."
Answer:
How was that determined?

It was determined by the Marketing department at Stack Exchange. You won't find a list of "largest technical communities" anywhere.
If there was one, Stack Exchange would certainly be near the top if not the top site with it's impressive near 2 million registered user accounts (note that many users have multiple accounts).
The thing is, on the company page, the words were chosen wisely.

Technical -

Having special skill or practical knowledge especially in a specific field.

Community -

An interacting population of various kinds of individuals (as species) in a common location

Both these terms are open to various interpretations and that's why they were used. Each Q/A site represents a community of regular registered users posting questions and answers related to a specific field about which you must have certain knowledge to participate. So it fits the description.
Comment: A precision that seems to be lacking here : the number of registered users isn't a number of different human people. I know some guys who don't remember their account and simply create a new one each time they ask a question. That's sad but it's hard to convince users of the benefits of having a real personal account.
Comment: @dystroy could not agree more. See edit.


How do I determine the number of changes made on a given hard disk?

Question: In Windows how do I determine how many bytes have changed on a given Hard Disk??? I don't just mean how many files changed and the sizes of those changes. I mean given a period of time, say 1 hour, what is the size of the changes written to disk?
Answer: There's no built-in mechanism for the Windows OSs you mention in your tags to do what you're asking and be byte-accurate. A driver for a given disk controller might support that (and I know some RAID controllers do), but that's as close as you're going to get to byte-accurate.
You could monitor the "write" counters on the PhysicalDisk performance object for the disk in question and probably get an approximate count, but it's not going to be byte-accurate. Fire up PERFMON and have a look.
Answer: There's probably a way thru one of the raw perfmon counters availabe via WMI see WMI performance counter types.  It'd be helpful to know why you want this data, as there may be other ways to get it (per process etc)
Answer: If you want accurate result (but not necessarily fast), you can do partition level image backups, and then write a tool that will compare them cluster by cluster or whatever resolution for change detection you want.
Important feature that you want from the OS and the file system is volume snapshotting, so that you take atomic snapshot of image no matter what's being written to disk while you're copying that image. Windows+NTFS supports that. ZFS, UFS, ext4 support that. FAT32 and ext3 do not support that.


What's the most efficient way to change the last element in a '/' delimited string

Question: I have a string object in c# with a bunch of elements delimited by '/' characters.  The string will look something like this:
"element1/element2/element3/element4"
What's the most efficient way to change the last element in the '/' delimited string?
Answer: Use string.LastIndexOf:
string s = "element1/element2/element3/element4";
s = s.Substring(0, s.LastIndexOf('/') + 1) + "foo";

Comment: heh that is exactly the idea ^^
Comment: Hey, that's a pretty clever solution. Thanks.
Answer: If this is a filename/path string, you should use the System.IO.Path for this.
Answer: is there a 'lastIndexOf' in the C# String class? ( I don't code in C# normally ), if it exists you could use that to get a reference to the last / in the string, and that / precedes the last element of your string.
Answer: Like Joel suggests.. maybe something like this:
     string path = (System.IO.Path.GetDirectoryName(@"element1/element2/element3/element4") +
        System.IO.Path.DirectorySeparatorChar + "foo");
     string new_path = path.Replace(System.IO.Path.DirectorySeparatorChar, '/');


Why total angular momentum of a closed shell zero?

Question: Question with this heading has already been asked in this site but they have nothing to do with the particular thing I am asking.You can suggest me a better heading.Now to the question. Just because for a given angular momentum state $\ell$ there are $-\ell,...,\ell$ possible magnitudes at a particular direction (and they add to zero) doesn't mean the total angular momentum of the system is zero! There are still angular momentum components in other two directions (although can't be measured simultaneously) and they would not necessarily add up to zero. So what is happening here?
Comment: hint:i think one has to look up the antisymmetric nature of the filled up states and the clue  lies there...these states are invariant under rotations.
Comment: If I describe a state by saying that it has all the $\ell=3$ single-particle states filled, then I've given a full description of a uniquely defined state, and I've done it without even referring to a coordinate system. That guarantees that the state is spherically symmetric and has angular momentum zero. So if there is a mystery, it's not why the total angular momentum is zero, it's how this plays out when you write it in a particular $(\ell,m)$ basis.
Answer: The angular momentum of a quantum state $|\Psi\rangle$ is zero if and only if $J_z|\Psi\rangle = J_+|\Psi\rangle = J_- |\Psi\rangle = 0$, where $J_z$ and $J_{\pm}$ are associated with the total angular momentum.
In the example OP is interested in, $|\Psi\rangle$ is the many-electron state of the closed shell, which can be written as
\begin{equation}
|\Psi\rangle \propto\sum_{P}(-1)^P |l, \uparrow\rangle_{P(1)} \otimes |l, \downarrow\rangle_{P(2)}\otimes |l-1,\uparrow\rangle_{P(3)} \otimes \cdots\otimes |-l, \downarrow\rangle_{P(4l+2)},
\end{equation}
where $P$ denotes permutation.
It is easy to see that $J_z|\Psi\rangle = 0$ because each term on the above has zero total angular momentum. To prove that $J_\pm|\Psi\rangle = 0$, let's consider an arbitrary term on the RHS of the above. Here, an attempt to raise or lower the orbital or spin angular momentum of any electron will result in two electrons having exactly the same set of quantum numbers. Summing over such a term over all possible permutations with the sign $(-1)^P$ will yield zero.
(In fact, one can prove that the total orbital angular momentum and the total spin angular momentum separately vanish.)
Answer: Something that is spherically symmetric has zero angular momentum.  Note that:
$$\sum_{m=-1}^l{|Y_l^m(\theta, \phi)|^2}=\frac{2l+1}{4\pi}$$
The L.H.S represents the total probability distribution. It is the incoherent summation over the probability distributions of individual states in a closed shell (fixed $l$, all $m$ filled).
The R.H.S has no angular dependence, so a closed shell is spherically symmetric. It is a scalar--invariant under rotations. (Moreover, it represents the uniform distribution of $2l+1$ particles over $4\pi$ steradians.)


Can a Toshiba HG6 128 GB M.2 be upgraded to a Samsung 970 PRO 512GB M.2 in an MSI GL72-7RD laptop?

Question: My MSI GL72-7RD laptop has a Toshiba HG6 128 GB M.2 (2280) SSD Drive, and I want upgrade it with a Samsung 970 PRO 512GB - NVMe PCIe M.2 2280 SSD (MZ-V7P512BW), but I don't know if it will work since it seems to have a different socket connector.
Answer: Yes, MSI GL72 7RD supports SATA and NVMe in its M.2 slot.
From the manufacturer specifications we get:

SSD: 1x M.2 SSD Combo (NVMe PCIe Gen3 x4 / SATA )

The Toshiba HG6 128GB you have now is SATA; the Samsung 970 PRO 512GB you want to buy is NVMe. Different connectors that fit the same socket, not different sockets.


Grant android app permission to connect to "unverified server"

Question: I am trying to put ads in an AIR for Android app. I am hosting the add in an html on my website (which is hosted by godaddy, but I have total control), then loading that html in a StageWebView object (the AIR equivalent of an iframe, kind of) which is in the app.
This works!
The ad displays beautifully on the phone, but I get this popup each time the app is run:
"The server that the application is connecting to is unverified.
Server: http://www.mywebsite.com/ad.html
Certificate:
Issue To:
Common Name: www.google.com
Organizational unit:
Issued By: Thawte Consulting (Pty) Ltd. [Pretty sure this company owns/is a partner of godaddy]
Organizational unit:

Trust this server and make the connection?
[button 1.]Trust for Session. [button 2.]Cancel
"
Strangely, the ad is already loaded when this popup appears. If I press cancel, the app does not break (and the ad is clickable!), but the same popup will appear if the app tries to grab a new ad by reloading the ad.html page. Again, the popup appears seemingly AFTER the new ad has loaded!
This happens if I try to load some other pages, like http://www.questionablecontent.net, but not if I load http://www.stackoverflow.com or a https page like google.
I cannot tell if it is AIR creating the popup or android, but I'm pretty sure it's Android.My android manifest has only two permissions, INTERNET and ACCESS_NETWORK_STATE.
I have an HTC Incredible 2 on verizon.
I'm open to ANY fix that jsut gets this popup gone!
Answer: You are having an issue with a CA certificate.  Probably the CA that verifies your domain is not installed, or at least not visible to Adobe AIR.  I don't know if it will work on Android, but here is a description of how to install the certificate on AIR for OpenSuSE:  http://rachaelandtom.info/content/remove-unverified-server-pop-air


Husband and wife for hundreds of times of consecutive rebirth. How?

Question: In Theravada Buddhism, once a person dies he or she will be reborn immediately. Each person dies at a different time. How is it possible for a husband and a wife to meet again in the future consecutively for hundreds of times?
Comment: In Theravada Buddhism, once people die they take rebirth instantly. Maybe someone from this forum can confirm this.
Comment: From what context does this question arise? I don't remember Theravada Buddhism specifically saying a person is reborn immediately unless the intermediate body counts as "immediate."
Comment: I don't fully understand all the technical points to it, but it's not immediately, there are a few thought moments that occur, several different degrees of consciousness that arise, before consciousness arises in a new being. So it isn't immediate, but it is rather quick, as compared to something like reincarnation in Tibetan Buddhism. And AFAIK, there isn't anything like an "intermediate body".
Comment: Why would a husband and a wife meet again in the future consecutively for hundreds of times?
Comment: "Whatever living beings there may be — feeble or strong (or the seekers and the attained) long, stout, or of medium size, short, small, large, those seen or those unseen, those dwelling far or near, those who are born as well as *those yet to be born* — may all beings have happy minds.
Comment: The matter is a controversial because commentarial position isn't what is seemingly apparent based on the Sutta.
Comment: Maybe you will profit more from seeking an answer outside the bounds of the school. I have and I can say that there is more. Let me know if you want to pick my brain.
Answer:
Husband and wife for hundreds of times of consecutive rebirth. How?

In AN 4:55 - The Same in Living, the Buddha visits a married couple in their residence. Here he is given alms food whereafter he gives a teaching to the householders.
Both householdes, Nakulapitā and Nakulamātā, asks the Buddha how they can remain together in this life and meet and be together in future lives as well.
The Buddha teaches: "Householders, if both husband and wife wish to see one another not only in this present life but also in future lives, they should have the same faith, the same virtuous behavior, the same generosity, and the same wisdom. Then they will see one another not only in this present life but also in future lives."
Below is the quoted sutta.

The Same in Living (1)

On one occasion the Blessed One was dwelling among the Bhaggas in Suṃsumāragira in the deer park at Bhesakalā Grove. Then, in the morning, the Blessed One dressed, took his bowl and robe, and went to the residence of the householder Nakulapitā, where he sat down in the prepared seat. Then the householder Nakulapitā and the housewife Nakulamātā approached the Blessed One, paid homage to him, and sat down to one side. The householder Nakulapitā then said to the Blessed One:
"Bhante, since I was young, when the young girl Nakulamātā was given to me in marriage, I do not recall ever transgressing against her even in thought, much less by deed. We wish, Bhante, to see one another not only in this present life but also in future lives."
The housewife Nakulamātā in turn said to the Blessed One: "Bhante, since I was a young girl given to the young householder Nakulapitā in marriage, I do not recall ever transgressing against him even in thought, much less by deed. We wish, Bhante, to see one another not only in this present life but also in future lives."
"Householders, if both husband and wife wish to see one another not only in this present life but also in future lives, they should have the same faith, the same virtuous behavior, the same generosity, and the same wisdom. Then they will see one another not only in this present life but also in future lives."
Both husband and wife are endowed with faith,
  charitable and self-controlled,
  living their lives righteously,
  addressing each other with pleasant words,
Then many benefits accrue to them
  and they dwell at ease.
  Their enemies are saddened
  when both are the same in virtue.
Having practiced the Dhamma here,
  the same in virtuous behavior and observances,
  delighting after death in a deva world,
  they rejoice, enjoying sensual pleasures.
Answer: Usually wife is younger than husband. So they do not need to die at the same time to be marry on the next life. The real difficult part of here is to born in same world (for example both become humans) in a manner that they meet again.
No one can control this and no one can guarantee that they will meet again. (But there can be people who can tell whether they are going to meet again or not.) It's Karma which going to decide all.
For your reference, this is how rebirth happens as of my understanding. I am calling 'thought' a single 'Sitha'. Correct word is not thought. But I don't know what it is.
When a person is about to die, one of three things comes to his mind.

'Karma Nimiththa' This is either tools, people or  animals, helped to do the Karma caused to next life.
'Gathi nimiththa' This is something related to next life he is about to reborn.
'Karma' This is Karma itself, which caused to next life.

Once this thought comes, he begins to think in that direction. When the last thought of this life ends, the next thought of the same thought generation will generate on the body of the new life. This is saying person go to a new life. There is no intermediate body and nothing goes to next life from this life. Just a connection between the generation of thoughts.
Comment: Speaking of an intermediate body is conventional, or else all communication breaks down and then I claim that you may not speak of a self or of self-possessed objects. What happens after death, I'm told is similar to the process of going to sleep, presumably there is some period of "bardo" where one would probably be between the last life and the next one. At which point they would have an intermediate body, assuming they are fettered with such beliefs. Also controlled rebirth is possible
Comment: There is a self and there isn't a self. Both these terms are correct. And according to 'Theravada', there can not be any period between last and next lives. Only connection between last and next lives is it's same thought generation. As I mentioned in the answer, once the last thought ends, next thought of same thought generation will be in the new body. That is the only connection between lives.
Comment: They are only correct if interpreted correctly otherwise they can both be wrong. Plus there will not yet be a new body... since the description I have heard is that upon death the false mind seeks out a pair having sex, if they are to be a boy they love the woman and hate the man and vice versa for woman, Not disagreeing though that the connection is the stream of thoughts in the mind-ground.
Answer: I don't think everyone will reborn when he or she dies. As far as i know, there are also many places like heavens and hells, not just this human life. For couples to meet again in later lives, they have to do good deeds together or say prayers. That shows great bond between them. But it also does not make sure to be born again together in consecutive life.
Answer: Time is different in the heaven realms and animal realms. This is a Buddhist cosmological fact that I can reference the Buddhist scholar Brian Ruhe's books and youtube videos for... and then can find which Theravadin sutra talks about it (it should be the one about The Thirty-One Planes of Existence).
Compared to the human plane, time is faster in the lower planes and much slower in the higher planes (1 day in the heavenly realm is equal to thousands of days in the human [or was it a million?]).
Anyway, to answer your question, that is how; one partner may have spent some time in animal realm while the other may have spent some time in heaven and then they both sank to human realm at same time, etc.
This cycle of break-up and getting back together happened again and again hundreds of times.
[Sounds like my last relationship.]
I can give you a precise answer if you have a textual reference where such a story came from.
If such a story was from gossip alone, then you may know that it came from the Buddhist cosmological time difference fact that I stated above.
Comment: I think this is true, husband and wife do not always have to be at the same age at the time of marriage, the same thing as death. There are reasons why they can be together, for example, similarity of characters, habits and kamma. Not to mention the 'kamma of relationship/association' that has been built in the past.  Samajivina Sutta states very clearly both husband and wife who are in tune in generosity, virtue, morality, conviction and practice will meet not only in this present life but also in the future life.
Comment: From my understanding, people who are in tune in those qualities are most likely create similar kamma.


Column of lists inside a dataframe in R

Question: Lets have the following dataframe inside R:
df <- data.frame(sample=rnorm(1,0,1),params=I(list(list(mean=0,sd=1,dist="Normal"))))
df <- rbind(df,data.frame(sample=rgamma(1,5,5),params=I(list(list(shape=5,rate=5,dist="Gamma")))))
df <- rbind(df,data.frame(sample=rbinom(1,7,0.7),params=I(list(list(size=7,prob=0.7,dist="Binomial")))))
df <- rbind(df,data.frame(sample=rnorm(1,2,3),params=I(list(list(mean=2,sd=3,dist="Normal")))))
df <- rbind(df,data.frame(sample=rt(1,3),params=I(list(list(df=3,dist="Student-T")))))

The first column contains a random number of a probability distribution and the second column stores a list with its parameters and name.
The dataframe df looks like:
      sample       params
1 0.85102972 0, 1, Normal
2 0.67313218  5, 5, Gamma
3 3.00000000 7, 0.7, ....
4 0.08488487 2, 3, Normal
5 0.95025523 3, Student-T

Q1: How can I have the list of name distributions for all records? df$params$dist does not work. For a single record is easy, for example the third one: df$params[[3]]$dist
Q2: Is there any alternative way of storing data like this? something like a multi-dimensional dataframe? I do not want to add columns for each parameter because it will scatter the dataframe with missing values.
Answer: It's probably more natural to store information like this in a pure list structure, than in a data frame:
distList <- list(normal = list(sample=rnorm(1,0,1),params=list(mean=0,sd=1,dist="Normal")),
                    gamma = list(sample=rgamma(1,5,5),params=list(shape=5,rate=5,dist="Gamma")),
                    binom = list(sample=rbinom(1,7,0.7),params=list(size=7,prob=0.7,dist="Binomial")),
                    normal2 = list(sample=rnorm(1,2,3),params=list(mean=2,sd=3,dist="Normal")),
                    tdist = list(sample=rt(1,3),params=list(df=3,dist="Student-T")))

And then if you want to extract just the distribution name from each, we can use sapply to loop over the list and extract just that piece:
sapply(distList,function(x) x[[2]]$dist)
     normal       gamma       binom     normal2       tdist
   "Normal"     "Gamma"  "Binomial"    "Normal" "Student-T"

Answer: If you absolutely must store this information in a data frame, one way of doing so springs to mind. You're currently using a params column in your data frame to store the parameters associated with the distributions. Perhaps a better way of doing this would be to (i) identify the maximum number of parameters that you'll need for any distribution, (ii) store the distribution names in a field called df$distribution, and (iii) store the parameters in dedicated parameter columns, the meaning of which will have to be decided upon based on the type of distribution.
For instance, any row with df$distribution = 'Normal' should have df$param1 =  and df$param2 = . A row with df$distribution='Student' should have df$param1 =  and df$param2 = NA. Something like the following:
dg <- data.frame(sample=rnorm(1, 0, 1), distribution='Normal',
                 param1=0, param2=1)
dg <- rbind(dg, data.frame(sample=rgamma(1, 5, 5),
            distribution='Gamma', param1=5, param2=5))
dg <- rbind(dg, data.frame(sample=rt(1, 3), distribution='Student',
            param1=3, param2=NA))

It's ugly, but it will give you what you want. And don't worry about the missing values; missing values are a fact of life when dealing with non-trivial data frames. They can be dealt with easily in R by appropriate use of things like na.rm and complete.cases().
Answer: Based on the data frame you have above,
sapply(df$params,"[[","dist")

(or lapply if you prefer) would work.
I would probably put at least the names of the distributions in their own column, even if you want the parameters to be in variable-length lists.

Column of lists inside a dataframe in R


Tate module of an elliptic curve is Hodge-Tate

Question: Let $E$ be an elliptic curve over $\mathbb{Q}_p$, and let $T_p(E)$ be its $p$-adic Tate module. Is there a simple way of seeing that $V_p(E):= T_p(E)\otimes_{\mathbb{Z}_p}\mathbb{Q}_p$ is a Hodge-Tate representation,i.e., $B_{HT}$ admissible? Or maybe equivalently, is there a direct way of computing the Sen's operator for $V_p(E)\otimes \mathbb{C}_p$ when considered as a $\mathbb{C}_p$ representation of $G_{\mathbb{Q}_p}$. To clarify what I mean by simple, I wanted to avoid using Tate's general result on p-divisible groups or the complete machinary of hodge decomposition for etale cohomology of abelian varieties.
Comment: You should ask this on MathOverflow.
Answer: You could read this article by Berger , especially pages 17-18-19.
Comment: That discussion only treats the special case of a semistable elliptic curve, where the question reduces to Kummer theory.  In fact, a similar approach, using Serre--Tate theory, will work for ordinary good reduction elliptic curves.    For elliptic curves with super singular reduction, though, whose $p$-divisible group is a height $2$ formal group, it is less obvious that one can find a direct treatment that is more efficient than following Tate's general approach.


Trying to text someone with a Samsung Galaxy using a MacBook without an iPhone

Question: I have gotten a MacBook for my high school, and as I have no phone or other portable mobile devices, it makes it really complicated to contact my parents, when they don't have apple phones, and especially when the only way I know is email. Help and suggestions would be gratefully accepted.
Comment: Which country are you in? (and are your parents in the same country?) In some places, you can just send SMS text messages for free from your Mac to your parent's phone.
Comment: @jksoegaard I should qualify that "from your Mac" does not mean "from the iMessages app built-in to macOS", but from some third-party service like Skype.
Comment: I am in the U.S., and my parents are as well. I'll make sure to look for those 3rd party apps.
Answer: One possibility is using SMS. In some places you have free, web-based SMS services that will allow you to text any phone in the country for free. In other places you have to pay a small amount to be able to do so.
Another is using third party apps such as Skype, WhatsApp or Signal.
Comment: Thanks so much for all the options, I'll make sure to try them out! By the way, I am in the U.S., and don't plan to move to another country anytime soon. :)
Answer: Your family could do far worse than choosing signal to message each other.

https://signal.org/blog/standalone-signal-desktop/

Mac, Windows, Linux, Android and iOS all have official apps and support.
Answer: You could use an SMS Gateway to text your parents from an email address.
For example, if your parents are in the US and have AT&T cell service, you could send an email to email@example.com. The person with phone number (555) 555-1234 will get a text with the sender, body, and subject of your email.
Note that this will not work from your school email if your school blocks emails from students to outside addresses.
Comment: Wow! I didn't know that! Thanks so much. I think I'll try that right now!


Windows-like buttons in Firefox when on fullscreen mode

Question: When I use Firefox in fullscreen-mode (by pressing f11) and I hover my mouse on the top of the screen to display the navigation/bookmarks bar, the app shows minimise/maximise/quit buttons that clearly belong to Windows (see image below). Even more interestingly, they work like you expect them to work. This isn't bothering me in any way, but I'd like to know why this is possible and how Windows-style buttons have ended up in Linux/eOS.
Answer: Explanation comes from your theme. I suppose you are not using the default Elementary OS themes, but the different one.
There is also explanation about the firefox title bar below.
How to get rid of huge firefox title bar.
Just click the top-right menu (the hamburger(☰) menu) > Customize, you'll be at the Customize Firefox page, on the bottom-left most, unchecked the Title Bar.
That's it

Source: https://askubuntu.com/questions/979968/how-to-hide-title-bar-in-firefox-57-quantum
Additionally if you will install Elementary OS Tweaks and open it, go to Appearance, you will have a layout which can be changed. You can choose from the dropdown menu which layout you want to use.

Eventually Firefox has these buttons built-in. Will check this later and update thread.


How to configure Gnome 3 on Ubuntu-19.04 Virtual Machine running on my Google Cloud Platform?

Question: I am able to follow these links to configure Gnome 2 onto my VM in GCP successfully.
Installing and configuring Ubuntu Desktop for Google Cloud Platform
Graphical user interface (GUI) for Google Compute Engine instance
I am using Remmina on my ubuntu-19.04 on my local pc to establish a VNC connection to the VM on google cloud which is running a tighvncserver.
This is how my present desktop (inside GCP VM) looks like from Remmina. GNOME 2 Shell
This is how I want it to look like GNOME 3 Desktop
We are required to edit the ~/.vnc/xstartup script for the VNC session to work properly as described in the links above. But these configurations are old enough and using metacity which renders a Gnome2 session.
How to run a Gnome 3 (complete desktop experience) on my Google Cloud Virtual Machine which looks and feels exactly like Ubuntu 19.04.
What changes do I need to make to the **~/.vnc/xstartup **script to be able to render a Gnome 3 session?
Answer:
[enter image description here][1]
Try This:
    [1]: https://i.stack.imgur.com/uIUa0.png
Comment: I suggest you use code markdown in your answer rather than linking to an image of the code on an external site. The answer will be much simpler to use and and search for, and it will remain available here independently of the availability of the external resource. Additionally linking to the original source is always good if you are referencing someone else's work.


Electrostatic potential energy of a system vs individual charge

Question: If the term electrostatic potential energy is used to define the electric potential energy of the system and not an individiual charge in a closed system of two/more charged particles, how is it possible to find the electric potential energy of an individual charge using V= $\frac{U}{q}$ where V is the electric potential at a point due to the electric field, U is the electric potential energy and q is the magnitude of charge. Won't U in this case refer to the electric potential energy of the charge q?
Answer: Quite simply, because $V(r)$ is due to the other charge or charges in the system.  You can't have a $V$ without a charge to create it.
The potential energy that you calculate using $U=qV$ is the potential energy of the system comprising the charges that create $V$, and the charge who's value is $q$.
Comment: Worth adding that the converse is sometimes helpful. To get the potential energy of the system, you add one charge at a time. The work done to add one more charge keeps getting harder - an intuitive way to explain that for some configurations potential energy has a $Q^2$ term...
Comment: Just to clarify, if I had a system consisting of two particles of charge q1 and q2 and q1>>q2; if I did some work to move q2 away from q1 such that it no longer experiences force due to q1, would I be changing the potential energy of q2, if I use U=qV
Comment: @GreenApple The potential energy is "stored" in the system ie **both charges** and so you cannot say that one charge has a certain amount of the potential energy and the other charge has another amount of potential energy.
Comment: But are there any cases where I can say that the electrostatic potential energy of only one charge has changed? ( example in a ball earth system we usually state that the ball's gravitational potential energy has changed, when the balls position relative to earth changes since the earth is so massive compared to the ball)
Comment: We *usually* say that the ball's potential energy has changed, but that's shorthand.   It's not correct, but as you point out, it is used and is convenient.  I can tell you that novice students sometimes take it too seriously resulting in a poor idea of what potential energy is.  And almost every textbook introduces potential energy in that incorrect way,  so beginners' first introduction to the concept is flawed, and first impressions stick.  But if the charges that create $V$ are fixed, you can *loosely* say that the PE of the charge changes.  Example: parallel plate capacitor.
Comment: If potential of a charge changes(increases) due to other charges then its kinetic energy should decrease?
Answer: AS @garyp has stated the potential (pun!) for confusion about potential energy can start early in ones education.
It is difficult enough to explain what potential energy is and that is perhaps why the extra layer of sophistication is omitted?
Consider the gravitational potential energy possessed by ball and Earth system.
If the Earth is not present the ball does not experience the force of gravitational attraction.
If equal magnitude and opposite direction forces are applied on the ball and the Earth to make their separation increase the work done by those forces increases the gravitational potential of the ball and Earth system.
If the ball is allowed to fall the gravitational potential of the ball and Earth system decreases and the kinetic energy of the ball and the Earth increases.
But what do you actually "observe"?
You observe the ball falling down towards the Earth but you do not observe the Earth moving up towards the ball although it has to to make sure that momentum of the ball and Earth system is conserved.
$M_{\rm Earth}\, v _{\rm Earth} + m_{\rm ball} V_{\rm ball} = 0$ where $M_{\rm Earth} \gg m_{\rm ball}$ hence $v _{\rm Earth} \ll V_{\rm ball}$.
So when you write
$\text{gpe lost by ball} = \text{kinetic energy gained by ball}$
you are really writing a shorthand version of
$\text{gpe lost by ball & Earth} = \text{kinetic energy gained by ball} + \text{kinetic energy gained by Earth} $
acknowledging the fact that the $\text{kinetic energy gained by Earth} $ is negligible compared with the $\text{kinetic energy gained by Earth}$.
This can also happen when you are doing electrostatics experiments where one of the charge carriers is "attached" to the Earth and the other charge carrier is much less massive and can be "observed" to move so you write
$\text{electric pe lost by electron} = \text{kinetic energy gained by electron}$
although the electron on its own cannot have have electric potential energy, there must be a least one other charge present.


Can we see the colorful patches or the strip of milky way galaxy with reflector telescopes?

Question: As reflector telescopes gather light and make dimmer images brighter, so if I viewed through telescope with 1x magnification or viewed the horizon ,would I see the strip of milky way?
Comment: I am unsure what you are asking here. You can see the Milky Way with the naked eye,. so why do you think a telescope would be any different?
Comment: I understand this as being about surface brightness, the law of entendue and the impossibility of making an image that is brighter than a source. See https://physics.stackexchange.com/questions/88821/is-it-possible-to-build-an-optical-system-that-increases-the-perceived-surface-b for context
Answer: A telescope (or any system of lenses and mirrors) can't produce an image that is brighter than the source.  So while a telescope can gather more light, it can never raise the surface brightness of a source.  Most nebulae do not look brightly coloured in an eyepiece, because their surface brightness is low.
There are significant biological factors here, in how your eyes detect colour and how your brain interprets the signal from your eyes.  But you cannot create a 1x telescope that makes the image you see brighter, but not larger.
(Such a thing would be "magic". If you could make an image brighter, you are creating energy from nothing)
To create the coloured images that you see in books or on the internet, long-period photography must be used.


Why carbonyl groups are strong benzene deactivating group for electrophillic aromatic substitution?

Question:
In carbonyl group there is a resonance avaibility and also due to inductive effect it can also withdraw electron from benzene ring . As, resonance(e- donating chracter) dominates than Inductive effect , it must be a Benzene activating group.
but accorting to  L.G Wade carbony groups are strong benzene deactivating group for Electrophillic Aromatic substitution
Where am I wrong ? Explain.
Comment: Activating for nucleophilic substitution and deactivating for electrophilic aromatic substitution.
Comment: @Archer I think you got it backwards. Activating is electron-donating, and deactivating is electron-withdrawing.
Answer: A carbonyl group such as an aldehyde is a deactivating group as it withdraws electron density by both the inductive effect (through the sigma bonds) and the resonance effect which involves pi systems.
Here are three resonance forms which show how the aldehyde group takes electron density from the benzene ring in benzaldehyde. There are more resonance forms and some different but related ones account for the reduction in the stability of the cationic intermidate in an aromatic substitution reaction.


Which microfilm shavers are kosher?

Question: I am getting ready for yom tov and got a new shaver, a braun series 7-740s. Does anyone know if those shavers are kosher? Should I return it?
Comment: Could you describe the mechanism by which it shaves? Or at least provide a link?
Comment: @mevaqesh Hashem created [Google](http://bfy.tw/7zXQ) for a reason.   Second result.
Comment: @LiquidMetal That was my thought exactly. If information vital for answering the question is so readily available, why doesn't the OP provide it?
Answer: Based on Koshershaver.org, there is a very, very, good chance that your braun 7-740s, as well as any other microfilm shaver, poses a halachic issue, and you should replace it with something else.  There is much debate on this topic, and you should definitely consult your personal rav.  However, it is quite likely that he will advise you to get something else - not microfoil.
From Koshershaver.org:

Using Micro-Screen Foil Shavers
The Terumas Hadeshen, quoted by the Rema, maintains that when shaving
  with scissors, a person should be extremely careful to either hold the
  bottom blade still, using only the top blade to cut his hair, or to
  use scissors where the bottom blade is incapable of cutting by itself.
  The reason for this is because extra precaution should be taken to
  prevent mistakenly shaving solely with the bottom blade, even a minute
  amount, since this is equivalent to using a razor.32
There is a possibility that in micro-screen foil shavers, the
  micro-screen foil itself has cutting edges that can cut by themselves.
  This screen is comparable to the bottom blade of scissors, since it
  touches one's skin. This might be problematic according to the Terumas
  Hadeshen's chumrah, requiring one to take the necessary precautions to
  be certain that there is no possibility that the blade touching one's
  face will cut by itself.33
In fact, the company that manufactures the micro-screen foil shavers
  claims that the foil itself has the ability to cut. The shaver is
  marketed as having cutting edges which are approximately twenty times
  thinner than a razor, and are very sharp. Their claim is that it is
  actually the outer screen that does the cutting by itself at skin
  level, and the inner mechanism just grinds the hair once it is already
  detached and inside the shaver. If this is indeed the case, such a
  shaver would be no different than a razor, since it uses one blade to
  cut the hair flush against the skin. Therefore, one must ascertain
  that his shaver has a screen that is incapable of cutting by itself.34

They also specifically mention braun shavers on their FAQ page:

What about other NON Philips Norelco (Remington, Braun, etc.) electric
  shavers? ... It is important to
  stress that ALL foil and 'Microscreen' shavers, (for example: ALL the
  BRAUN brand shavers, the ENTIRE Remington MicroScreen line of shavers)
  as well as other brand 'FOIL' shavers, may also raise serious Halachic
  issues. Rabbi Avrohom Blumenkrantz ZT'L writes the following in his
  Pesach sefer "...The new problem being discussed today is that the
  micro screen shields are so thin that they on their own have a cutting
  ability. We tested it and found out that if you bring a hair through
  the holes in the micro screen shield and by just moving the hair
  without to much pressure it could cut the hair. This is true for any
  brand of Micro Screen shield. It is interesting to note that Remington
  Dual Foil Shaver, it is advertised as such: "Microscreen CUTTING
  system with two ultra thin flexible foils and 112 diamond hooked
  Cutting edges" The problem is two-fold: 1) the outside screen can cut
  without the scissors action and 2) both blades are cutting and based
  on what we wrote above it is not good." SEE BELOW FOR OTHER HALACHIC
  OPINIONS
Comment: I'm assuming you mean to eat. (heh heh)  I'm also assuming they didn't tell you why or who paskens that?
Comment: Thanks for all of your detailed answers. I just called the Star-k and they told me that all Braun Microscreen shavers are kosher. Thanks again for your analysis.
Comment: I asked a reliable Bais Din and they recommend that I call Star-K. I'm guessing Rabbi Heineman, the posek there paskened and unfortunately they didn't explain why. Honestly, they didn't even ask me which type which was a bit surprising. Just said all Brauns are good.

Which microfilm shavers are kosher?


Upper and lower bounds in rounding to 1 Decimal place

Question: I have a measurement $a=8.3$cm to 1 d.p. I'd like to find the upper bound of this. Why is the upper bound $8.35$cm? not $8.3\dot{4}$cm? Surely 8.35 rounds to 8.4cm?
And the lower bound $8.25$cm not $8.24\dot{9}$cm?
Comment: Then what about $8.3499999999$?
Answer: The upper bound is 8.35 cm because anything less than 8.35 will round to 8.3, but anything 8.35 or greater will round to 8.4. 8.35 itself does not round to 8.3, but it is the smallest such number, or the least upper bound.
Similarly, the lower bound is 8.25 because anything less than 8.25 rounds to 8.2, and 8.25 rounds to 8.3, so 8.25 is the lower bound (And also the minimum).
Also, your question about $8.25$ and $8.24\dot9$ doesn't really make much sense -- those two decimals represent the same real number.
Comment: The upper bound is simply the value $x$ such that any value that rounds to 8.3 is less than $x$. The issue here is that there is no maximum value which rounds to 8.3. If you give me some value $y < 8.35$ that rounds to 8.3, and claim that it is the maximum, I can always disprove it by taking the value $\frac{y + 8.35}{2}$, which is greater than y, but still less than 8.35, and so still rounds to 8.3. While there is no maximum, there is still an upper bound, because 8.35 is greater than all of these values.
Comment: ie $a\in(8.25,8.35)$? But am I not looking for $\displaystyle a\in[a_-,a_+]$
Comment: I'm not sure what you mean by $[a_\_,a_+]$. The numbers that round to 8.3 will be $a \in [8.25, 8.35)$, if that helps.
Comment: Yes that's clear me, but my 15year olds don't know what that notation means. They're asking in essence: 8.35 does not belong to the set of values that round to 8.3. So why should I write it as being an upper bound? The question perhaps boils down to my understanding of the words 'upper bound'. the highest value which will round to 8.3, i.e  $[8.25, 8.3\dot{4}]$? Hence it comes with the caveat that I must write $a\in[8.25,8.35)$?
Answer: The measurement could have been $3.3487$. That would have been rounded to $3.3$, so we cannot conclude that the original measurement was $3.34$ or below.
Comment: I don't understand this. Presumably 8.3487? Surely that rounds to 8.35? And subsequently to 8.4? ie $a\in(8.25,8.35)$ But am I not looking for $a\in[a_-,a_+]$
Comment: Sorry, bad typo. I intended $3.3487$.
Answer: Its because the upper bounds of 8.3 is 8.349999999999.... So you round it up to 2 decimal places which is 8.35.


Website rendering in ie7 mode, but the browser looks like it's ie8?

Question:
A client of mine just sent in a screenshot that one of his staff members took, with the formatting of their website totally broken.
If he were in IE7 I'd understand, but it looks like the screenshot was sent was of an iE9+ browser.
Anyone know what might be going on? it doesn't look like the compatibility mode is clicked in, shouldn't CSS3 be rendering correctly on this browser?
Answer: Screenshot looks like IE8.   You can reference this site for CSS compatibility: http://caniuse.com/
For CSS3 compatibility with IE7 or IE8, you can use a JS to 'mimic' some properties.   More information here: https://code.google.com/p/ie7-js/


Why did Eve say that "touching" the Tree of Knowledge of Good and Evil would kill you?

Question: The reason for my question is there seems to be a change from what the scripture states as to what God told Adam about the same tree. I couldn't find where God specifically told Adam that touching it would kill him. Perhaps I'm not looking in the right place. Depending on the answer, I may have a secondary observation/conjecture and associated question.
Comment: Genesis 3:3 quotes Eve as saying: "*of the fruit of the tree which is in the midst of the garden, God has said, 'You shall not eat it, nor shall you touch it, lest you die.'*". So she said it because that's what God had told her. The word "touch" doesn't occur anywhere else in the first few chapters of Genesis. ¶ You might try using Bible software to search the scriptures.  E.g. [NKJV Search Results for "touch\*"](https://www.blueletterbible.org/search/search.cfm?Criteria=touch%2A&t=NKJV#s=s_primary_0_1) shows all verses that contain any words beginning with "touch".
Answer: God instructs Adam about the tree:

And the LORD God commanded the man, saying, "Of every tree of the garden you may freely eat;
but of the tree of the knowledge of good and evil you shall not eat, for in the day that you eat of it you shall surely die."
— Genesis 2:16–17

Later, Eve talks to the serpent:

And the woman said to the serpent, "We may eat the fruit of the trees of the garden;
but of the fruit of the tree which is in the midst of the garden, God has said, 'You shall not eat it, nor shall you touch it, lest you die.' "
— Genesis 3:2–3

The Question says: "I couldn't find where God specifically told Adam that touching it would kill him.".
That's because there is no record of such a conversation.
Here are some possible explanations for this, in order of increasing likelihood:

Eve deliberately lied to the serpent.
Adam told Eve what God had said, but she misheard or misunderstood some of it.
Adam told Eve what God had said, but he exaggerated it to make sure she would stay away from the tree.
God had conversations, other than 2:16–17, with Adam and Eve about the tree, but the Bible didn't record them.

There are many other possible explanations.
But, the true answer wouldn't affect doctrine or salvation, so it's not recorded and is not something we will ever know.
We can only speculate about it and express opinions.
Given that there was little to do other than name animals and tend the garden, the tree was by far the most significant thing in their world.
It seems highly unlikely that God wouldn't have mentioned it many times on other, unrecorded occasions.
He could have even said something like "If you so much as touch the fruit you might die.", just to impress on them how important it was for them to avoid that tree.
We'll never know for sure the details of what did happen, but I think we can be reasonably certain that Eve believed what she told the serpent, and that we have no reasonable grounds for thinking that it wasn't in fact true.
Answer: God's command to Adam regarding the tree of the knowledge of good and evil (Gen. 2:16-17) was given before Eve was created (Gen. 2:22).  Therefore there are a limited number of possibilities as to the source of Eve's 'do not touch' addition and Scripture is silent about this in a direct fashion.
Did Adam relay God's command to Eve with this addition?  We do not know but it is somewhat unlikely.
Did God have another conversation with Eve and add something that He omitted when commanding Adam?  We do not know but it is highly unlikely.
Did Eve add this part in of her own accord?  We do not know but it is most likely.
What we do know is that Eve was deceived while Adam was not:

For Adam was first formed, then Eve. And Adam was not deceived, but the woman being deceived was in the transgression. - 1 Timothy 2:13-14

Paul uses this as the basis of his teaching that women should not hold teaching authority in the Church and, in doing so, establishes it as fact.  This fact, then,  makes it unlikely that God had a separate conversation with Eve, giving her even more detail, because that would have made her deception even less likely.  It also makes it less likely that Adam included 'touching' in his passing on to Eve of God's prohibition because this would implicate Adam in Eve's deception while Scripture clearly implicates the serpent.
The crucial bit that makes these two options unlikely is that it is 'eating' and not 'touching' of the fruit that clearly constitutes the transgression:

And he said, Who told thee that thou wast naked? Hast thou eaten of the tree, whereof I commanded thee that thou shouldest not eat? - Genesis 3:11

When God confronted Adam He did not ask or accuse him of 'touching' anything.  After Adam implicates his wife and God confronts Eve He does not ask or accuse her of touching or eating anything.  Eve's part of the transgression is that she, being deceived, gave to her husband and he ate.  This would open up the possibility that the prohibition against eating was only for the man were it not for Eve's reply to the serpent:

And the woman said unto the serpent, We may eat of the fruit of the trees of the garden: But of the fruit of the tree which is in the midst of the garden, God hath said, Ye shall not eat of it, neither shall ye touch it, lest ye die.- Genesis 3:2-3

This leaves Eve adding in the 'touching' part on her own as the most likely and yet not directly confirmed possibility.  It also lends credence to Paul's use of this scene in declaring that it is not a woman's place to teach a man:  God commanded man directly and, He who does not change still holds man accountable.
Through one man sin entered the world and through one man it is put away.
Answer: Eve's statement to the Serpent contains two discrepancies to what was told by God to Adam.

God hath said, Ye shall not eat of it, neither shall ye touch it, lest ye die. [Genesis 3:3 KJV]

'Lest' - God stated that if they partook of the tree of knowledge of good and evil, they would die. There is no 'lest' about it. It is inevitable. And so it was.

'Touch' - God stated only the consequence of 'eating' that is to say partaking in order to live, to sustain life. But the tree is fatal. One dies.

Eve has departed from God's words on two counts of inaccuracy.
But the narrative does not give us grounds to know who was at fault.
Did Adam not properly relay what God said to him ?
Did Eve not properly receive what Adam told her ?
We do not know and neither has admitted to the fault.
Later, Adam names the woman and that naming shows that he has assimilated the word of God in regard to the promise of the 'seed' (not of man but of woman, is the promise ; and the seed will bruise the serpent from above, therefore a human seed exalted above created spirit).
Adam shows repentance. Later, his household is an household of faith for 'Cain went out from the presence of the Lord' that is to say, went out of Adam's household, to build his own city. For the man and the woman had been banished from the presence of God in Eden. Yet, that Presence was still with them, despite the judgment.
This gives us a picture. There is, possibly, a clue as to what occurred. But scripture does not actually state it.
So neither may we.
Comment: How can you know with such confidence that God didn't have a conversation with Eve in which he told her something like "Don't eat it. In fact, if you so much as touch the fruit it might kill you."? I'm not saying that that *did* happen, but you are claiming, without any obvious justification, that it definitely *did not* happen.
Comment: "*Please kindly stop harrassing me.*" — Huh?
Comment: @RayButterworth I have deleted all my comments. No further comment.
Answer: One explanation not mentioned yet is that touching the fruit would be an occasion of sin and by being an occasion of death it causes death.
It is sinful to expose oneself to proximate occasions of sin, such as going to a mixed beach, because it leads to sin, besides causing scandal.
Comment: This may be the case now but could there be an 'occasion of sin' before sin had entered the world?  This would make touching the fruit a sin even before commission of the first sin had happened.  It might, perhaps, explain how the woman was in the transgression, since she touched and gave to her husband, but it was Adam's eating and not touching that pulled the trigger.
Comment: Then the occasion of sin would not be the tree itself but God's prohibition of it.  Therefore, since the prohibition was "do not eat" touching would be fine.  Adam could have taken the fruit from Eve with no intention to eat and he would have remained innocent.
Comment: Exactly.  Touching was fine...not venial.
Comment: @MikeBorden The mere existence of the tree is an occasion of sin by definition since its existence makes a sin possible. The distinction you are making would be the difference between venial and mortal sin. While playing around with the apple and considering whether to eat it might not be mortal, eating the apple definitely is.
Comment: @MikeBorden You're misunderstanding the point. If he took it in order to throw it away he would not sin.
Answer: Eve was in fact meeting the Devil half-way by adding to what God had commanded. In other words, she did not want to take any chance of being led away. But the argument of the Devil in Gen 3:4 does not mention the prospective danger of just touching and feeling the forbidden fruit. He only speaks of the act of eating it. Verse 5 goes on to state that Eve saw the fruit pleasing to the eye, and not to the touch ! Thus, when one reads Verses 3,4 and 5 together, one gets a clear picture that the touch- aspect was the contribution of Eve herself. We see a scenario something like this in the parable of the Prodigal Son. The narrator ( Jesus) does not mention that the Prodigal Son spent his money on prostitutes ,  but the Elder Son says so when he sees the welcome party thrown by the Father.
Answer: To eat, presumes a touch.  To eat an apple from a tree, to eat a potato from the ground, you have to touch each.
So, while scripture only records that God says do not eat and nothing about do not touch, we can safely assume it is implied.
As another example of "do not eat, but you have to touch", here is Deut 12:22-24

Even as the roebuck and the hart is eaten, so thou shalt eat them: the unclean and the clean shall eat of them alike. Only be sure that thou eat not the blood: for the blood is the life; and thou mayest not eat the life with the flesh. Thou shalt not eat it; thou shalt pour it upon the earth as water.

The problem was, however, to separate the two ideas of touch and eat.  If you eat, you die is true.  If you touch, you die is not true.  But if you believe if you touch, then you die, but don't, then it is too easy to proceed to eat.
Hope that helps.
Answer: Consider that breathing air is also eating it, and when you apply a cream to your skin, your skin also eats the cream. So eat = touch = breathe the smell of a fruit.
Also, consider a different thing. The fruits of the tree of good and evil could be so large, that "eat", "touch", "breathe" means almost the same in a different sense. Do you eat your planet? Do you touch it? Do you breathe it? Yes to all. Consider the fruits to be the planets similar to our planet. Creatures, similar to Adam and Eve eated the planets. The planets were pleasant to dwell on and eat them. The creatures were sometimes not yet suitable for the rest of Edem, they were the flesh lacking the spirit of life sometimes (walking coffins). They should not dwell on those planets, because the planets were used like ovens to create flesh for the rest of Edem, including Adam's and Eve's flesh. They saw their nudity (flesh without the spirit of life) when they dwelt on one of the planets. Edem is like a garden, and the fruits of good and evil are a few wild planets amongst Edem.
Comment: Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer).


Very quiet and buzzy sound in headphones on Ubuntu 16.04

Question: It's very quiet and buzzy sound in headphones on my Ubuntu 16.04. I experienced this issue about a month ago and I tried to fix that with "pavucontrol" and "alsamixer" utils, but these didn't help. Suddenly system update with standard "System Update" manager helped me. But now it doesn't. Strange thing that built-in dynamics works correctly. Please help, guys... Just don't know what to do...
Answer: I don't know what that was but simple "Suspend" helped me :)


Is finding negative cycle vertices NP complete?

Question: I was trying to find all the negative cycle vertices using the Bellman–Ford algorithm using this paper solution 7.1(b) in $O(V)$ by tracing back the predecessor subgraph.It is also stated in this answer too. But then while googling I found another Stack Overflow question it is proved that finding negative cycle vertices are NP complete. So what is it actually?
Answer: Your question is very unclear.
There is a tremendous difference between: (a) print out one example of a negative cycle, if one exists, (b) print out all negative cycles.
The former can be done in polynomial time using Bellman-Ford.  The latter cannot, as there could be exponentially many cycles, so it could take exponential time.  (The latter is not NP-complete, as the problem is not even in NP.)
The solution you link to is solving problem (a).


For $s_n$ a sequence in $\Bbb R$, if $\lim s_n$ defined as a real number, then $\liminf s_n = \lim s_n = \limsup s_n$.

Question: I'm studying some real analysis, and I'm trying to figure out how to prove the following theorem. For the most part, I've got things figured out. I'll post the theorem and my proof (which closely "follows" that of Kenneth Ross's proof within Elementary Analysis: The Theory of Calculus, Second Edition).

Let $(s_n)$ be a sequence in $\Bbb R$. If $\lim s_n$ is defined as a real number, then $\liminf s_n$ = $\lim s_n$ = $\limsup s_n$.

After dealing with other cases, the proof proceeds as follows:

Now suppose $\lim s_n = s$, where $s$ is a real number. Consider  $\epsilon > 0$. There exists a positive integer $N$ such that $|s_n - s| < \epsilon$ for $n > N$. Thus $s_n < s + \epsilon$ for $n > N$, so $v_n = \sup\{s_n : n> N\} \le s + \epsilon $. Also, $m > N$ implies $v_m \le s + \epsilon$, so $\limsup s_n = \lim v_m \le s + \epsilon$. Since $\limsup s_n \le s = \lim s_n$ for all $\epsilon > 0$, no matter how small, we conclude $\limsup s_n \le \liminf s_n$.

Now, things go awry right about here:

A similar argument shows $\lim s_n \le \liminf s_n$.

I understand the proof up until this point. Basically, our sequence $(s_n)$ hits a "capstone" since $\lim s_n = s$ (eventually, considering $n > N$ in the limit definition and our other inequalities). Therefore our $\limsup s_n$ should either hit less than the capstone or the capstone, never higher.
However, proving that $\lim s_n \le \liminf s_n$ seems impossible to me, especially using a similar argument. I can't even follow through with a proper proof. I'm stuck on how this is even possible. I know why they want to set this equality up (it allows us to achieve $\liminf s_n = \lim s_n = \limsup s_n$ since $\liminf \le \limsup s_n$). But how they get there is beyond me. Using a similar argument, I arrive here:

As before, since $|s_n - s| < \epsilon$, $s_n < s + \epsilon$ for $n > N$. Let $u_N = \inf\{s_n: n > N\}$ $\le s + \epsilon$.

Which seems useless given that $\liminf s_n \le \limsup s_n$. Wouldn't that imply $\liminf s_n \le \lim s_n = s$? Furthermore, since the infimum is defined as the greatest lower bound of a set, and the $\liminf s_n$ can only ever possibly reach a limit of $s$, how can the statement

$\lim s_n \le \liminf s_n$

even be true? I sense that I'm missing something obvious here, but I've been bugged about this argument for a while...
Comment: Assume $\lim(s_n)>\liminf(s_n)$ and derive a contradiction. It follows almost immediately from the definition of limit and liminf.
Comment: Alright, here goes: $lim s_n > \liminf s_n$. As $\lim_{N\to \infty}$, $s > s$, thus revealing the contradiction?
Comment: Ah, so then it follows that $\liminf_{N \to \infty} s_n \ge \lim_{N \to \infty} s_n$, which isn't a contradiction since $s \ge s$. Thanks!
Answer: $|s_n-s|<\epsilon$ implies $s_n<s+\epsilon$ and $s_n>s-\epsilon$ for all $n>N$. So $\inf\{s_n: n>N\}$ is bounded below by $s-\epsilon$. Now take $\epsilon$ to zero...
Comment: Proof needs more detail..


Why in cryptographic schemes we always assume that the key and plaintext are independent?

Question: Why do we always assume in cryptographic schemes that the key and plaintext are independent? What if the plaintext depends on the key? How can this endanger security? Is this assumption essential for both symmetric and asymmetric algorithms?
Comment: You seem to be hinting at some relationship.  Do you have a specific example for us to consider?
Comment: @PaulUszak : I was thinking about the situation when you are generating the plaintext by the usage of the key when I asked the question. _ponch's_ was a nice guide for a better view as well. I found an example [here](https://eprint.iacr.org/2009/511.pdf) under the topic he introduced: In some popular disk encryption utilities, the disk encryption key can end up being stored in the page file, and thus is encrypted along with the disk content.
Answer:
What if the plaintext depends on the key? How it can endanger security?

Well, one trivial example where it can is if you are using RSA (without padding), and encrypt one of the prime factors. Someone seeing the ciphertext could immediately factor the modulus (by computing the GCD of the modulus and the ciphertext), thus endangering security.
There is a formal name for systems where this provably can't happen; circular security.  See this paper for a public key cryptosystem that can securely encrypt any polynomial function of the private key (up to a degree bound).
My personal opinion: If you really need to do this sort of thing, I think a hybrid scheme such as the Integrated Encryption System would suit your requirement quite nicely.
Comment: Thank you for your quick answer, clear counterexample, and mentioning the title of the topic _circular security_along with the paper you introduced. All of them were useful.
Comment: Another similar line of work is "key-dependent message" security. See this paper from Krawczyk and Halevi: https://eprint.iacr.org/2007/315.pdf
Answer: Fix a 256-bit key $k$.  What ciphertext you get if you try to encrypt the plaintext $\mathrm{AES}256_k(0)$ with AES-256 in CTR mode with a zero nonce?  When you have found the answer, what is your gut feeling about whether that looks like encryption or not?
More formally: If an adversary knows you are using AES-256 in CTR mode but not the key—as you should assume they do, by Kerckhoffs' principle—will they be able to distinguish your ciphertext from a uniform random string of 128 bits, as the security contract of AES-256 in CTR mode guarantees under correct use that they cannot?
Comment: That's not CTR mode.  Phrased as a 'mode of operation', that's a single block of ECB mode—*i.e.,* just applying the AES-256 permutation to a block.  The plaintext/ciphertext equation of ECB mode for a 128-bit message is $C = \mathrm{AES256}_k(P)$.  What's the plaintext/ciphertext equation for CTR mode of AES-256 under a zero nonce for a 128-bit message?
Comment: As to your example: $AES256_k(AES256_k(0))$ looks fine to me ($k = b6cb23d499f01558f5910e8034d782c9fa53c4a33547524e9a0531d97c81d0dc_{16}$`, output = $f7a76f22fe016f779f2f19d217b8d535_{16}$)
Answer: my 5c
Why do we always assume in cryptographic schemes that the key and plaintext are independent?
The whole point of cryptography is to hide your messages. If you use a type of encryption that gives you a hint about what the plaintext is, there is a vector for an attack or brute forcing. Let's say in this case you use a size n key against your message of size n. See if you can guess the following messages:
yes
noyoushouldwaituntilthefollowingdaytosetoffthepackagefredwillbetherebecareful
So given the size of the key and the message being related (admittedly a simple case), information from one can be used in an attack on the other. You'll see many cryptography schemes use messages padded/offset/use static key length for this purpose.
What if the plaintext depends on the key
Perhaps something to think about here is the encryption scheme itself and how it generates keys. The enigma machine used in WWII generated encrypted text based upon the initial settings of the key-generator.
Using this knowledge the British code-breakers broke enigma messages by having an idea of the plaintext based on the time of day, location, message patterns, predictability of human operators and message conventions. Given this guess (or variations thereof) and brute force gave up the key for the day. Whilst the relationship between the two doesn't clearly exist, but given they know how the encryption scheme worked they were able to brute force the text against all the key permutations and see if the output was proper text. (All messages on that service used the same key that day, which is a big help to codebreakers. If they all used different keys...)
Comment: in your example _noyoushouldwaituntilthefollowingdaytosetoffthepackagefredwillbetherebecareful_, how could you use this information  for an attack?!
Comment: I need to be more specific - the shorter message is more obvious than a long one, but that's the plaintext being short to begin with, nothing to do with the key
Answer: Let's first take a look at ciphers and confidentiality.
A cipher is normally used to obtain confidentiality. Now if you already know at decryption time the content of your message then there is no need to encrypt it anymore: you already know (that part of) the contents of the message.
One of the main requirements for a cipher is that it remains secure even in the worst of circumstances.  For that there are different attack factors, and one is a chosen plaintext attack. In this scenario the adversary chooses the plaintext message and the ciphertext should remains indistinguishable from random (in the given domain, i.e. it may of course leak the message length). Obviously this IND_CPA security cannot be achieved when the secret key is partially known to the attacker.
In the end though it's not so much that the plaintext depends on the key, it's that the key depends on the plaintext that's the main issue. The plaintext doesn't need to be secret forever, but knowing parts of the key breaks security for all the other messages. Including a secure one-way hash over the key in the plaintext is unlikely to break security.
For asymmetric primitives: it's not such a huge problem if the public key - used for encryption - is derived in any way from the plaintext message. However, that key is usually generated as a pair with the private key; if the private key is somehow related to the plaintext then you've got the same issues as with dependent symmetric keys.

For signature schemes the plaintext / message is assumed known, so having the key depend in any way on the plaintext is quite obviously not a good idea.

With regards to security proofs: it is often not possible to create a security proof of a cryptographic primitive if there are dependencies between parts of the input.
Comment: My question exactly aroused from the point that "it is often not possible to create a security proof...". Actually, to me, it just means that whenever we have this assumption we easily proof the security, but it doesn't mean that the scheme is not secure when we don't have it.
Comment: Generally I see this kind of questions when people are just starting with crypto. It's basically a question of key management: were to get the key from. After that has become clear to the asker the idea of having a key depend on the plaintext disappears. Sure, you can possibly make a scheme secure (e.g. using a secure hash, or using the scheme defined by Poncho) and prove it secure. It's just that in general it *unnecessarily* complicates the protocol or algorithm design.
Answer: One very general answer is that when we analyze the security of an encryption scheme, we often assume that the adversary may actually know quite a lot about what the plaintext is likely to be.  Put more formally, we model the adversary's hypotheses as a probability distribution over the plaintexts, one which may well be accurate.  See for example, this definition of perfect secrecy from this set of lecture notes by Prof. Jonathan Katz:

Definition 1: An encryption scheme over message space $M$ is perfectly secure if, for all distributions over $M$, for all $m \in M$, and for all ciphertexts $c$ we have $\mathrm{Pr}[m|c] = \mathrm{Pr}[m]$.  In other words, the a posteriori probability that a message $m$ was sent, given that we observe ciphertext $c$, is exactly equal to the a priori probability that message $m$ was sent.

This definition works even in cases where the adversary has a really excellent a priori hypotheses of what the message $m$ might be.  What that the definition implies is that knowledge of the ciphertext (by itself) must never help the adversary improve their hypotheses.  For example, the adversary might independently learn that, with 99% probability, the plaintext is "We attack at dawn"; the cipher's job is to prevent the adversary from using the ciphertext $c$ to further confirm or disconfirm it.
But if the plaintexts and keys are correlated, then an adversary who can independently formulate good hypotheses about the plaintexts might be able to infer accurate probability distributions for the keys.  And with such distributions at hand, they might in turn manage to build an a posteriori model of $\mathrm{Pr}[m|c]$ that improves on their a priori model for $\mathrm{Pr}[m]$.  Why?  Very roughly, because if for an unusually likely plaintext $m$ the key $k$ is also unusually likely, then the ciphertext $c = E_k(m)$ is unusually likely as well, so seeing $c$ allows the adversary to boost their subjective probability that the plaintext is $m$.
The independence of the key from the plaintext helps to straightforwardly forestall any such attacks.


What's the disadvantage of increasing the size of an EBS instance in Amazon EC2?

Question: I used the default ebs Ubuntu image from Alestic.com
But the volume is only 8GB.
Is there any disadvantage?
Answer: Not particularly. I think 8gb is the default size for an EBS volume.
Comment: The max is 1TB, if you want to make it 500gb, go for it! :)
Comment: Yes and no. If you provision a 500GB instance but only use 40GB, you are charged only for the 40gb you used, not the whole 500GB you provisioned.
Comment: What's the max size? Can I make it 500GB?
Comment: oh, just a friendly reminder, if my answer helped, please hit that checkbox next to my post to mark it as the answer. thanks!
Comment: Oh Nice. Do larger volumes cost more? I think EC2 only charges based on hourly usage and traffic, right? I have to wait 8 minutes until I can check your answer. I will do.
Answer: Depends what you're doing with it.
Planning on keeping more than 6GiB of logs?
The larger the volume, the higher the failure rate. Although I've not tested it myself, rumor has it that 1TiB volumes provide the best performance.
Make sure you snapshot regularly as reliability is linked to dirty blocks.


I added olive oil to my cake, but I haven't baked it yet

Question: The taste is so strong, and I haven't even baked it yet.
How do I make it taste better?
I added it as a butter substitute... now what do i do?
Comment: Did you use extra virgin olive oil? EVOO has a much stronger grassy taste than "ordinary", cheaper olive oil.
Comment: What color was your oil?
The darker in color, the stronger the flavor. The lighter shade has a more delicate taste.
Comment: Better than what? What are the other flavors in the batter? Maybe they can compensate the strenght of the olive oil maybe not. As Stephie says, bake and taste ;)
Answer: First, you could bake it as planned. The taste may become less pronounced, especially in comparison to the other, still developing flavors from caramelizing and the Maillard reaction during baking.
There are quite a few cake recipes that use olive oil (so it's not necessarily a bad idea), and often they use citrusy and slightly savory flavor combinations, e.g. a pound cake with rosemary and orange or a lemon cake. (Not sure whether olive oil would work too well with, say, milk chocolate.) You could take that approach as an inspiration: If there's still time, add e.g. some lemon peel. If not, you can combine the baked cake with a citrus marmalade or a glaze.
Comment: I think it would go quite well in a lemon and rosemary cake, or possibly even lemon and lavender (delicious in a cake and rather rare). Or you could probably mask it by turning it into a ginger cake.
Comment: @ChrisH Done both of the former ;-)
Comment: I've got them growing in the garden but my baking these days is to suit  a child's taste and I don't think they'd tempt her. A special batch may be in order, probably a small one if it's all for me
Answer: Lo - it is become crust.  And there was cake pizza!
Bake it thin.  Then get it out and put sauce on and cheese.  Pepperoni if your child is digging it.
It is cake pizza.  You will be hailed down the generations of your family as the semidivine inventor of cake pizza.  I feel like it might be a cousin of bacon pancakes.
Can we make cake pizza today?
dang now I really want cake pizza.

I added olive oil to my cake, but I haven’t baked it yet