I just stumbled upon this interesting  about "how to automatically draw tree diagrams of prime factorization with LaTeX" and it rang a bell.  I 'd like to create a command that displays the conversion of an integer value into a bits string (which otherwise is a tedious operation to do "by hand") to use when preparing the exams of FOundation of Computer Science. This command needs 2 parameters, the integer to convert (213, for instance) and the desired number of bits for the result. The command should also be able to convert negative values by using . The following pictures for values 137 (basic problem), -136 (negative problem) and -17 (problem requiring an 8 bits solution) should help you understand what kind of result I would like to get.  As a plus, I would like to introduce two variables to hold the min and max value allowed so that I can get the translation of a random integer value in [min, max] if I call the above command omitting the integer value. One could do the same with the number of desired bits and introduce a variable to hold an increment (4, for instance) so that it generates results with 4 bits and if a number requires 5 bits, for example, it automatically returns a solution that uses 8 bits. Not to mention that with an additional parameter one could convert to octal, hexadecimal, etc.  The problem is that I don't understand Tikz and I have no idea how to make LaTeX do maths! I read  with interest, but I still miss too many things. Can someone help please? Thanks in advance!
I am teaching how to convert from one base to another base, however, I can't find a way to do something like this:    I know little about Tikz, the only thing I have been able to produce is a simple square with a couple of lines over it, so I don't even know where to start. Any suggestions? I don't mind typing all the numbers, what I want to do is to automatize the process of creating the lines.
In Revenge of the Sith, after first being Force-choked by Anakin and then given births to Luke and Leia, Padme Amidala eventually lost her life on Polis Massa. We later, however, see her in the funeral procession on Naboo. The question is, how did she get there?    I mean, whoever delivered her there must have faced a lot of difficult questions, not just from her family but also from both the people and the authorities, since she was the former queen of the planet. Whoever it was, he could not have been just somebody, because it most certainly must not have been an easy task. It most likely was not any of the Jedi, since the world was probably half full of Palpatine's collaborators who would have immediately given them away.  So, who was it? And how was it carried out, in practice? mod_rewrite to redirect URL with query string How can PCB trace have 50 ohm impedance regardless of length and signal frequency? Hmm, this seems to be just another question on line impedances.  I understand that when we say "transmission line" effects we talk about things like cross talk, reflections and ringing (I guess that is just about it). These effects are not present at low frequencies where the PCB trace behaves like an "ideal" transmission medium, more like we expect a wire to behave in our early school days.  I also understand that the 50&nbsp;ohm value comes not from the line resistance which is going to be very small and less than 1&nbsp;ohm. This value comes from the ratio of L and C on the line. Changing C by changing the trace height above ground plane or changing L by changing the trace width shall change the impedance of the line.  We all know that the reactance of L and C is dependant on the signal frequency as well. Now my questions:   Why should we not call this as line reactance only rather than line impedance? How can it be just 50&nbsp;ohm? It has to be signal frequency dependent right?  E.g 50&nbsp;ohm at 1&nbsp;MHz  Will the world end if I chose to do a 100&nbsp;ohm or 25&nbsp;ohm trace instead?  I know that while we like to say 50&nbsp;ohm as a magic number, it will be within some range around 50&nbsp;ohm and not 50.0000 ohm exactly.  Is there any time when the actual resistance of a PCB trace may matter? ModernCV Remove horizontal line in sections I want to write my cv with moderncv-Classic style. Can you tell me, how I can remove the horizontal line in the left of each section? Image UriSource and Data Binding I've discovered a rather weird behaviour of PdfLaTeX. In this example  \documentclass{article} \usepackage[breaklinks]{hyperref} \begin{document} \url{http://www.emarketer.com/blog/index.php/quick-stat-smartphone-users-account-38-mobile-phone-users/} \end{document}   PdfLaTeX won't break the URL and create a too long line. However, if I replace \url with \href like this:  \documentclass{article} \usepackage{hyperref} \begin{document} \href{http://www.emarketer.com/blog/index.php/quick-stat-smartphone-users-account-38-mobile-phone-users/}{http://www.emarketer.com/blog/index.php/quick-stat-smartphone-users-account-38-mobile-phone-users/} \end{document}   I get the line broken, but the font of the link is not right any more of course (normal instead of texttt). Why doesn't URL break the line at dashes and what could I do to get a nicely typeset line-broken link? KDB: apply dyadic function across two lists Running programs in the background from terminal Most people spend part of each day standing, and if they have normal anatomy their heads are over their heels in this position.  Even sitting or lying down, the head is higher than the heels (if not over the heels).  Yet the phrase "head over heels" is used in ways implying it is an unusual situation.  How did such usage come to be, and why does it persist?  Why is the more obvious "heels over head" not used? What do all those cryptic number and letter codes in a lens name mean? Is the integral $\int_1^\infty\frac{x^{-a} - x^{-b}}{\log(x)}\,dx$ convergent? How can I recover data from a clicking/dying external drive? Windows asks me to reformat every time I plug it into my computer, so I fired up Ubuntu via VirtualBox (selecting the external hard drive in the USB settings for VirtualBox beforehand) to see if I can access it there.  Does anyone have any suggestions for me? I have over 1TB of data on this drive and do not want to lose it. When I plug it into an electrical outlet, the light turns on, and when I plug it into my laptop, I can feel it clicking. How align the qedsymbol after of a big formula in display mode? Do web designers need to know how to code? As a web developer, both front-end and back end architect, I work with many different designers and sometimes find it frustrating working with design comps where no thought was put into how to accomplish the design in basic CSS and HTML.  On the other hand as a developer I'm expected to be able to produce code from any design.  Do web designers need to know basic modern CSS and HTML techniques?  Why or why not is this important for a well rounded web designer?  Some general thoughts:   Front end web developers should be skilled enough to code up any design. Web designers should have an understanding of how users will actually interact with their design. Design shops would rather have designers design and leave all the coding up to the developers. Max length for HTML How to restrict the maximum number of characters that can be entered into an HTML &lt;textarea&gt;? I'm looking for a cross-browser solution. What could we call a person with deep knowledge in various fields? Why are my textures pink? Basically, I applied my textures by taking each individual object, unwrapping it in the uv editor, then opening up an image in the uv editor and it would apply the texture in the 3D editor. However, when I render my project none of the textures appear and everything looks odd. I don't know how to set up the images properly with the bee.  For example, here's the uv layout image for the bee's Cube.001:     How do I get that applied properly to the Cube.001 in my project?  Here is   Everything appears purple if the images aren't there and I don't know how to fix that either. Uncertainty modeling for samples I have instances of data that are composed of 6 attributes. Each attribute takes values between 1-10. Any instance has a utility calculated by some utility function:  Example: {1,1,2,5,5,2} , utility = 0.89  In some readings for these attribute values, undefined values may appear in the instance, I mark them as question mark '?'  Example: {1,1,?,5,?,2}  These question marks represents uncertainty in the instance.  How can I model this uncertainty in a statistical or mathematical way ?   Thanks Very similar to , except for Java.  What is the recommended way of encoding strings for an XML output in Java. The strings might contain characters like "&amp;", "&lt;", etc. Merging arrays with the same keys