I have a input JSON file which include data with String like "Address": "0x33". I would like to use this data to open my raw data file and seek to the file location.   infile.seek(0x30,0)   How could I convert the input data to a hex value and let my seeking address flexiable?  address="0x30" infile.seek(address,0)   How to convert string "0x30" to a hex value 0x30?
How do I convert a hex string to an int in Python?   I may have it as "0xffff" or just "ffff".
Original file claudio antonio claudio michele  I  want to change only the first occurrence of &quot;claudio&quot; with &quot;claudia&quot; so that I would get the following: claudia antonio claudio michele  I have tried the following: sed -e '1,/claudio/s/claudio/claudia/' nomi  The above command performs global substitution (it replaces all occurrences of 'claudio') . Why? How to prevent "Delhi Belly"? Proof that the largest eigenvalue of a stochastic matrix is $1$ Function whose image of every open interval is $(-\infty,\infty)$ How to find a function from reals to reals such that the image of every open interval is the whole of R?  Is there one which maps rationals to rationals? Update: Failed to lock /var/cache/apt/archives/lock I am running the upgrade(12.10 to 13.04) through terminal and it keeps getting stuck at this:  Failed to lock /var/cache/apt/archives/lock   What do I do? I have root access. I have no idea what else to try other than a clean install.  Checking package manager Reading package lists... Done     Building dependency tree           Reading state information... Done Building data structures... Done   Calculating the changes Calculating the changes  Do you want to start the upgrade?   3 packages are going to be removed. 155 new packages are going to be  installed. 1204 packages are going to be upgraded.   You have to download a total of 595 M. This download will take about  1 hour 15 minutes with a 1Mbit DSL connection and about 23 hours with  a 56k modem.   Fetching and installing the upgrade can take several hours. Once the  download has finished, the process cannot be canceled.    Continue [yN]  Details [d]y  Fetching  Could not download the upgrades   The upgrade has aborted. Please check your Internet connection or  installation media and try again. All files downloaded so far have  been kept.   Failed to lock /var/cache/apt/archives/lock    Restoring original system state  Aborting Reading package lists... Done     Building dependency tree           Reading state information... Done Building data structures... Done  root@chaitanya-XPS-Ubuntu:~# I just saw Death in Paradise Season 5 Episode 3, which features a photographer using a DSLR to shoot a fashion runway performance.  He had a flash that was a ring around the lens.   I thought that was for macro shots only, where the extreme close-up has trouble with normal flash placement.  For normal photos you want the flash far from the lens, like on a boom on a separate handle framing the camera.  I've seen some recent trendiness in having ring-shaped catch lights, but I supposed those would be positioned in the normal manner: off-angle from the lens.  I suppose if an on-camera had any effect at all it would be for some subtle fill flash.  Is this a realistic thing to see from a pro? Or is it just a cool-looking prop that doesn't really fit the situation? On a systems level, I understand that as electrons are pushed into a wire, there is a net field and a net electron velocity.  And I've read that the net electron drift is slow.  But electricity travels through the wire, essentially at c, and I want to understand that mechanism.  My apologies if my question is poorly stated, I know bare bones undergraduate quantum theory circa 1990s but it doesn't explain the motion of electricity in detail.  Here's my conception, I'm hoping someone will fill in the holes, ha ha.  An electron moves into the wire.  It's got a kinetic energy.  After travelling a short distance, it spontaneously emits a photon, which hits another electron in a valence shell.  That electron then presumably does the same.  If this conception is simply wrong, please enlighten me.  The questions that arise:   Presumably at this level, electrons are acting more like waves and less like particles, but is there any classical component in the picture, ie are electrons coming in imparting other electrons with kinetic energy through repulsion, or does it not work that way? If electrons momentarily have energy, then pass it on by a photon, what determines when that photon is emitted, and what frequency it will be?  I assume that electrons in this cloud are not limited by any kind of exclusion principal, and that any frequencies are possible? Why should a photon emitted by an electron be in the direction of travel?  Conservation of momentum tells me that if an electron is moving, the photon should be emitted in that direction, slowing the electron, but could an electron emit a photon in the opposite direction?  If it did, I assume it would somehow have had to absorb energy from elsewhere? That sounds possible by analogy with quantum tunneling. What is the mechanism by which electrons propagating increase the temperature of the material?  Are they transmitting energy to the electrons in the valence shell, which tug at the nucleus, do some photons hit the nuclei directly, or is there some other way?  Presumably, electricity travels slower than light, because there is some time in each exchange, and some time when electrons are moving at sublight speeds before emitting a photon.  By how much is this slower than light, and what is the speed of each interaction? Continued fractions Where to ask Question that can be flagged too broad or opinion based I came across the following question:    This can be easily flagged for too broad or opinion based, but I wonder on which stack-exchange site can one ask answers for such a question? Suppose I have something like the following:      \begin{eqnarray*} \mathrm{gcd}(x^3 + 6x^2 + 5x + 5, x^3 + 13x^2 + 6x + 3) &amp;=&amp; 102x^2 + 108x + 2 \ \mathrm{with} \ p = 109 \\ \mathrm{gcd}(x^3 + 2x^2 + 9x + 4, x^3 + 3x^2 + 7x + 9) &amp;=&amp; 1 \ \mathrm{with} \ p = 131 \\ \mathrm{gcd}(x^3 + 3x^2 + 9x + 12, x^3 + 6x^2 + 12x + 4) &amp;=&amp; 6x + 122 \ \mathrm{with} \ p = 157 \end{eqnarray*}   How do I align the statements at the end of each line (i.e. the "with p = ..." bit) to the right? I've just made a set of armor by using a male body mesh model I downloaded and selecting certain faces from the model and duplicating them to create viable armor pieces.   Since the pieces are just duplicated from the same mesh male model, then it's still part of the same object.   How do I separate the armor piece from the model to make the pieces separate? How can the following inequation be proven?  $$a^2 + b^2 + c^2 \ge ab + bc + ca$$ I've seen a couple other questions with this error message but it seemed that the host and ip in question were ones the OP knew. These two are unrelated to my server.  Where and why is postfix generating this error?     Jul 24 17:42:14 email postfix/smtpd[32277]: warning: hostname kimtake.respectedopinion.com does not resolve to address 62.210.28.114   Jul 24 17:42:14 email postfix/smtpd[32277]: connect from unknown[62.210.28.114]   Jul 24 17:42:14 email postfix/smtpd[32277]: disconnect from unknown[62.210.28.114] I am animating a Rubik's cube, and as soon as I get to the second rotation the blocks that have previously been rotated start tripping out even though it should have been reset. I tried making the graph linear which fixed a lagging issue I had, but the blocks still start to spin instead of rotating around a single axis. Recreate plot when data file changes Is it possible to use the TikZ/external library and have pgfplots recreate a figure when a data file that is plotted changes? Say I have something like the following:  file.tex:  \documentclass{article}  \usepackage{tikz,pgfplots} \usetikzlibrary{external} \pgfplotsset{compat=newest} \tikzexternalize \newcommand{\figFilename}{}  \begin{document}   \begin{figure}[t]     \centering     \renewcommand{\figFilename}{thePlot}     \tikzpicturedependsonfile{\figFilename.tikz}     \tikzsetnextfilename{\figFilename}     \input{\figFilename.tikz}     \caption{The caption.}   \end{figure} \end{document}   thePlot.tikz:  \begin{tikzpicture}   \begin{axis}[     xlabel={$x$},     ylabel={$y$},]     \addplot+[only marks,mark=x]       table[x=x,y=y] {data.dat};   \end{axis} \end{tikzpicture}%   data.dat:  x y 0 20.44 1 20.06 2 19.76 3 19.54 4 19.40 5 19.34   If I change thePlot.tikz, the external library will detect that the figure is no longer up-to-date and recreate it. Is it possible to have the same effect when any of the plotted data files changes as well? I tried something along the lines of \tikzpicturedependsonfile{data.dat}, and it doesn't work. That wouldn't be an ideal solution anyway, as most times I use many data files in each plot and listing all dependent files manually would be more pain than gain.  So is there an easy, automated way for the external library to check all data files included in a tikzpicture and recreate the plot if at least one of them has changed? How can I cancel an edit I made on another user's question or answer? Edits made by users who do not have edit privileges are placed in a queue until it is peer reviewed.  E.g., I edited someone else's answer. but changed my mind. If I'd edited my own question/answer, there would be a "Rollback" button, but there's no such button in the scenario I'm describing (at least none that I can see).  This is more relevant today because users can only have at most five edits waiting in the queue, and allowing one to cancel an edit would permit them to free up one of their five pending edits for something else.  Is there a way to remove one's edit from the peer review queue? Does transparency work in eevee I have been trying to create a transparent lens using the eevee rendering engine in 2.8 but the transparency slider has no effect. Has this feature not been implemented yet? I've looked all over the Web for an answer with no luck. I'm a noobee so am probably doing something wrong. Refresh Icon Cache Without Rebooting Normally, to refresh the icon cache in Windows, we have to reboot.  Is there a way to refresh the icon cache in Windows 7/8 without rebooting? Can we implement the low quality flags to delete posts after a certain number of flags? Can we implement the low quality flag to be like the abuse or spam flags. So if a certain number of low quality flags are made  on a post (whether it be a questions or an answer) the post is deleted?  This would also relieve *close vote and delete vote queues. *which is a much discussed topic.        related: When is it correct to use "yourself" and "myself" (versus "you" and "me")? I'm confused by why people use the following:     It's up to yourself.   Rather than:     It's up to you.   Another example of this would be:     Please feel free to contact ourselves if you have any problems.   Rather than:     Please feel free to contact us if you have any problems.   Are both of these correct?  Is there any reason for using the former?