I'm working on a project, which contains several modules. Simplifying the problem, there is some variable x. Sometimes it may be int or float or list. But it may be a lambda function, and should be treated in different way. How to check that variable x is a lambda?  For example  &gt;&gt;&gt; x = 3 &gt;&gt;&gt; type(x) &lt;type 'int'&gt; &gt;&gt;&gt; type(x) is int True &gt;&gt;&gt; x = 3.4 &gt;&gt;&gt; type(x) &lt;type 'float'&gt; &gt;&gt;&gt; type(x) is float True &gt;&gt;&gt; x = lambda d:d*d &gt;&gt;&gt; type(x) &lt;type 'function'&gt; &gt;&gt;&gt; type(x) is lambda   File "&lt;stdin&gt;", line 1     type(x) is lambda                     ^ SyntaxError: invalid syntax &gt;&gt;&gt; type(x) is function Traceback (most recent call last):   File "&lt;stdin&gt;", line 1, in &lt;module&gt; NameError: name 'function' is not defined &gt;&gt;&gt;
I have a variable, x, and I want to know whether it is pointing to a function or not.  I had hoped I could do something like:  &gt;&gt;&gt; isinstance(x, function)   But that gives me:  Traceback (most recent call last):   File "&lt;stdin&gt;", line 1, in ? NameError: name 'function' is not defined   The reason I picked that is because  &gt;&gt;&gt; type(x) &lt;type 'function'&gt;
What's the limit of the sequence $\lim\limits_{n \to\infty} \frac{n!}{n^n}$? Expand a random range from 1–5 to 1–7 Given a function which produces a random integer in the range 1 to 5, write a function which produces a random integer in the range 1 to 7.   What is a simple solution? What is an effective solution to reduce memory usage or run on a slower CPU? if I write,  #!/bin/bash echo "foo"   or  #!/bin/sh echo "foo"   both yields same. I have seen some scripts starting with #!/bin/sh or #!/bin/bash. Is there any difference between them? I want to plot this graph, but I don't know how to code the words in the nodes.     Here is my code:  \documentclass{article} \usepackage{amsmath} \usepackage{titletoc} \usepackage{tikz} \usetikzlibrary{trees,positioning,fit}  \begin{document}{\allowdisplaybreaks[4]}  \tikzstyle{bag} = [text width=2em, text centered] \tikzstyle{end} = []  \begin{center} \begin{tikzpicture}[sloped] \node (a) at ( 0,0) [bag] {$\ln r_0$}; \node (b1) at ( 3,1.5) [bag] {$\ln r_{10} + \sigma_1\sqrt{\Delta t_1}$}; \node (b2) at ( 3,-1.5) [bag] {$\ln r_{10}$}; \node (c1) at ( 6,3) [bag] {$\ln r_{20} + 2\sigma_2\sqrt{\Delta t_2}$}; \node (c2) at ( 6,1.5) [bag] {$\textrm{Mean} = \ln r_{20} + \dfrac{3}{2}\sigma_2\sqrt{\Delta t_2}$\\$\textrm{Mean Change} = \mu_{11}\Delta t_2 = \ln\dfrac{r_{20}}{r_{10}} + \dfrac{3}{2}\sigma_2\sqrt{\Delta t_2} - \sigma_1\sqrt{\Delta t_1}$}; \node (c3) at ( 6,0) [bag] {$\ln r_{20} + \sigma_2\sqrt{\Delta t_2}$}; \node (c4) at ( 6,-1.5) [bag] {$\textrm{Mean} = \ln r_{20} + \dfrac{3}{2}\sigma_2\sqrt{\Delta t_2}$\\$\textrm{Mean Change} = \mu_{11}\Delta t_2 = \ln\dfrac{r_{20}}{r_{10}} + \dfrac{3}{2}\sigma_2\sqrt{\Delta t_2} - \sigma_1\sqrt{\Delta t_1}$}; \node (c5) at ( 6,-3) [bag] {$\ln r_{20}$}; \draw [-&gt;] (a) to node [below] {} (b1); \draw [-&gt;] (a) to node [above] {} (b2); \draw [-&gt;] (b1) to node [below] {} (c1); \draw [-&gt;] (b1) to node [below] {} (c2); \draw [-&gt;] (b1) to node [below] {} (c3); \draw [-&gt;] (b2) to node [below] {} (c3); \draw [-&gt;] (b2) to node [below] {} (c4); \draw [-&gt;] (b2) to node [below] {} (c5); \end{tikzpicture} \end{center}  \end{document}       Update code use  \draw [-&gt;] (a) to node [below] {} (b1.south east); \draw [-&gt;] (a) to node [above] {} (b2.north east); \draw [-&gt;] (b1.south east) to node [below] {} (c1.west); \draw [-&gt;] (b1.south east) to node [below] {} (c2.west); \draw [-&gt;] (b1.south east) to node [below] {} (c3.west); \draw [-&gt;] (b2.north east) to node [below] {} (c3.west); \draw [-&gt;] (b2.north east) to node [below] {} (c4.west); \draw [-&gt;] (b2.north east) to node [below] {} (c5.west); Calculating $\lim_{n\to\infty}\sqrt{n}\sin(\sin...(\sin(x)..)$ What is the distinction being made with regards to truth and falsity in these two sources? Cross-site inbookmarks:mine search inbookmarks:mine was fixed for searching within a particular Stack Exchange site, but often I find myself wanting to search for a question I favorited/bookmarked, but not remembering which site it was on when it could conceivably have been on a number of different sites. On the cross-site search at  it does not work, presumably because we have different user ids on each site. Is there a way it could be made to work? Note that this request is for searching, not just viewing, so it's not a duplicate of . Just viewing is not very helpful when you have a huge volume of bookmarks across Stack Exchange sites. I have lost my passport here in Beograd. Can I travel just with my Czech ID card from Belgrade to Budapest? A physical explanation for negative kelvin temperatures What's the best way to generate a tag cloud from an array using h1 through h6 for sizing? How to protect SHTML pages from crawlers/spiders/scrapers? I have A LOT of SHTML pages I want to protect from crawlers, spiders &amp; scrapers.   I understand the limitations of SSIs. An implementation of the following can be suggested in conjunction with any technology/technologies you wish:     The idea is that if you request too many pages too fast you're added to a blacklist for 24 hrs and shown a captcha instead of content, upon every page you request. If you enter the captcha correctly you've removed from the blacklist.   There is a whitelist so GoogleBot, etc. will never get blocked.   Which is the best/easiest way to implement this idea?  Server = IIS    Cleaning out the old tuples from a DB every 24 hrs is easily done so no need to explain that. Variable wavelength IR Diode? I was thinking of building a DIY IR Spectroscope but for this, I need to find an IR diode that can do variable wavelengths. So far I have looked at Farnell and Mouser but all the diodes I have looked at seem to be fixed on a wavelength.   Is this possible? or would I need some sort of filters and optical equipment, if so which parts would I need?  Thanks. Let $m$ be a natural number. Define $f(m) = m + \lfloor\sqrt{m}\rfloor$. Prove that at least one of the number among $m, f(m), f^2(m), \ldots$ is a perfect square. Here $f^k(m)$ denotes the composition of $f$ over itself $k$ times.  I tried the question, but the greatest integer along with square root is creating trouble. multiple Open Drain UART over long distance I have 9 microcontrollers  and I have connected the RX and TX lines of 8 of them in parallel. My configuration is in master-slave. The master microcontroller send data to one of the 8 RX lines but only one of them can respond at a time. The cable length is about 3 to 5 metres between each node.  I have two questions. My test was done with 2 slaves instead of 8. UART at 9600bps.  If I setup the TX lines of the slaves as Open Drain it works fine, but the signal doesn't have steep ramps. I thought this happens due to Pull-up resistors. And I also think that is going to be better with 8 slaves on the bus, right?  Why doesn't that topology work if the TX lines of the slaves are not Open Drain?  I managed to make it work by disabling the transmit of the UART in all of them except one, and it worked fine. I had two slaves, so I disabled the one and left the other. Also I noticed that the edges of the signal was sharper. Why are they sharper in that case?  Regarding resistors: The value of the resistors for both RX and TX lines are 2.7KΩ. However the Open Drain topology would parallel the internal pull-up resistors. According to the datasheet that resistor is about 20KΩ at minimum. So, using a 2.7KΩ in the output would give us a total resistance of 2.52KΩ (20+2.7)/9. And the Open Drain would make a voltage divider 2.52KΩ + 2.7KΩ (Schematic 2). Which means with 8 slaves and Open Drain topology the signal will not go lower than 1V which is the threshold of the low level. Is that correct?  Wouldn't it be better to disable all the internal pull up resistors and place two (let's say: 4.7KΩ) only at the master side?  Distance: What is the maximum baud rate for such distance? I'm a little worried about the signal integrity. The test was done with 9600bps but I didn't notice any significant difference in 4800bps. The distortion of the signal didn't have a difference.  Voltage values are 3.3V for the UART bus.  Schematic 1. (all resistors are 2.7KΩ)        &ndash; Schematic created using   Schematic 2. (U4, U5, U6, U7, and U8 are omitted for simplicity).          EDIT: Thank you all very much about your answers so far. I wanted to point out that this is a question about UART only. I am not looking for alternative solutions. I'm just trying to find some answers about the above implementation.  EDIT2: Thank you very much for your answers! I ended up modifying a little my schematic. I disabled the internal pullup resistors of the microcontrollers and I placed external ones at the master's board. Their value would be around 1 KOhm to 3 KOhm. I have to do some tests more to decide the final value. I also replaced all series resistors with 130 Ohm.   I tested 5 slaves over 20 metre cable (with pullup 3 KOhm and 130 Ohm series resistors) and it worked fine.   Would it be better to add open drain/open collector line drivers on every TX lines? I am a Indian citizen in the United States on a F-1 visa.  For the summer break, I am traveling (round-trip) from Chicago to New Delhi via Dusseldorf-Frankfurt by Lufthansa airlines. My onward Journey would be on July - 8 and return Journey on Aug - 11.  My layover will be of 1 hour 10 mins in Frankfurt and 3 hours in Dusseldorf.  I would like to know if I require Category A or Category B Visa. If not, what type of visa do I require for the Schengen visa for my transit. How I can apply for the same?  I tried to find slots in German consulate but all slots are full before my departure date. If I don't get the Schengen visa, I cannot travel and will loose all the fare (since my ticket is a non-refundable ticket). Is there any other way I can tackle this situation. What is meant by "obfuscate by pretending"? I came accross the following sentence:  "Politicians obfuscate by pretending that the world would be the same if it weren't for the Cold War."  What is the meaning of obfuscate by pretending and how does it relate to the rest of the sentence?  The way I understood it: politicans are aware that the world would not be the same if it weren't for the Cold War, but are (due to unknown or suspected reasons) not willing to admit this and therefore pretend otherwise. I would appreciate it if someone could refer me to a proof (or simply give one here) for the statement in the title. That is:  If $k&lt;n$, then every $k-$dimensional subspace of $\mathbb{R}^{n}$ has $n-$dimensional Lebesgue measure zero.  I've seen some proofs that use Sard's lemma but I'm not really familiar with that subject and I've never seen a proof of said lemma so I'd appreciate a proof that doesn't use it if possible.  Thanks in advance! When is it ok to remove the intercept in a linear regression model? What is the difference between a game framework and a game engine? What is the difference between a game framework (for example, XNA with C#, SDL for c++) and a game engine?  Do game frameworks use engines? Does a game engine encapsulate sub-engines like physics engines, particle engines etc? Should they be used together, or are they mutually exclusively?  I take it there are separate engines for both 2D and 3D? Get Record Type Developer Name without SOQL Query