Supposed I have written a program, and I want to make sure that its code will not be changed (for now, let's assume we are using an interpreted / scripting language, so "just compile it" is not a valid answer).  So I would like to detect if someone changes the code. How can I do this reliably?  The most obvious way is to hash the code, put the hash into the code, and verify it - but of course this does not work, as it is pretty easy to simply rehash the code. You would have to know the hash in advance and put it into it while calculating the hash, but this is a chicken-egg problem, obviously.  Are there any other options that are reliable?
I need to write a small program that can detect that it has been changed. Please give me a suggestion!  Thank you.
How to convert decimal to hexadecimal in JavaScript How does item level and rarity affect the possible attributes? Rules and guidelines for drawing good schematics There are a lot of poorly drawn schematics here. A few times people have actually asked for critiques of their schematics. This question is intended as a single repository on schematic drawing rules and guidelines can point people to. The question is  What are the rules and guidelines for drawing good schematics?     Note: This is about schematics themselves, not about the circuits they represent. Evaluating $\int_0^{\infty}\frac{\ln(x^2+1)}{x^2+1}dx$ How would I go about evaluating this integral? $$\int_0^{\infty}\frac{\ln(x^2+1)}{x^2+1}dx.$$ What I've tried so far: I tried a semicircular integral in the positive imaginary part of the complex plane, excluding the negative real axis, but had trouble calculating the residue at $z=i$ (perhaps there is a way of doing this that I don't know of). After that didn't work, I tried a rectangular box integral from $\epsilon$ to $R$, from $R$ to $R+i/2$, from $R+i/2$ to $-S+i/2$, from $-S+i/2$ to $-S+i\epsilon$, from $-S+i\epsilon$ to $-\epsilon+i\epsilon$ and finally a semicircle around the origin, radius $\epsilon$.   Any help would be appreciated. Does 'rm .*' ever delete the parent directory? The expression .* is expanded by bash to include the current and parent directories:  $ ls -la total 2600 drwxrwxrwx   2 terdon terdon 2162688 Sep 10 16:22 . drwxr-xr-x 142 terdon terdon  491520 Sep 10 15:34 .. -rw-r--r--   1 terdon terdon       0 Sep 10 16:22 foo $ echo .* . ..   If I run rm -rf .* on my Debian using GNU bash, version 4.2.36(1)-release and rm from rm (GNU coreutils) 8.13, I get this message:  $ rm -rf .* rm: cannot remove directory: `.' rm: cannot remove directory: `..'   Is this a GNU thing or is it POSIX? Are there any *nix systems where the command above will silently delete . and ..?  Also, is this a safety feature of the shell or of the rm command itself? With the enthusiastic question of "Who wants ice-cream?", what is the more correct response?         (Not) I.   (Not) me.      Neither response is a sentence. The first response of "(not) I" sounds stuffy, like it should be followed with an indignant sniff. The second sounds like American idiom and acceptable for casual speech.    What do you say? No Time in Top Panel (Gnome Classic) I've been using Ubuntu with Gnome Classic for a while and I've noticed recently that in the "Indicator Applet Complete" in the Top Panel, my name and the clock have disappeared.    I think it happened a while ago when I was messing around with packages. Every time I did apt-get... it would say "the following packages can be removed by apt-get autoremove", so I did it and then the clock and my name stopped appearing.   Can anyone help me? Thanks. It would be greatly appreciated. Design Review: 3.3V Logic to 12V Logic (Uni-directional and Bi-directional) I'm looking for feedback and improvements on my design below. Specific questions are at the end. I created this as an attempt to answer my own, . From my feedback there, it seems like I needed to be more clear in my requirements. These are screenshots from Eagle. If there's a better way to share, please let me know so I can correct it. Entire board  The overall purpose of this board is to translate between 12V logic, and 3.3V logic. The top portion of the board represents the 12V side. The LEDs are placeholders to indicate whether the 12V signal is HIGH or LOW. In practice, these would be replaced with more , requiring up to 3A. The switches are also placeholders, allowing one to manually turn the 12V signal on and off. They are only for test purposes, the &quot;real&quot; 12V signal would be coming as the output from other relays. The bottom half is the 3.3V side. This will be connected to a  (BBB). The board will connect to 2 output GPIO pins and 2 input GPIO pins of the BBB. Overall, I want to translate the 3.3V I/O from the BBB to the 12V signals on the other side (to control more relays and read their signals). I have designed 3 modules to control both directions individually, and together. 3V3_TO_12V Module  This module converts the 3.3V GPIO output from the BBB to a 12V signal on the other side. When the 3.3V signal is low, the 12V signal is low. When the 3.3V signal is high, the 12V signal is high. To do this, the 3.3V GPIO output is connect to a , which turns a  relay on and off. This switches the 12V power as output of the module to be used elsewhere. 12V_TO_3V3 Module  This module converts a 12V signal to 3.3V signal, to be read by a GPIO input from the BBB on the other side. When the 12V signal is low, the 3.3V signal is low. When the 12V signal is high, the 3.3V signal is high. To do this, the 12V signal simply turns a  relay on and off. This switches the 3.3V power to be read as input by the BBB. DUAL_12V↔3V3 Module  This module combines the previous two modules to create a bidirectional translation. If the 12V side is high, the 3.3V input to the BBB GPIO should be high. If the 3.3V output from the BBB GPIO is high, then the 12V side should be high too. It's similar to a logical OR, if either side is high, the corresponding signal on the other side should be high too. A single 12V signal has to be split into individual input and output signals on the 3.3V side for the BBB. Questions  Is the  and  relay combination overkill for having the BBB GPIO output control the 12V power line? I like the isolation and safety it provides, but it seems too much (in terms of cost and board space) Is there a better solution for the 12V to 3.3V conversion. I like the simplicity of the  relay switching a 3.3V signal, but it takes up lots of room. Does the DUAL_12V↔3V3 Module (which combines each translation direction) even make sense? This seems wasteful to use 2 relays and a high side driver, but I haven't found simpler solution that achieves the same result. Should I add pulldown resistors for the BBB GPIO inputs, or are the internal pulldown resistors good enough?  Any other feedback is welcome. I'm new to electronic design. My father wrote some papers on cosmology that remained unpublished at the time of his death.  I have been looking for a publisher for them. I contacted IOP publishing but they said that, while Dad’s writings were interesting, they were not ready for publishing in any of their journals. For example, they need a reference list citing other current published research on the same topic.  I am not a scientist and have no idea how to do this. Where can I get help with this? Would something like  be a good idea? Are all eigenvectors, of any matrix, always orthogonal? How to Measure Luck vs Skill in Games? Proposition      Let $\mathcal{P_e}$ be the set of functions $p_e(x) = a_o + a_2x^2 +  \cdots + a_{2n}x^{2n}$, $p_e : \mathbb{R} \to \mathbb{R}$      Show that all $f:[0,1]\to\mathbb{R}$ can be uniformly approximated by   elements in $\mathcal{P_e}$   Attempt:    Since we are talking about polynomials let's try play with Weierstrass Theorem  By definition $\mathcal{P_e}$ is dense in  $C^0([0,1], \mathbb{R})$ , if for every funciton $f \in C^0([0,1], \mathbb{R})$, $\exists p_e \in \mathcal{P_e}$ such that $\forall \epsilon &gt; 0, \forall x \in [0,1], ||p_e-f||&lt; \epsilon$  So we want to show $\|p_e - f\| &lt; \epsilon$  Try something like...since every continuous function is approximated by polynomials i.e. $\forall \epsilon &gt; 0,\ \|f - p\| &lt; \epsilon$, therefore let $p$ be a polynomial, $p = a_0 + a_1x + a_2x^2 + a_3x^3 + \cdots$  $$\|p_e - f\| \leq \|f - p\| + \|p - p_e\|$$  $$\Rightarrow \|p_e - f\| &lt; \epsilon + \|p_o\|,$$ where $p_o$ is an odd polynomial  $$\Rightarrow \|p_e - f\| &lt; \epsilon + \sup_x|a_1+a_3+\cdots+a_{2_n+1}|$$  Stuck.   In any case, $p$ and $p_o$ is poorly defined. What would be the standard approach to prove the proposition? How can I have  for Ubuntu? How to style text in hyperref \url? How to copy file path to clipboard? Is there a way to copy the currently selected filename, including the path, to the clipboard? Ideally this would be through the right-click menu.  Some degree of flexibility would be useful, like the ability to copy just the filename, path+filename, filename minus extension, etc. This isn't essential, though, as long as it can copy the path+filename.  The solution must be compatible with Windows XP, Windows Vista and Windows 7. Are there any significant plot elements in Fantastic Beasts that will be missed if I haven't seen the Harry Potter films? I have read all seven Harry Potter books, and The Cursed Child1, but I've only watched the first two movies.  Do I have to watch all eight movies in order to fully understand the significant plot points found in Fantastic Beasts and Where to Find Them?  Is there anything that I'll miss by not having seen them?    1 Waste of money, that. How do I cash a USD cheque in Europe, quickly? I'll receive a USD cheque shortly. I prefered payment by money transfer, but all attempts to do so - i.e. SWIFT/IBAN, Payoneer, transferwise - failed. Now I will receive a cheque by mail.  I contacted my bank and they say that they can cash a cheque for me, given a (prob hefty) fee. The bank employee was so kind to warn me, that in case of a cheque the funds are cashed, but reserved until the legal reimbursement period ends, which apparently is between 3 and 6 months.   Is there really no quicker way to receive payments by cheque and have access to the funds quickly? Binary search (bisection) in Python Is there a library function that performs binary search on a list/tuple and return the position of the item if found and 'False' (-1, None, etc.) if not?  I found the functions bisect_left/right in the , but they still return a position even if the item is not in the list. That's perfectly fine for their intended usage, but I just want to know if an item is in the list or not (don't want to insert anything).  I thought of using bisect_left and then checking if the item at that position is equal to what I'm searching, but that seems cumbersome (and I also need to do bounds checking if the number can be larger than the largest number in my list). If there is a nicer method I'd like to know about it.  Edit To clarify what I need this for: I'm aware that a dictionary would be very well suited for this, but I'm trying to keep the memory consumption as low as possible. My intended usage would be a sort of double-way look-up table. I have in the table a list of values and I need to be able to access the values based on their index. And also I want to be able to find the index of a particular value or None if the value is not in the list.  Using a dictionary for this would be the fastest way, but would (approximately) double the memory requirements.  I was asking this question thinking that I may have overlooked something in the Python libraries. It seems I'll have to write my own code, as Moe suggested. Python and regular expression with Unicode I need to delete some Unicode symbols from the string 'بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ'  I know they exist here for sure. I tried:  re.sub('([\u064B-\u0652\u06D4\u0670\u0674\u06D5-\u06ED]+)', '', 'بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ')   but it doesn't work. String stays the same. What am I doing wrong? Fantasy book, YA, Girl with magical powers & tattoos I read this book series in middle school. I believe that it would be classified as young adult fiction/fantasy. A girl has magical powers, and with her growing powers comes runes/tattoos in her arms. This is shown on every book cover. I know that one cover is blue. This one shows the girl in a black tank top and black pants. One is a yellow cover, with her in a dress (I think).  The girl has a friend/mentor, who she develops feelings for. The girl is the key to stopping a war between multiple factions/people. Each side is trying to use her to their advantage. I think the series was written in the early 2000s.