I was given a bunch of degree sequences and had to determine whether or not a graph was possible. I used the Handshaking Theorem and concluded there was no graph if the sum of degrees was odd. However, a lot of the times it summed to an even number but there was no simple graph for the sequence. All the time there was a non-simple graph, however. Will there always be a non-simple graph?
I'm trying to make a list of ways to tell if a given degree sequence is impossible. For example $3,1,1$  is not possible because there are only 3 vertices in total so one can't have degree 3.  The list so far   vertices has degree equal to or larger than number of vertices sum of degrees is odd for n vertices if one has degree n-1 and another has degree 0 for n vertices the sum of the degrees cannot be greater than $n(n-1)$ because this would be have more edges than a complete graph
Novel from 50s or 60s - Good vs. Evil I'm not sure I recall enough of this story for a good identification, and the below is definitely out of story order, but...  The POV character goes to his home town and finds it different. He later finds that he's trapped in the town; there are two young people who turn out later on to be ... avatars ... of Ormazd and Ahriman, and the town is a battleground; what he is seeing of the town is Ahriman's effect on the town, and he turns out to have some limited ability to see the original town, which is more-or-less Ormazd's version of reality. In the end, Ahriman's avatar is destroyed, and the town restored.  I read this in the '80s or earlier; it was part of my father's collection, and the book was showing its age; I think it more likely to be the '60s rather than the '50s, and was probably by a prominent name in SF, but not one of the Masters. I am currently facing a "performance problem" while using grep. I am trying to locate the occurrences of many (10,000+) keywords in many (think Linux kernel repository size) files. The objective is to generate a kind of index for each keyword:   keyword: my_keyword filepath 1 filepath 2 ------ keyword: my_keyword2 ...   Being fairly new to shell scripting, I have tried a few naive approaches:  while read LINE; do     echo "keyword: "$LINE &gt;&gt; $OUTPUT_FILE     grep -E -r --include='Makefile*' "($LINE)" . &gt;&gt; "$OUTPUT_FILE"     echo "-----" done &lt; $KEYWORD_FILE   This takes about 45 minutes to complete, with the expected results.  Note: all they keywords I search for are located in a file ("KEYWORD_FILE", so fixed before anything starts), and the files in which to search can be determined before the search starts. I tried to stored the list of files to search in before the search like that:  file_set=( $(find . -name "Kbuild*" -o -name "Makefile*") )   and then replace the grep call by  echo {$file_set[*]} | parallel -k -j+0 -n 1000 -m grep -H -l -w "\($LINE\)" &gt;&gt; "$OUTPUT_FILE"   It takes about an hour to complete&hellip;  Question: considering I can use whatever technique I want, provided it's sh compliant, how can this be done "faster" and/or more efficiently ?  Perhaps grep is not the tool to use, and my use of parallel is wrong&hellip; any ideas are welcome! One of the mysteries that my numerics class left me with are "stiff systems". Our prof didn't really manage to explain what they are. Now that the class (and the test) are over, I'm still curious.   The most concise definition about "stiff systems" I've found so far is: "There is no universally accepted definition of stiffness". So, if there is none, I don't expect one.   I'd be thankful about information on both of the following points:   From what kind of (real-world) problems do stiff systems arise? What's so "stiff" about them? What's the good thing - or the bad thing - that I'd worry about when I have to numerically solve such a real-world problem? Why are my wrists the first part of my body to start aching during a long ride? Most riders seem to say it's their groin, neck or lower back that starts hurting first after a decent distance has been ridden. For me it is my wrists.  I have no history of wrist pain (strains, breaks etc) so it can't be explained by that and I try to adjust my hand positions across my handlebars as often as I can.  My question has 2 parts:   1. Is there anything I can do to minimise pain in terms of riding position, gloves, exercises etc which will reduce soreness?  2. Why might this pain be occurring?  *I do all of my riding on paved roads on a road (Specialized Allez) bike. How to make Gmail automatically label incoming emails I would like to set it up so that Gmail labels incoming mail based on which business email of mine the emails are sent to. I have two business emails that come to my Gmail account.  For instance, if someone emails me at example@firstbusiness.com, I would like the email to be automatically labeled first business. If someone emails me at my other email address (which also is forwarded to Gmail), example@secondbusiness.com, I would like that email to be automatically labeled second business.   Is there any way to do this? With proper nouns, we don't use the except for river names, newspaper names, etc.  I want to know why we use the with White House. I mean, under which rule can we categorize it? What could other similar examples for that rule be? Does the regularization of a divergent infinite sum yield a unique value?  I.e. do different regularization schemes acting on the same infinite sum produce the same exact value independent of the regulator?  What, exactly, do these values mean?  Or what are they?  My understanding is that they are not "convergent" values.  (Sorry in advance for being a physicist. Test to see when table is candidate for compression (row or page) Does anyone know a tool like this page  where one can determine if a table is a good candidate for row or page compression. Also I am trying to understand the benefits of compression. I have been reading about it, but still have these questions.  Will compression make more 8KB fit in the buffer cache? When does data become uncompressed i.e. in a select? will backups become faster? Is the reason that compression ads cpu overhead because e.g. inserts need to be compressed before the insert? Is there any good reason to compress tables without investigating how the tables is being used (i.e. static vs. volatile).  A colleague has started to compress many tables (page). I don't know the analysis behind this decision. I know we sometimes have resource semaphore waits during some peak hours. I actually don't think he knows what he is doing. I can see that our sos scheduler yield waits have gone slightly up. I think the compression is causing more harm and it seems that maintenance tasks overshoot more now (e.g. backups, checkdb...). Adaline is 100-something years old, and her daughter appears to be 90 years old. Well, Adaline gave birth to her in her mid 20's, and to be precise, she should be 80.   Anyways, Adaline's old lover's son (Ellis) is probably in his late 20's/early 30's. And Adaline has stopped aging at 29, which is pretty close to Ellis. Her old lover is said to be a few years younger than her and still, his son is so young. Also, Adaline could make him believe that she is the daughter of her own old self.   Then,      how can Adaline's real life daughter be so old?   I can't make sense out of this.  Why is it this way? The age pattern of the actors and actresses is inconsistent. It seems to me that the filmmakers have exaggerated some things. How do I fix "The expression of type List needs unchecked conversion...'? In the Java snippet:  SyndFeedInput fr = new SyndFeedInput(); SyndFeed sf = fr.build(new XmlReader(myInputStream)); List&lt;SyndEntry&gt; entries = sf.getEntries();   the last line generates the warning   "The expression of type List needs unchecked conversion to conform to List&lt;SyndEntry&gt;"  What's an appropriate way to fix this? load() method deprecated? One of our SQL Server 2014 database transaction logs is growing very fast and I cannot find the root cause for this.  Database in Simple recovery mode. During full backup the log file grows to its limits (800GB) and backup fails.  I checked the transactions during the backup and did not find anything strange.  All transactions are our regular loading and no maintenance jobs (index rebuilds etc.)  I am aware of that backup keep the log from reuse but this mean 800GB changes during the backup period and this does not make any sense.  I had compared this DB to similar DB size, loading and backup duration. The second DB Log is not growing more than 400GB.  DB size is 7TB. Backup time is ~20H. The only time log is growing is during backup. Log_reuse shows correct Backup_Restore. No long running transactions.  The problem is the "speed" of log growth - compared to similar sites with same load and same backup duration, the log is 4 time less. Add a UIButton as a subview to a UITabBar New Div - "Hiding questions because of your Ignored Tags preferences for tags" I think this message/div/box was just added today since I've never noticed it before, it is very noticeable.    I'm already aware that I'm hiding questions because I selected to hide them in my preferences. Isn't this a bit redundant? Now I have to scroll down more to be able to click to the next page. Plus see that same message dozens upon dozens of times a day.    Here are my ignored tags. So I'm going to have to see the same message on any question page that I'm on. Even though I already know questions are being hidden. I'm not understanding the point to this new div/box notification.  Does anyone find this new div/box useful? Do you find it redundant?       EDIT:   Also, this isn't just for StackOverflow.   I only have 2 ignored tags for CodeReview currently. And I have it set for only 15 questions per page. But still, on every page I click to it shows! How do I get the form id of my form? I've just begun to make my modules and I'm at a standstill. I got this code from someone else and am trying to customize it:  function hook_form_alter(&amp;$form, &amp;$form_state, $form_id) {   if ($form_id == 'the form id for the node form') {     $form['#submit'][] = 'my_custom_submit_handler';   } } How do I choose what shows up in PuTTY title bar from Linux? In the PuTTY configuration there's an option in Terminal &rarr; Features called Disable remote-controlled window title changing. Without that enabled, the title bar of PuTTY will change every time I press return in the console.  I was thinking it'd be a more clean solution to set the title bar text from Linux than to specify one for every PuTTY client I have laying around. So where can I modify what Linux sets as the window title?     $ uname -a Linux drevo 2.6.32-5-amd64 #1 SMP Mon Jan 16 16:22:28 UTC 2012 x86_64 GNU/Linux  $ cat /etc/debian_version 6.0.4 Generic Parse Method without Boxing I am trying to write a generic Parse method that converts and returns a strongly typed value from a NamedValueCollection.  I tried two methods but both of these methods are going through boxing and unboxing to get the value.  Does anyone know a way to avoid the boxing?  If you saw this in production would you not like it, how bad is it for performance?  Usuage:  var id = Request.QueryString.Parse&lt;int&gt;("id");   Attempt #1:  public static T Parse&lt;T&gt;(this NameValueCollection col, string key) {     string value = col[key];      if (string.IsNullOrEmpty(value))         return default(T);      if (typeof(T) == typeof(int))     {         //return int.Parse(value); // cannot convert int to T         //return (T)int.Parse(value); // cannot convert int to T         return (T)(object)int.Parse(value); // works but boxes     }     if (typeof(T) == typeof(long))     {         return (T)(object)long.Parse(value); // works but boxes     }     ...      return default(T); }   Attempt #2 (using reflection):  public static T Parse&lt;T&gt;(this NameValueCollection col, string key) {     string value = col[key];      if (string.IsNullOrEmpty(value))         return default(T);      try     {         var parseMethod = typeof(T).GetMethod("Parse", new Type[] { typeof(string) });          if (parseMethod == null)             return default(T);          // still boxing because invoke returns an object         var parsedVal = parseMethod.Invoke(null, new object[] { value });         return (T)parsedVal;     }     // No Proper Parse Method found     catch(AmbiguousMatchException)      {     }      return default(T); } Get and Set Screen Resolution Do Pokémon trainers develop some kind of limited resistance to their Pokémon's abilities? Obvious comedic aspects of the cartoon show especially aside, this may be a partial explanation. Think about it:  James can breathe Weezing's smog with no ill effects. Brock was able to hug a Sharpedo. And Ash has gotten trampled, tossed, smacked, singed, smothered, submerged, routed, run over, and electrocuted so often by his Pokemon he should be perpetually hospitalized! Yet these characters always seem to bounce back without serious injury.  Considering [a] it is partially cartoon logic, and [b] Pokémon trainers, much like animal handlers, likely will get somewhat more sturdy and hardy from simply regularly dealing with the animals they train....  Is it at all possible that just being around a Pokémon somehow helps their trainers develop a higher resistance to that Pokémon's special abilities? In MS SQL how do I find out what tables have not been queried or updated in a long time?