Why won't a script added dropdown box update the text in the box to the selection chosen
Event binding on dynamically created elements?
Serializing anonymous delegates in C# I am trying to determine what issues could be caused by using the following serialization surrogate to enable serialization of anonymous functions/delegate/lambdas.   // see http://msdn.microsoft.com/msdnmag/issues/02/09/net/#S3 class NonSerializableSurrogate : ISerializationSurrogate {     public void GetObjectData(object obj, SerializationInfo info, StreamingContext context)     {         foreach (FieldInfo f in obj.GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic))             info.AddValue(f.Name, f.GetValue(obj));     }      public object SetObjectData(object obj, SerializationInfo info, StreamingContext context,                                 ISurrogateSelector selector)     {         foreach (FieldInfo f in obj.GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic))             f.SetValue(obj, info.GetValue(f.Name, f.FieldType));         return obj;     } }     Listing 1 adapted from   The main issue I can think of that might be a problem is that the anonymous class is an internal compiler detail and it's structure is not guaranteed to remain constant between revisions to the .NET Framework. I'm fairly certain this is the case based on my research into the similar problem with iterators.  Background  I am investigating the serialization of anonymous functions. I was expecting this not to work, but found it did for some cases. As long as the lambda did *not&amp; force the compiler to generate an anonymous class everything works fine.   A SerializationException is thrown if the compiler requires a generated class to implement the anonymous function. This is because the compiler generated class is not marked as serializable.  Example  namespace Example {     [Serializable]     class Other     {         public int Value;     }      [Serializable]     class Program     {         static void Main(string[] args)         {             MemoryStream m = new MemoryStream();             BinaryFormatter f = new BinaryFormatter();              // Example 1             Func&lt;int&gt; succeeds = () =&gt; 5;             f.Serialize(m, succeeds);              // Example 2             Other o = new Other();             Func&lt;int&gt; fails = () =&gt; o.Value;             f.Serialize(m, fails); // throws SerializationException - Type 'Example.Program+&lt;&gt;c__DisplayClass3' in Assembly 'Example, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.         }     }   Listing 2  This is similar to the issue of trying to serialize iterators and I had found the following code in a previous search (see ) Using the code from Listing 1 and an ISurrogateSelector I was able to successfully serialize and deserialize the second failing example.  Objective  I have a system that is exposed via a web service. The system has a complex but small state (many objects, not a lot of properties per object). The state is saved in the ASP.NET Cache, but is also serialized to a BLOB in SQL in case of cache expiration. Some objects need to execute arbitrary "events" upon reaching some condition. Hence they have properties accepting Action/Func objects. Contrived example:      class Command     {         public Command(Action action, Func&lt;bool&gt; condition);     }   Somewhere else      void DoSomethingWithThing(Thing thing)     {         state = Store.GetCurrentState();          Command cmd = new Command(() =&gt; thing.Foo(), () =&gt; thing.IsReady())         state.Add(cmd);          Store.Save(state);     } Laws of addition of Vectors Recording iPad screen using QuickTime I need to record a demo on my iPad's screen where I narrate what's going on but I also want the sounds from the iPad to be in the video. It seems that choosing the Mac Built-in Mic option causes only my voice to be in the video while choosing the iPad Mic option cause only the sounds from the iPad to be in the video. What can I do to put both in the video? Should my first trip be to the country which issued my Schengen Visa? How do I enable or disable Apport? Limit of $x\left(\left(1 + \frac{1}{x}\right)^x - e\right)$ when $x\to\infty$ I am stuck on how to calculate the following limit: $$\lim_{x\to\infty}x\left(\left(1 + \frac{1}{x}\right)^x - e\right).$$  Definitely, it has to be through l'Hôpital's rule. We know that $\lim_{x\to\infty} (1+(1/x))^x = e$. So, I wrote the above expression as $$\lim_{x\to\infty}\frac{\left(1 + \frac{1}{x}\right)^x - e}{1/x}.$$Both numerator and denominator tend to zero as x tends to infinity. I applied l'Hôpital's rule twice, but I got the limit equal to infinity which is clearly wrong. In the book, it says that the limit should be $-e/2$.  Any help please? Also, in case someone managed to solve it, please tell me which numerator and denominator did you apply your l'Hôpital's rule to in both cases? Thanks a lot  Also, guys can you tell me how to write equations in this forum? Thanks. In bash, read after a pipe is not setting values With ksh I'm using read as a convenient way to separate values: $ echo 1 2 3 4 5 | read a b dump $ echo $b $a  2 1 $  But it fails in Bash: $ echo 1 2 3 4 5 | read a b dump $ echo $b $a     $  I didn't find a reason in the man page why it fails, any idea? The number of different ways to choose $k$ out of $n$ unique items The number of different ways to choose $k$ out of $n$ unique items:   Without repetition and without order-significance: $\binom{n}{k}=\frac{n!}{k!(n-k)!}$ Without repetition and with order-significance: $\binom{n}{k}\times k!=\frac{n!}{(n-k)!}$ With repetition and with order-significance: $n^k$ With repetition and without order-significance: $?$   Thank you! Is there a way to log all Microsoft SQL Server queries executed on a certain server, with their respective durations?  I'd like to be able to analyze all queries will a tool like what  does for PostgreSQL. While we're at it: do you know of any such tools? What is the rule for omitting/including the definite article in the following sentences:     I used to play piano.   I used to play the piano.   I would pick the first sentence, but I've heard people say the second sentence even when they are not referring to a specific piano. Which one is correct? Is there a quicker way to turn on WiFi Hotspot? is there a way to automate (or at least reduce the number of steps) to turn on or turn off the WiFi hotspot on my Galaxy 3.  I have to    unlock  press the menu button  press settings press More Settings Tethering and portable hotspot Slide portable hotspot on. The easy way: Install Nvidia drivers, CUDA, CUDNN and Tensorflow GPU on Ubuntu 18.04 I have a question that bothers me after reading a part of the big book of rules :).  It's about the rule 717, illegal actions.     717.1. If a player realizes that he or she can’t legally take an action after starting to do so, the entire action is reversed and any payments already made are canceled. No abilities trigger and no effects apply as a result of an undone action. If the action was casting a spell, the spell returns to the zone it came from. The player may also reverse any legal mana abilities activated while making the illegal play, unless mana from them or from any triggered mana abilities they triggered was spent on another mana ability that wasn’t reversed. Players may not reverse actions that moved cards to a library, moved cards from a library to any zone other than the stack, or caused a library to be shuffled.   For example, player A plays a .     As an additional cost to cast Goblin Grenade, sacrifice a Goblin.   Goblin Grenade deals 5 damage to target creature or player.   It goes on the stack. Player B gains priority and casts a  on the only goblin of Player A.     Destroy target nonartifact, nonblack creature. It can't be regenerated.   The terror goes on the stack. Then both players agree to resolve the stack. The terror kills the last goblin standing and then the Goblin Grenade can't be cast because of the additional cost which can't be paid. So in my opinion that leaves two possibilities:   The Goblin Grenade returns to the zone it was previously from (the hand of Player A) The Goblin Grenade becomes illegal and gets countered, so it goes to the graveyard   Based on rule 717 I think it goes back to the hand but I'm not quite sure. :) Questions like  dealing with Ancalagon in particular, and Middle-earth's dragons in general, clearly show that Ancalagon was ridiculously, absurdly, unimaginably enormous.      The non-canonical image above shows one person's impression of how the different dragons of Middle-earth stacked up, with Smaug looking absolutely tiny at the far left, and Ancalagon on the right, too big to even fit in the picture.    Below, a presumably canonical picture, painted by Tolkien himself, shows Smaug in relation to Bilbo.  The rough measurements I took from this image suggest that Smaug is about 11 times longer than Bilbo is tall.  Depending on how tall Bilbo is - almost certainly somewhere between 3'6" and 4' tall - Smaug is approximately 38-44 feet long.      If the first picture is even vaguely accurate, Ancalagon would appear to be a minimum of something like 720 feet long from the tip of his nose to the end of his tail:  the visible portions of his head and body are at least 6 times longer than Smaug is from end to end, and we have to assume that the portion of his body that is out of frame is at least 3 times longer still, perhaps even 4 times or more (so the upper range of his length might exceed 1,000 feet).  Does Tolkien give us any way to estimate how big Ancalagon was?  It isn't his normal practice to describe things in great detail, I realize, but he often gives a few hints that allow for some rough approximation to be made.  Does anything he says suggest that the first image is anything like what he had in mind?  Note:  I haven't read anything about Ancalagon from Tolkien's own pen, except a few quotes on this site;  the most important bit of information I've gleaned is that he smashed 3 volcanoes to pieces when he died (or something like that).  How accurate is this, and what else did Tolkien say?    This question is not a duplicate of "", because none of the answers to that question address Ancalagon's size in any detail - except my own, which is based on what little information I was able to glean from the two pictures I included in this question.  All the other answers address how Ancalagon was killed, not how big he was.  I have no interest in how he died, only how big he was, or rather, what hints we can find that might give some indication of how big he was.  I wouldn't ask this question, linking that question in my own, if it contained the information I am interested in.    Note 2:  Regarding the relative sizes and impressiveness of Smaug and Ancalagon:  Imagine a meeting between Smaug and Ancalagon in Dragon Heaven: Smaug: "How'd you die?" Ancalagon: "A flying boat full of fire made by the Angels and driven by a Magic Elf smashed into me, so I fell onto a mountain and broke it, and I died. The Magic Elf lives in outer space now, and the boat turned into a star. How'd you die?" Smaug: "Um... Some dude shot me with an arrow." How find the maximum value of $|bc|$ Question:     Given complex numbers $a,b,c$, we have that $|az^2 + bz +c| \leq 1$ holds true for any complex number $z, |z| \leq 1$. Find the maximum value of $|bc|$   It is said this is answer is $$|bc|\le \dfrac{3\sqrt{3}}{16}$$  My idea: let $z=1$,then $$|a+b+c|\le 1$$ let $z=-1$,then $$|a-b+c|\le 1$$ let $z=0$, then $$|c|\le 1$$  let $|\theta|=1$,then we have $$|a(z/\theta)^2+b(z/\theta)+c|\le 1\Longrightarrow |az^2+b\theta z+c\theta^2|\le 1$$ and only this can't solve this problem,Thank you How to create a windows service from java app I've just inherited a java application that needs to be installed as a service on XP and vista. It's been about 8 years since I've used windows in any form and I've never had to create a service, let alone from something like a java app (I've got a jar for the app and a single dependency jar - log4j).  What is the magic necessary to make this run as a service?  I've got the source, so code modifications, though preferably avoided, are possible. I can't install software-center on Kali Badge "multiplier" a little bit misaligned on the profile page Well, you can see it for yourself. The badge multiplier is a bit misaligned. Can you fix this please? (I know it's kinda a minor issue but it's bugging me and it's somehow off)    If it helps, I'm using Chrome version 44.0.2403.125 m. (Also repro'ed on FireFox 39.0 and )    For no good reason, that's a screenie from 's profile page. Is there a way to make PythonTEX compile as of today in Overleaf V2 ?  \documentclass[]{article} \usepackage[utf8]{inputenc} \usepackage{pythontex}  \begin{document} \begin{pyverbatim} def calc_ellipticity(theta, delta):     theta = np.deg2rad(theta)     psi = np.arcsin(np.sin(2*theta) * np.sin(delta))/2     return np.tan(psi) \end{pyverbatim} \end{document}   Compiling gives : ? PythonTEX ? Open a Oracle 7.3.x database in Oracle 11 Is there any way to open or convert an old Oracle 7.x database into Oracle 11g? Thanks in advance!