In reference to  explanation:  This is particularly useful in the case when a struct is a header for a variable-length object. This is exactly my case. Furthermore, I am concerned with the alignment of my structs in the heap.  In this case, I still really do not understand what's useful about zero length arrays. How are they related to this particular situation?  EDIT:  Is it that I can put as much "data" as I want in there?
I am working on refactoring some old code and have found few structs containing zero length arrays (below). Warnings depressed by pragma, of course, but I've failed to create by "new" structures containing such structures (error 2233). Array 'byData' used as pointer, but why not to use pointer instead? or array of length 1? And of course, no comments were added to make me enjoy the process...  Any causes to use such thing? Any advice in refactoring those?  struct someData {    int nData;    BYTE byData[0]; }   NB It's C++, Windows XP, VS 2003
Want \section* to change the page header In a book, I have several numbered sections followed by an unnumbered section. I have placed an \addcontentsline following the \section* that introduces the unnumbered section, so that it will appear (unnumbered) in the ToC; that works fine. However, the page headers for the unnumbered section are continued from the last numbered section.  I am using fancyhdr with the following setup:  \pagestyle{fancy} \fancyheadoffset{0in} \renewcommand{\chaptermark}[1]{\markboth{#1}{}} \renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}  \fancyhf{} \fancyhead[LE,RO]{\thepage} \fancyhead[C]{\bfseries \draftinfo} \fancyhead[LO]{\sf\rightmark} \fancyhead[RE]{\sf\leftmark} \fancyfoot[C]{\bfseries \draftinfo} \fancypagestyle{plain}{%   \fancyhead{} % get rid of headers   \renewcommand{\headrulewidth}{0pt} % and the line } What is the difference between correlation and causation? What is the difference between correlation and causation?  Pirates and Global Temperature Example  For example, how do we know when we're dealing with correlation only and not also causation here?   What Certain Philosophers Seem to Hold Regarding This  It would seem that   Hume would saycorrelation ≡ causation. Aristotle would say that in generalcorrelation ≢ causationand thatcausation ⇔ correlationonly if we are not dealing with chance events.   ("≡" means "is identical to," and "⇔" means "implies each other.") Duplicate questions that use different words to describe the same problem are important for people to find the content via search engines. But the user experience when an anonymous user arrives at a duplicate is less than ideal.  They have to notice the duplicate link and understand that the answer they are looking for is likely behind that link. I don't think this is all that obvious to someone without experience with an SE site.  I propose to just redirect users to the duplicate automatically if the closed duplicate has zero answers. In that case they need to follow the link to the duplicate in any case, so we might as well redirect them to it in the first place.  I could imagine this being problematic with search engines, as we would be displaying different content than what the search engines see. If that is too problematic I would suggest to show a very obvious link to the duplicate in the answers section for anonymous users. recursion-consecutive numbers what is the number of subsets of the set {k∈N|1≤k≤n} with no two consecutive numbers? The answer says: $$a_n=a_{n-1}+a_{n-2}$$ with the starting conditions: $$a_0=1, a_1=2$$1. why does $a_1=2$? $$$$ 2. How does this recursion was created, I understand that if $a_n$ mean all the places with no consecutive numbers so, $a_{n-1}$ come from the fact that after the first place all those places satisfy this condition, but why there is need to "look" at what happen after the two places? Performance of try-catch in php What kind of performance implications are there to consider when using try-catch statements in php 5?   I've read some old and seemingly conflicting information on this subject on the web before. A lot of the framework I currently have to work with was created on php 4 and lacks many of the niceties of php 5. So, I don't have much experience myself in using try-catchs with php. tarring in parallel An Oceanographer friend at work needs to back up many months worth of data.  She is overwhelmed so I volunteered to do it.  There are hundreds of directories to be backed up and we want to tar/bzip them into files with the same name as the directory.  I can do this easy enough serially - but - I wanted to take advantage of the several hundred cores on my work station.  Question:  using find with the -n -P args or GNU Parallel, how do I tar/bzip the directories, using as many cores as possible while naming the end product:  origonalDirName.tar.bz2?  I have used find to bunzip 100 files simultaneously and it was VERY fast - so this is the way to approach the problem though I do not know how to get each filename to be that of each directory. Windows Managers vs Login Managers Vs Display Managers Vs Desktop Environment I posted a  and noticed people weren't distinguishing correctly between many of these things: Windows Managers vs Login Managers Vs Display Managers Vs Desktop Environment.  Can someone please clear this up, i.e. tell us the difference between them and how they are related perhaps?  What category does Xorg fall under?  What about Gdm/Kdm/Xdm?  People also talk about X.  What is X? It would be a very useful idea to be able to import PEAR projects that somebody maintains to their careers.stackoverflow.com profile. Most of what is required could be gleaned from the user specific rss profile URL; this takes the form of {username}.rss Battery Ampere-hour rating vs Battery Amps (not an experienced user) I have almost no experience whatsoever with the technicals of electronics so this is probably a very easy question for someone who does.  Do you know if a battery with a 200Ah rating can put out 200A for one hour or are there limitations? According to this website's third paragraph (), you can.     For example, an average automotive battery might have a capacity of about 70 amp-hours, specified at a current of 3.5 amps. This means that the amount of time this battery could continuously supply a current of 3.5 amps to a load would be 20 hours (70 amp-hours / 3.5 amps). But let’s suppose that a lower-resistance load were connected to that battery, drawing 70 amps continuously. Our amp-hour equation tells us that the battery should hold out for exactly 1 hour (70 amp-hours / 70 amps), but this might not be true in real life. With higher currents, the battery will dissipate more heat across its internal resistance, which has the effect of altering the chemical reactions taking place within. Chances are, the battery would fully discharge some time before the calculated time of 1 hour under this greater load.   But wouldn't that mean you could hook up a 200Ah battery and ask it to put out 12000A for one minute or 720000A for a second?  That seems very unrealistic, lol.  I'm trying to find the proper kind of off grid battery that can power a microwave through a 3000 watt power inverter.  The microwave needs 1800 watts and the battery needs to be 12 volts so that would mean I need about 150 amps, I'm wondering if a battery with a 200Ah rating could do it? Not able to calculate sum of multiple column where file data in different format .csv I have a scenario where i want to calculate sum of column   SAL|CAL|TAG|VAL 12.11"|"1.1"|"2.1"|"1.1 13.11"|"1.1"|"2.2"|"2.2 14.11"|"1.1"|"2.4"|"2.4   My below code not giving output giving output as 0.00  I need output for this column CAL VAL  awk -F'|' '{T+=$2} END { printf "%.2f\n", T }' demo.txt   output :  6.7 5.7 The site description in the hero header is wrong for Meta sites The hero header contains the same description for the Main and Meta sites. Here's the one for MSO:           Meta Stack Overflow is a question and answer site for professional and enthusiast programmers. Join them; it only takes a minute:    This can easily confuse people who are new to the network, so I feel this should be changed to something Meta specific. Perhaps re-use the text from the sidebar, that has a good description:     This site is intended for bugs, features, and discussion of Stack Overflow and the software that powers it. You must have an account on Stack Overflow to participate. Does "the same number of people" behave as singular or plural? This hurts my eyes to read it and my ears to say it, but the writer stands by          About the same number of people was awarded bachelor's degrees in 2010 as filed for personal bankruptcy (1.6 million).   Is the subject in this sentence singular or plural? Can I tap a creature with summoning sickness to pay "tap an untapped creature you control" costs? I have a  on the battlefield and I played a vampire earlier this turn. Can I tap both to transform Chosen of Markov even though I just played the vampire?  Extra Example: I play  to put two 1/1 white bird tokens into play. Can I now tap a both of them and another creature I control to pay Battle Screech's flashback cost of tapping three white creatures?   Obviously these creatures couldn't use any tap abilities until my next turn, but since the tapping is coming from a different source, I figured the situation might be different. I want to know, if this bug is fixed, because all previous versions of Ubuntu didn't work for me. So I just want to know, should i leave Windows 10 and go for Ubuntu 17.10. Thanks! Are there any drawbacks to using a wish spell to increase ability scores? If not then what would stop players from just using wish repeatedly and raising their ability scores to 30?  I'm just getting back into RPGs with D&amp;D 5e after not playing for years, and I seem to remember this being covered in the editions we played back then. How to make a domain receiving email behind cloudflare? Is it acceptable to change colors on a logo to make it fit a website's theme? I have a few payment brand images that need to go in the footer of a website, the footer is very dark grey, to the point where making the logos grey-scale wouldn't be much of a good idea, especially as we still need the logos to stand out.  For example I took the following logo:   And changed it to fit with our very dominant red theme:    Is this good in terms of the user's perspective? Is this legal or misrepresenting the brand? If so is completely changing a logo to white acceptable for dark backgrounds? Space ship manned by only AI returns home to a different earth, back in time Are There Any Mechanics for Removing Possession? So I'm thinking of a few adventure hooks for my players, and I thought about the possibility of them removing a demon that has possessed a noble. Are there currently any mechanics or rules surrounding possession and the removal of entities?  If not, does anyone have any play-tested homebrew rules? How to get relative path from absolute path There's a part in my apps that displays the file path loaded by the user through OpenFileDialog. It's taking up too much space to display the whole path, but I don't want to display only the filename as it might be ambiguous. So I would prefer to show the file path relative to the assembly/exe directory.  For example, the assembly resides at C:\Program Files\Dummy Folder\MyProgram and the file at C:\Program Files\Dummy Folder\MyProgram\Data\datafile1.dat then I would like it to show .\Data\datafile1.dat. If the file is in C:\Program Files\Dummy Folder\datafile1.dat, then I would want ..\datafile1.dat. But if the file is at the root directory or 1 directory below root, then display the full path.   What solution would you recommend? Regex?  Basically I want to display useful file path info without taking too much screen space.  EDIT: Just to clarify a little bit more. The purpose of this solution is to help user or myself knowing which file did I loaded last and roughly from which directory was it from. I'm using a readonly textbox to display the path. Most of the time, the file path is much longer than the display space of the textbox. The path is supposed to be informative but not important enough as to take up more screen space.  Alex Brault comment was good, so is Jonathan Leffler. The Win32 function provided by DavidK only help with part of the problem, not the whole of it, but thanks anyway. As for James Newton-King solution, I'll give it a try later when I'm free.