C# Converting Each Char to Byte Array
How do I get a consistent byte representation of strings in C# without manually specifying an encoding?
Yes,  but there must be a canonical or most efficient or most concise way. I'll add answers I know of and see what percolates to the top.  To be clear, the question is how best to read the contents of a file into a string. One solution per answer. Why do we use the simple past but not the present or future in the following expressions:  Don't you think it's time we went a little further Don't you think it's time we ate Don't you think it's time we went home I am trying to find a good rough guesstimate of how much of the maximum wattage usage of a graphics card is turned into hot air.  Say a graphics card is rated at using X watts at maximum usage. How much of that is released as heat into the air via the cooling setup, and how much is not (If not where does it go? To ground?)  Yes I know there are a lot of variables here, I am just looking for a guesstimate from someone who would understand better than me. I'm specifically using  (Radeon 6990 375 watts max) How to Store Fresh Herbs First appearance of a predominately black cast in a TV show I was watching MeTV the other day, which is a fantastic station chock-full of old-time TV shows.  In one sitting I saw episodes of Superman, Batman, Wonder Woman, The Rifleman and Star Trek (TOS).  So it got me thinking...  None of these shows has many (if any) black actors.  And now I'm curious as to which TV show was the first to feature a predominantly black cast.  Anyone know?  I'm thinking back to What's Happening, Good Times, The Jeffersons...  But were there any before then? Calculating percentage of overlap between 2 features from 2 different layers using ArcGIS Desktop? I have two layers. Layer 1 has features that are property/parcels with area in acres. Layer 2 has features that are wetlands/bodies of water with area in acres. I want to calculate parcels that have for example 0% wetlands, 10% wetlands, 20% wetlands, 30% wetlands etc. to 100% wetlands.   How can I do this on ArcGIS Desktop?   Ideally, I want to find parcels/properties that have a limited number or a limited percentage of wetland coverage. "Fatal error: Class name must be a valid object or a string in C:\xampp\htdocs\uc\includes\common.inc on line 7506"  The error above showed up unexpectedly. I was adding a "Long text" field to a content-type, but when I expected to be brought to a saved field configuration page, I instead got a Fatal error on every page.  I had a look at includes\common.inc:  /**  * Get the entity controller class for an entity type.  */ function entity_get_controller($entity_type) {   $controllers = &amp;drupal_static(__FUNCTION__, array());   if (!isset($controllers[$entity_type])) {     $type_info = entity_get_info($entity_type);     $class = $type_info['controller class'];     $controllers[$entity_type] = new $class($entity_type); // Line 7506   }   return $controllers[$entity_type]; }   However, I just don't understand Drupal at a low enough level to understand the relationships between these variables and functions.  I also searched Drupal for people with a similar problem:  (1)  who claims that I have to install the submodule "Relation Endpoints Field", but searching Drupal, .  (2) :  DELETE FROM cache; DELETE FROM cache_filter; DELETE FROM cache_menu; DELETE FROM cache_page; DELETE FROM watchdog;   (via , misleading name, I know.)  Clearing those tables from the cache did not help.  (3) And another user . Because I can't find a module specifically pertaining to old search facets, I went into MySQL system table, and marked the Search module's line with a 0 status, indicating to stop loading the module altogether.  On that same link as (3), one user suggested enabling the , so I dropped all the tables, imported the latest stable .sql, and installed the module, but after recreating the problem (trying to add a field to a content-type), that as well concluded fruitless.  Still, the problem remains  The Fatal error shows up on every page, making the site completely non-functional. Any help or direction would be immensely appreciated. Thank you for looking. Constant Amortized Time What is meant by "Constant Amortized Time" when talking about time complexity of an algorithm? Suppose that $X$ and $Y$ are chosen randomly and independently according to the uniform distribution from $(0,1)$. Define $$ Z=\frac{\max(X,Y)}{\min(X,Y)}.$$ Compute the probability distribution function of $Z$. Can anyone give me some hints on how to proceed? I can only note that $\mathbb{P}[Z\geq 1]=1$ and $$F_Z(t)= \mathbb{P}[Z \leq t]=\mathbb{P}[X\leq Y, Y\leq tX]+\mathbb{P}[Y \leq X, x\leq tY]$$ You should choose your Display Name when signing up When a user signs up , their username is something along the lines of "user########"  Granted, in the welcome email it does say something along the lines of "Head over to your user account page to chose a display name!", however only a few people actually read that email.  I'm not saying we should restrict people from changing their display name again in the future - Everyone would still be able to do so. It's just that when you sign up you choose an initial display name that will be what your first display name is instead of "user########". Cannot move file to trash warning when trying to delete a file in Nautilus I am trying to delete files in Nautilus and every time I try to delete one it always gives me this message:     Cannot move file to trash, do you want to delete immediately?   Then it gives me several questions. All I want is that when I press Delete in the keyboard, it sends it automatically to the trash can. Not to ask me every time.  The problem relates to NTFS partitions, external drives but also include Linux filesystems.  What are the reasons for nautilus beeing not able to move to trash? I'll like to add this functionality to the autocomplete widget in Entityreference field to show node ID next to the titles in the dropdown list. The reason behind the idea is to differentiate between multiple nodes with same title.  Example:    This is a title (3) This is a title (2) This is a title (1)   I know the node ID is shown once a selection is made but I like to show it in the dropdown list in order to pick the right node quickly based on the node ID. A map is continuous if and only if for every set, the image of closure is contained in the closure of image The Find Familiar spell states, in part:  As an action, you can temporarily dismiss your familiar. It disappears into a pocket dimension where it awaits your summons.  The question arising from this is:  Is this pocket dimension different for every familiar in the world? Thus being a personal pocket dimension? If this is true, then it should be able to store items given by its master for safe keeping away from anyone else, as long as these are items that a familiar could carry with it. Can the familiar bring small items with it into the pocket dimension for safe keeping? Why are some genes dominant over others? What is the mechanism behind it? If I have a brown eye gene which encodes the protein that is responsible for the brown color and have a blue eye gene as well, what is the reason that my eye color is brown? How does one gene maintain dominance over the other? How to save picture to iPhone photo library? How do I opt-out of the Social Security system? I have recently analysed my website with pagespeed addon on firebug. It suggested me to set expiration on CSS, JS and image files.  I am wondering how do i do this? "There are currently N bounties, worth X reputation" dynamic ad and the new sidebar width You've probably seen this sidebar ad on one or more -enabled Stack Exchange sites over the years:    The image is dynamically generated from a non-officially SE app that uses the Stack Exchange API to fetch the bounties from a given site.  As far as I understand, the rendered image automatically scales to the allotted ad space - when the sidebar ads were 220x250, it would render in the sidebar as a 220x250 image while still looking quite oversized in the  meta (as it does right here).  With the new 2016 campaign starting, can we test whether this awesome dynamic ad works with the new sidebar width? Non-EU spouse of UK citizen Schengen visa requirements I'm a British citizen and my wife is in the UK on a spouse visa. She holds a BRP card. We're planning to visit Germany and some other Schengen countries, and I've got a question around visa requirements/supporting documents.  I've read in few places (i.e ) that the visa requirements are more relaxed if the applicant is a spouse of a UK citizen, and is travelling with the UK citizen.  How relaxed are the requirements? Does my wife need to submit supporting documents for accommodation, finances, flight booking, etc.? Or is it simply submitting the application form alongside the passports and BRP? (i.e standard documentation for Schengen visa application section from )