Macro definition in c
What is an undefined reference/unresolved external symbol error and how do I fix it?
Get last n lines of a file, similar to tail I'm writing a log file viewer for a web application and for that I want to paginate through the lines of the log file.  The items in the file are line based with the newest item at the bottom. So I need a tail() method that can read n lines from the bottom and support an offset.  This is hat I came up with: def tail(f, n, offset=0):     &quot;&quot;&quot;Reads a n lines from f with an offset of offset lines.&quot;&quot;&quot;     avg_line_length = 74     to_read = n + offset     while 1:         try:             f.seek(-(avg_line_length * to_read), 2)         except IOError:             # woops.  apparently file is smaller than what we want             # to step back, go to the beginning instead             f.seek(0)         pos = f.tell()         lines = f.read().splitlines()         if len(lines) &gt;= to_read or pos == 0:             return lines[-to_read:offset and -offset or None]         avg_line_length *= 1.3  Is this a reasonable approach?  What is the recommended way to tail log files with offsets? it normally shows in the bottom corner as a sort of 'pie' that fills up as the picture is downloaded, similar to the 'app downloading' pie when viewing a downloading app on the home page/s  prior to this the picture resolution is terrible What would Voldemort have done had he won? This might sound like speculation, but can it be reliably predicted from canon what Voldemort would have done after he won, were he successful in defeating Harry and the Order?  Would he just rule over the wizard world and keep up the masquerade, or would he try to take over the whole Earth by starting a (dark-)wizard vs. muggle war? In some literature, I have read that a regression with multiple explanatory variables, if in different units, needed to be standardized.  (Standardizing consists in subtracting the mean and dividing by the standard deviation.)  In which other cases do I need to standardize my data?  Are there cases in which I should only center my data (i.e., without dividing by standard deviation)? Suspend process without killing it So I've got a persistent program running in the background. Killing it just causes it to restart with a different PID. I'd like to suspend it (put it to sleep without actually killing it). Does kill -9 do this? If not, how should this be done? Is the convex hull of closed set in $\mathbb R^{n}$ is closed? Is convex hull of closed set in $\mathbb R^{n}$ closed? How to run a program on a remote pc via command line? How can I run a program on a remote Windows PC in our network without the need of killing an existing remote-desktop-connection? I only need a command line for running the program and getting its results. Thank you! Prove that : $$\sum_{k=0}^{\infty} \frac{(-1)^{k}}{(2k+1)^3}=\frac{\pi^3}{32}.$$    I think this is known (see ), I appreciate any hint or link for the solution (or the full solution). Is it considered rude if you only ask Questions but almost never answer one yourself I have used the websites of SO a lot the past few months because I am busy with a large scale web project. I feel I get better answers here on SO than when I just do a Google search, maybe because I can be more specific here with my problem, and the responses are really fast.  Occasionally when I am not working I try to answer some questions, but the question almost always has an answer which is 'as good as' or 'better' than the answer I would supply.  So my question/answer ratio is about 20/1 something, if not more. When I look at my profile page I see a bucket-load of questions and almost nothing I answered myself.  Is this considered bad behaviour? I can see that this looks a little egoistic.  : One devoted to one's own interests and advancement. Is it possible to make the -init method private in Objective-C? Where can I find legendary crafting materials? How can I repair the Windows 8 EFI Bootloader? Copying protected files between servers in one line? I'd like to copy squid.conf from one server to another.   The servers don't talk to each other. I'd like to go through my workstation. Both servers have the file, so it will be overwritten on the target. The files have 600 permission and are owned by root. root login via ssh is disabled (PermitRootLogin no). I'd like to do it in one line, if possible, since it will be a part of a setup guide.   I know to do  ssh source 'tar czpf - -C /etc/squid/ squid.conf' | \     ssh target 'tar xzpf - -C /etc/squid/'   to copy files between servers and preserve permissions. However, in this case I will get "Permission denied".  I also know I can do this:  ssh -t source 'sudo cat /etc/squid/squid.conf'   This way the -t allows sudo to ask for the admin password before outputing the content of the file.  The problem is, I don't know how to combine those techniques into something that will ask for the sudo password on each server, and transfer the file to its destination. Is this possible?  UPDATE: Here's the best I could come up with:  ssh -t source 'sudo tar czf /tmp/squid.tgz -C /etc/squid squid.conf' &amp;&amp; \ ssh source 'cat /tmp/squid.tgz' | \     ssh target 'cat &gt;/tmp/squid.tgz' &amp;&amp; \ ssh -t source 'sudo rm /tmp/squid.tgz' &amp;&amp; \ ssh -t target \     'sudo tar xzf /tmp/squid.tgz -C /etc/squid &amp;&amp; sudo rm /tmp/squid.tgz'   Calling this a one-liner seems like a stretch. I think I'll just break it down to separate steps in the setup guide. What is wrong with using inline functions? While it would be very convenient to use inline functions at some situations,  Are there any drawbacks with inline functions?  Conclusion:  Apparently, There is nothing wrong with using inline functions.  But it is worth noting the following points!   Overuse of inlining can actually make programs slower. Depending on a function's size, inlining it can cause the code size to increase or decrease. Inlining a very small accessor function will usually decrease code size while inlining a very large function can dramatically increase code size. On modern processors smaller code usually runs faster due to better use of the instruction cache.  The speed benefits of inline functions tend to diminish as the function grows in size. At some point the overhead of the function call becomes small compared to the execution of the function body, and the benefit is lost  There are few situations where an inline function may not work:   For a function returning values; if a return statement exists. For a function not returning any values; if a loop, switch or goto statement exists.  If a function is recursive.   The __inline keyword causes a function to be inlined only if you specify the optimize option. If optimize is specified, whether or not __inline is honored depends on the setting of the inline optimizer option. By default, the inline option is in effect whenever the optimizer is run. If you specify optimize , you must also specify the noinline option if you want the __inline keyword to be ignored. How to suppress Terminated message after killing in bash? How can you suppress the Terminated message that comes up after you kill a process in a bash script?  I tried set +bm, but that doesn't work.  I know another solution involves calling exec 2&gt; /dev/null, but is that reliable? How do I reset it back so that I can continue to see stderr? I read a book of this series probably around 2000. I think the series was quite new then but not sure.  The main thing I remember about it is that magic is based on words of power. If you knew one word you got some extra ability, knowing two words gave you yet some other ability, and if you knew three words you became a very powerful wizard. Only one person at a time could know each word, and telling someone your word meant you died.  The main protagonist somehow gets hold of one word and then for some reason strives to learn more.  EDIT: I think that I accidentally picked up the second book of the series and never read the first one. From what I remember, the protagonist learned one word of power and got some kind of supernatural ability (cannot remember what though). He then ends up in some kind of challenge where he has to cooperate with another person who knows another word that gives super-strength.  Not very coherent memories, but I hope someone knows what series it is. It has been bugging me for years. (Not even sure if the series is good at all, but still would like to know the name.)  EDIT2:  I remember the world as being medieval-ish. I do not think there were dragons, but there may have been other humanoid races (I have a very weak recollection that there may have been an orc or similar in the story, but this could be completely wrong). The protagonist was male. How to partition for Windows/Ubuntu dual boot on same SSD I have a 500GB SSD in which i would like to have both Windows and Ubuntu. My plan is to have something similar to this: Windows 8.1 and ubuntu 14.04 Uefi boot   an efi partition (created by windows installer) which will have Grub as bootloader 150GB ntfs for Windows 15GB ext4 for Ubuntu (root) 35GB ext4 for Ubuntu (home) ~8-16GB swap for Ubuntu (I have 16GB RAM) ~284-292GB ntfs for Data shared for both Windows and Ubuntu   My current setup is   200GB ntfs Windows 300GB ntfs for Data   I plan to shrink both the Windows and the data partiton in order to achieve my desired plan.  My questions:   Does the order of partitions matter? Does it matter if the ubuntu partitions are not at the end/beggining of the drive? Does the swap partition behaves better if its the last/first partition? Can I use the shared NTFS Data partition between windows and ubuntu without encountering problems? Do I have enough space for my ubuntu /home partition (thinking that I'll have access to the ntfs shared partition)?   Edit: Laptop, Asus N56jr, i7, 16Gb Ram, SSD samsung 850 evo 500gb  Windows 8.1 and Ubuntu 14.04 Predict() - Maybe I'm not understanding it I'm adding a title clock in the foot line of a beamer slide, if I compile it with pdfLaTeX it works fine; while the clock doesn't align in the middle vertically if compiling with XeLaTeX. How can I fix this.  Here is my MWE:  \documentclass[10pt]{beamer} \usepackage[font=Times,timeinterval=1]{tdclock} \usetheme{Madrid} \title{Title} \author{Authors} \institute{Institute} \date[\initclock\tddate\ \ \tdtime]{\today} \begin{document} \frame{\titlepage} \end{document} Let $P$ be a probability measure on $(\Omega, \mathscr{F})$, If $a,b,\in\mathscr{F}$ and $A\subset B$, then $P(B)-P(A)=P(B\setminus A)\ge 0$.  So far I have:  $A\subset B \implies B\setminus A = B\cap A^c = \emptyset$ as $A$ and $B^c$ are disjoint. Since $A\cup (B\setminus A)=A\cup (B\cap A^c)=(A\cup B)\cap (A\cup A^c)=B\cap\Omega = B$  Then for $A,B\in \mathscr{F}\implies P(A\cup (B\setminus A))=P(A)+P(B\setminus A) = P(B)$ by countable additivity.  Rearranging, $P(B)-P(A)=P(B\setminus A) \ge 0$.