I want to convert decimal number to exact same binary number. Eg. Decimal (10) to Binary (10). Dec(10000001110000110) to binary(10000001110000110).  I am new to perl. The Lame approach I can think of is to convert dec to string and string to binary but I am sure there has to be a better way to achieve it.  I am using a function to get an array of decimal numbers.  @Arr= {111110000,110100010,...}   Note this is decimal number since when I tried to subtract 1 from it's elements I got 11110000-1=11109999.  I need it in binary format so that I can do a logical AND operation on it.  Can someone please suggest on how to achieve it.
How can I convert the binary string $x_bin="0001001100101" to its numeric value $x_num=613 in Perl?
Can I achieve a torchlight effect (lighter area around a light source) in a 2D game? I am thinking of writing myself a simple 2D game. It will not shine with perfect graphics or gameplay at first, but I'd consider it my first step in PC game development. So, imagine such simple sprite-based 2D game (like Heroes IV or Startcraft BroodWar).  I want the gameplay to support day/night with the according lighting changes and at the same time it will be madness to have to create sprites for every lighting nuance. So, I decided adding a semi-transparent layer on top of other objects will be enough.   The issue with this solution is if I have a light source object in the game (like the hero wearing a torch, or a burning building), there must be a lighter area around it, right? Since I am putting my semi-transparent layer over everything, how would you suggest to achive the torchligt visual effect I want? Maybe redraw that layer adding 'gaps' or differently colored areas based on the lighting effect? Any tools to generate an XSD schema from an XML instance document? I am looking for a tool which will take an XML instance document and output a corresponding XSD schema.  I certainly recognize that the generated XSD schema will be limited when compared to creating a schema by hand (it probably won't handle optional or repeating elements, or data constraints), but it could at least serve as a quick starting point. When an air-filled balloon is released without its opening tied up, it moves in a circular path rather than a straight line. Why is that? We hold an L1 visa (Citizens of India) and are planning a cruise to the Bahamas this summer. Are there any Visa requirements to enter Bahamas. Does the condition $\lim\limits_{n\to\infty}\frac{a_{n+1}}{a_n}=1$ imply that $a_n$ convergent?  When I say convergent I mean to $L\in \mathbb{R}$ or to $\infty$ or to $-\infty$  I have a gut feeling this statement is false, just can't find a series which contradicts it.  Thanks a lot Nullable type issue with ?: Conditional Operator Could someone explain why this works in C#.NET 2.0:      Nullable&lt;DateTime&gt; foo;     if (true)         foo = null;     else         foo = new DateTime(0);   ...but this doesn't:      Nullable&lt;DateTime&gt; foo;     foo = true ? null : new DateTime(0);   The latter form gives me an compile error "Type of conditional expression cannot be determined because there is no implicit conversion between '&lt;null&gt;' and 'System.DateTime'."  Not that I can't use the former, but the second style is more consistent with the rest of my code. How to get rid of OTA software update notification? I upgraded my Nexus 4 to Lollipop a few days ago but I don't like it. I'll leave out my reasons because they're not relevant here. I wiped my phone and installed a clean stock 4.2.2 version instead. I'm happy with this.  Not long after, Android automatically downloaded the 4.3 upgrade and notifies me with the choices "Later" and "Install". I don't want to do this upgrade.  How do I:   get rid of the notification, and  remove the downloaded update (to free up precious storage space).     I have already tried choosing "Later" but the same notification immediately reappears.    Based on Google search results, I also tried going to Settings &gt; Apps &gt; All &gt; Google Services Framework and unticked "show notifications" but it still appears. Force stop or disable also doesn't seem to help, so I've re-enabled the service including notifications. I didn't see any other apps in this list that sounded relevant - did I just not see it? Find all the numbers $n$ such that $\frac{4n-5}{60-12n}$ can't be reduced. Find all the numbers $n$ such that $\frac{4n-5}{60-12n}$ can't be reduced.   Attempt:  $$\gcd(4n-5,60-12n)=(4n-5,-8n+55)=(4n-5,-4n+50)=(4n-5,45)$$  $$n=1: (4-5,45)=1\quad \checkmark\\ n=2: (3,45)=3\quad \times\\ n=3: (7,45)=1\quad \checkmark\\ n=4: (11,45)=1\quad \checkmark\\ n=5: (15,45)=15\quad \times\\ n=6: (19,45)=1\quad \checkmark\\ n=7: (23,45)=1\quad \checkmark\\ n=8: (27,45)=9\quad \times\\ \vdots$$ So the answer is that it can't be reduced for $n=1,3,4,6,7,..$ i.e  $$\bigg\{n\bigg|n\notin \begin{cases}a_1=2\\a_n=a_{n-1}+3\end{cases}\bigg\}$$  I want to verify that my solution is correct We, as high school students have been taught that-because Bohr's model of an atom assigns specific orbits for electrons-that it is better than Rutherford's model. But what Rutherford failed to explain was why electrons don't emit EM waves &amp; fall into the nucleus. I don't see how the introduction of 'atomic orbitals' overcame this defect. Can't it still radiate EM waves? Why is $\frac{1}{2\pi i}\int_{\gamma}\frac{f'(z)}{f(z)}dz$ an integer? Let $f$ be holomorphic in an open $\Omega \subset \mathbb{C}$ and $\gamma$ a closed curve in $\text{int}(\Omega)$, along which $f$ is never zero.   Are these hypotheses enough to claim $\frac{1}{2\pi i}\int_{\gamma}\frac{f'(z)}{f(z)}dz$ is an integer? If not, what are the necessary and sufficient conditions for that?  I can prove that's an integer for some particular cases, for example when $\Omega$ is convex and  $\gamma$ is a circle. But I've seen people claming this in many other contexts, like when $\Omega$ is an annulus around $0$ and $\gamma $ is an arbitrary curve inside it. This isn't obvious to me at all.  Thanks! Random test data: How to do it right? Several months ago I started an experiment in test automation. Each test, before it starts, picks up random test data. For instance, when my test requires a user with administration privileges, I draw a random account and then I from a group of admin users for this account I draw a random admin user.  The reason for using random test data was two-fold:    First, when we were using static, i.e., hard-coded test data, sometimes tests started to fail, because test data no longer existed in DB, e.g., a user has been removed from the database (we're having production dump in our test DB, so I guess the user has been deleted in production). When we started to find such users at runtime, the problem disappeared.  Second problem was that it was not really clear why certain test data were used for a certain test. We have inherited tests from the other team and couldn't understand their intentions behind, for instance, using user "xyz@awesome.com". By writing queries to find data, we started to explicitly state what type of test data we want, e.g., that we want a user with administration privileges.   While my approach solved both problems, it introduced also some new issues:   Tests occasionally fail, because they pick up wrong test data. This is because queries are sometimes incorrect. For instance, once a test drawn a random account that had no administrators at all. Good thing about that is that this way I keep learning new things about the system under tests, e.g., that there must be business reasons to have accounts without administrators. Test setup becomes more and more complex, as queries start to grow and thus tests seems now a bit more complex to understand.   I was also hoping to increase coverage and find more bugs by using random test data just like it is done in fuzz testing. Instead, I mostly found bugs in my test and learned how little I know about the system under test. Finally, ROI doesn't seem big. Before the change there was a cost of maintaining static test data (updating test data if they were outdates). Now I have to maintain complex queries when the test takes "wrong" test data and this tends to occur more often than outdating of static test data previously.  I wonder whether using random test data really makes sense and how to do it right? How do I install OpenStack? How to imitate commercial fried chicken? I'm trying to develop my own "secret" fried chicken recipe, something that is similar to Popeye's or Church's. I'm a LONG ways from getting there. Here's what I did in my last experiment:   Chicken was marinated in buttermilk with Cajun spices and Tabasco sauce for 24 hours I used a deep fryer and canola oil. 175C. Prior to "dressing" the chicken, I let the excess buttermilk brine drip off the chicken. I then seasoned it with Cajun seasoning I made a batter using an egg, self rising flour, milk, baking powder I also tried using just plain flour for breading   Results:   Using the batter, the chicken came out looking burned and too smooth (didn't have that crunchy look). It burned too much that I couldn't finish cooking the chicken. Using the flour, the chicken came out with a thin crust, somewhat crispy, but also too burnt. Dipping the chicken in the batter AND then flour gave a bulky &amp; crunchy look. However, again, the result looked too burnt.   Modifications:  I then changed the the breading. I used bread flour and corn starch. I dipped the chicken in the batter again, then used the new breading. The bread flour was a bit lighter. And the corn starch was even more lighter. But they were still burn looking (just lighter shades). I also dropped the temperature to 160C.  Results:  Burnt chicken whose crust wasn't really sticking to the skin/meat.  Questions:  Any suggestions on what I can do to improve? I'm guessing something in the batter is causing the burnt coat. What flour should I use? What can I do to make the coat stick to the skin/meat? Any other suggestions on what to do? Where can I get the original Unix? A union of two subspaces not equal to the vector space. Schengen Visa Application: what are some helpful tips for preparing? Running the minimal example  \documentclass{article} \usepackage{filecontents} \begin{filecontents*}{\jobname.bib} @ARTICLE{example,   author  = {Other, Anthony Norman},   title   = {Some things I did},   year    = {2014},   journal = {J.~Irrep. Res.},   volume  = {1},   number  = {1},   pages   = {1-10} } \end{filecontents*} \usepackage[backend=biber]{biblatex} \addbibresource{\jobname.bib} \begin{document} Hello\cite{example}. \printbibliography \end{document}   I get the warning There were undefined references.  I have read  and know that I need to run:   LaTeX Biber LaTeX   However, my editor is only set up to run BibTeX. How do I go about setting up my editor/IDE to be able to run Biber, and how do I run the LaTeX/Biber/LaTeX cycle?  Answers (sorted alphabetically by editor name)                    Answer guidelines   Each answer should be for one editor. If the editor is cross-platform, if possible give a single answer with notes covering the minor platform variations. Please edit the question to include new answers in the 'link list' Each answer should be 'stand alone', i.e. don't say 'It's almost the same as editor Y but ...' for the editor part Instructions for 'build tools' such as arara or latexmk are welcome but should explain how to set up the editor in question as not all editors allow simple addition of arbitrary tools If I have NM cable running into a junction box, can I strip the sheath of the NM cable starting inside the junction box and run the conductors without a sheath through conduit that is connected to the junction box? I understand that the wiring you'd typically use through conduit is THHN or NM (if you want to use the conduit solely as protection).  But I'd like to be able to take this incoming NM cable and have it's conductors only continue on through conduit along with some other THHN that's coming from another source. The individual conductors of the NM cable while not labeled can still be traced back to where the sheathing ends, so technically the conductors are still identifiable as to what they are. If need be, I could splice the NM conductors to THHN wire in the junction box, but I don't see a reason to add a splice where I don't think it's needed. My reasoning for why I think this should be OK is that if you terminate NM cable in a panel, you typically have a foot or so of the conductors without the sheath and there's nothing identifying those other than tracing it back to the sheath it came from. find $\sum_{k=2}^{\infty}\frac{1}{k^2-1}$ Taking ownership of comments on migrated questions When a question is migrated to a SE site that I'm not registered to, I can't claim ownership of my comments. An example question:   I registered only after the question was migrated and can't delete my comments. I always like to perform some garbage collection of noise comments made by me. (like on the example question)  Would it be possible to claim ownership of comments in this scenario? Is this a bug?