I'm trying to make an ASCII table with binary numbers included, but I have no clue how. Here's the code. int main() {     unsigned int hi;     printf(&quot; D | H | O | B\n&quot;);     for (hi = 0; hi &lt;= 255; ++hi) {         printf(&quot;--------------------------\n%d | %x | %o | %b | %c |\n&quot;, hi, hi, hi, hi , hi);     } }  I want to add binary numbers where %b is. Thank you.
I can print with printf as a hex or octal number.  Is there a format tag to print as binary, or arbitrary base? I am running gcc. printf(&quot;%d %x %o\n&quot;, 10, 10, 10); //prints &quot;10 A 12\n&quot; print(&quot;%b\n&quot;, 10); // prints &quot;%b\n&quot;
Check if specific id element exist Sometimes you just want to let out some steam, and troll about some technology or software. You are not looking for any answers, but for users with similar experiences and interesting stories. So why not create a separate discussion site (trolling.stackoverflow.com?), where you could ask questions like "why do you hate technology X" or "What are the stupidest bugs you encountered in X"? Non-perpendicular hyperplane decision trees The usual implementation of decision trees, and estimators based on ensembles of decision trees, use decision trees that threshold on a single predictor at each split. So they divide the feature space into perpendicular hyperlanes.  Is there any benefit to generalizing this a tiny bit. So at each split, the decision tree uses 2 features, and thresholds based on whether $ax_1 + bx_2 \ge T$. In other words, the feature space is now getting divided into hyperplanes that are not necessarily perpendicular.   I think the main disadvantages would be:    increased computation, and  overfitting since now using more degrees of freedom   I guess to help both of these issues, randomization could be used analogous to extra trees. The pair of features could be randomly selected, instead of exhaustively trying every pair, and the threshold T and parameters a and b could be chosen randomly as well (perhaps from a set of few discrete values such that the hyperplanes could have a few orientations).  Are there some cases where you think these non-perpendicular decision trees would be an improvement over the regular implementation of various decision tree algorithms? How do I fill arrays in Java? Consider this reverse biased diode :     I read that no or very small current flows in reverse biased diode as depletion layers get widened and huge resistance is offered so no electrons can cross it. But, why the electrons or holes need to cross the depletion layer? In the diagram above, the positive charges (holes) are moving towards left and the current due to electrons is also in left, so won't the circuit be completed? I'm using LyX for technical documentation and want to automate the process of creating PDF files.  Within LyX, I can simply click the button "View PDF (XeTeX)", and LyX performs the whole build process for me: it creates a .tex file, does some bibliography magic, and uses XeTeX to create the final PDF file.  What I'm looking for is a way to call LyX from the command line and get the same result. So far, I've only managed to generate a plain .tex file (using --export-to xetex). However, when I run xelatex on the generated file, it keeps showing errors that don't occur when building using LyX. Is there a way to get LyX to do the work?  My system: Windows 7 64bit, LyX 2.1.0 How to check if my eSATAp port provides 12V power? I have a Lenovo ThinkPad Edge 13" model 0217-2QG with eSATAp port.  How do i check if my port provides 12V power (enough to power a 3.5" HDD)? How to align right within equation array I have this struct:  struct Map {     public int Size;      public Map ( int size )     {         this.Size = size;     }      public override string ToString ( )     {         return String.Format ( "Size: {0}", this.Size );     } }   When using array, it works:  Map [ ] arr = new Map [ 4 ] {     new Map(10),     new Map(20),     new Map(30),     new Map(40)};  arr [ 2 ].Size = 0;   But when using List, it doesn't compile:  List&lt;Map&gt; list = new List&lt;Map&gt; ( ) {     new Map(10),     new Map(20),     new Map(30),     new Map(40)};  list [ 2 ].Size = 0;   Why? How do I identify SMD components? (or how do I identify any component) How do I identify the markings on an SMT component and match it up with a part number so I can be a good designer and actually look at a datasheet (and read the whole thing)? Or identify a part to replace an unknown part on a PCB? Is an idle temperature of 66°C for the A10-6800K CPU normal? I have an A10-6800K CPU and Piriform Speccy says that my CPU temp is 66 celcius in idle, the same goes for HWMonitor.  Is this normal/ideal? I have a  with a . This is something I've been curious about since starting this whole 'meta' thing a couple years back.     Let's say a user posts a feature request.   Under what circumstances is the feature-request read by staff? If staff decline to do anything (I'd guess it's some sort of triage), under what circumstances is the feature-request reevaluated by staff?     Let's say a user posts a bug.    Under what circumstances is the bug tested? What generally determines whether a verified bug is actionable? (And/or what are the criterion for deciding what to do?)     For both of the above, would it be possible to see a general-but-relatively-detailed flow for what happens to these questions? Did Dumbledore know that Harry would have to sacrifice himself from the very beginning? Based on the following interchange between Harry and Dumbledore in the pivotal &quot;King's Cross&quot; chapter of Deathly Hallows, I was wondering when exactly Dumbledore put together that Harry would have to die in order to bring about Voldemort's ultimate demise:  &quot;And you knew this? You knew--all along?&quot; &quot;I guessed. But my guesses have usually been good,&quot; said Dumbledore (Deathly Hallows, 599, hardcover).  The conversation that spurred Harry's question includes material dating back to Halloween '81, but also specifically mentions the events of the graveyard from GoF. So, &quot;knowing all along&quot; could refer to everything (i.e., Harry must die, Voldemort ignorantly tethered him to life, etc.) or just that Voldemort tethered him to life. Other important information pertaining to this question can be found in OOTP, when Dumbledore confirms (if he didn't already know) that Harry contains part of Voldemort's soul. He uses the silver instrument to find out that Harry is just like Nagini, having the ability to share mind and soul with Voldemort. He also says the following:  &quot;I guessed, nearly fifteen years ago,&quot; said Dumbledore, &quot;when I saw the scar upon your forehead, what it might mean. I guessed that it might be the sign of a connection forged between you and Voldemort&quot; (Order of the Phoenix, 826-827, hardcover).  While confirming that he guessed that Harry might share a connection with Voldemort from the very beginning, Dumbledore does not confirm with this statement that he knew Harry would ultimately have to give up his life. In Philosopher's Stone, when Dumbledore drops off Harry on the Dursley's doorstep, we know he is not entirely truthful with McGonagall.  McGonagall asks: &quot;How in the name of heaven did Harry survive?&quot; &quot;We can only guess,&quot; said Dumbledore (Philosopher's Stone, 12, hardcover).  Of course, this was a lie. Dumbledore already knew how Harry survived, otherwise he wouldn't be delivering Harry to Lily's sister to extend the blood sacrifice. By proxy, he also knows that Voldemort will return b/c of Horcruxes, otherwise he wouldn't be so worried about Harry. Finally, when asked in the same scene if he could remove the scar, Dumbledore says:  &quot;Even if I could, I wouldn't. Scars can come in handy&quot; (Philosopher's Stone, 15, hardcover).  So, did Dumbledore know at this very moment that Harry would have to die? Did he at least guess it to be true during this scene? We know he gains perfect confirmation in OOTP, but did he know it &quot;all along,&quot; as a particular reading of the King's Cross interchange in DH would have us believe? Can I boil milk unattended (and still keep the pan clean)? Why is my camera so forgiving for overblown exposure when shooting in RAW? Prove that $ n^3 + 5n$ is divisible by 6 for all $n\in \textbf{N}$ Prove that $ n^3 + 5n  $ is divisible by 6 for all $ n \in \textbf{N} $.  I provide my proof below. Limits, find a limit that exist in absolute value but not outside the absolute value. Why does flag marking as helpful/declined not always correlate with moderator action? He has  yet to receive an appointment.   He is yet to receive an appointment.      Is there any difference in meaning? Is one more correct than the other? If all motion is relative, how does light have a finite speed?