Is it possible to write a macro such as the following: putcharX(repeat, char)  ==&gt;  putcharX(5, '*');  ==&gt;  putchar('*'); putchar('*'); putchar('*'); putchar('*'); putchar('*');  Note: I'm not looking to use a for/while/do loop, but literally copy the command n number of times in the code. Is such a thing possible with the cpp?
I am asking this question from an educational/hacking point of view, (I wouldn't really want to code like this).  Is it possible to implement a while loop only using C preprocessor directives. I understand that macros cannot be expanded recursively, so how would this be accomplished?
Getting a better understanding of callback functions in JavaScript I understand passing in a function to another function as a callback and having it execute, but I'm not understanding the best implementation to do that. I'm looking for a very basic example, like this:  var myCallBackExample = {     myFirstFunction : function( param1, param2, callback ) {         // Do something with param1 and param2.         if ( arguments.length == 3 ) {             // Execute callback function.             // What is the "best" way to do this?         }     },     mySecondFunction : function() {         myFirstFunction( false, true, function() {             // When this anonymous function is called, execute it.         });     } };   In myFirstFunction, if I do return new callback(), then it works and executes the anonymous function, but that doesn't seem like the correct approach to me. Calculate difference between two dates (number of days)? I'm always on the hunt for free stock images to use while I design, what are some good resources for images that are under a a royalty free or creative commons licence? In Windows Vista, I have tried to set the setting 'the following number of lines at a time' to zero. I assumed my scroll wheel would not scroll anymore. But it still works.  I'm trying to disable the wheel because my RSI complaints worsen when using the scroll wheel often.  Does anyone have an idea on how to achieve this? How can I download an APK file from the Play Store? I am looking for instructions on how to install cedarview graphics drivers on Ubuntu 13.04 32bit.  My graphics hardware is a GMA3600 aka Power VR SGX545.  EDIT: It seems that they are not in Raring yet, but only Precise:   EDIT2: they seem to be closed source. We write all postive whole integers after the comma, how do we prove that this is an irrational number? ($0.1234567891011121314...$) Fantasy book where a young prince becomes a mage Why is a linear transformation called linear? Is this NPN transistor AND logic gate practical? Orbiting a specific point - Orbiting Camera How would I create a camera that with the mouse, it allows you to orbit around a specifc position, with the camera always facing that point? I would also like it to be able to always be at a constant distance from the point, and be able to orbit around it in every direction.   Any ideas? While I am familiar with Descartes and the oft-quoted idea, I think therefore I am, I am not familiar with any philosophy that actively sought to rationalize that anybody else exists.  Are there philosophers who analyzed this question? Or is it taken for granted that it is (im)possible for anybody to validate their own existence to somebody else? How to customize the package editor interface? How many square meters "twenty feet square" is? One would assume it to be about 2 square meters, but this is obviously not the case. In fact, I'm reading Illium by Dan Simmons. A quote follows:     Much like the room they had faxed into, this space was windowless and about twenty feet square. But unlike the other room, this one was warm, lighted, and free of snow or ice. And unlike the other room, this one was almost filled with an oval metal machine about fifteen feet long.   By this description, "twenty feet square" seems to mean 20x20 feet aka 400 square feet or 40 square meters. Given that Dan Simmons is a renowned American writer, it's not likely that he just can't speak English correctly. So, who's right and who's wrong here? Documents with typical LaTeX errors I am giving a LaTeX course and have the idea to let the students find and solve problems within a few documents. Basically they shall learn how to create minimal examples and read error messages.  However, currently I have no document with 'typical' errors around.  If someone has such examples from him- or herself or within this forum I would like to have the code or link. It does not matter if its short or long. It should just be enough to let the students play with it for some minutes. Is there a way to make bash more TAB friendly? I use bash on both my Mac and as my cygwin shell. Overall, I'm quite pleased with it.  My one complaint however is that its TAB completion isn't as good as Windows Command Line TAB completion.   For example, if there are two files with the same prefix, then bash just beeps at me when I try to TAB complete. If I keep nailing TAB, then it will eventually show me a list of potential files.  I definately prefer how Windows will cycle through potential files right on the command line.   Is there a way to get bash to operate similar to Windows Command Line in this regard?  If there isn't (I do not want to switch shells), am I missing something about TAB completion in bash? Is there a more efficient way to use it? I have played the game Othello (Reversi) numerous times but I never approach it with a specific logic or algorithm to apply on each move in my mind. I won many times and lost as much. How would one approach this game? How would one work in his mind to prune the possible moves and choose the &quot;right&quot; one in each step? I see that most Othello CPUs more or less &quot;think&quot; the same at each move, how should I think on each move? We're trying to debug some applications performing broadcast.  What is the difference between the broadcast address 255.255.255.255 and as e.g. reported by ifconfig,  Bcast:192.168.1.255 How do I check whether a module is installed in Python, and install it if needed? In terminal, after I start Python, how will I know what are the modules present in python? Suppose I need to learn the modules NumPy and SciPy.   How will I install it if it is not installed?  How will I know if it is already installed? Why did Harry's father emerge before his mother in HP and the Goblet of Fire? In Harry Potter book 4 (Goblet of Fire) Harry's wand 'links' with Voldemort's during their duel, and Voldemort's wand begins 'spitting out' each spell it had cast, in reverse order.  This produces false 'ghosts' of people he had killed with .  In the US printing, James Potter appears, followed by Lily.  If the spell order was supposed to be reversed, why did Harry's father's "ghost" emerge before his mother's, since it's repeatedly stated (before and after) that he died first?