I suppose this is an unusual use case. But I've run into it a few times now.  Is it possible to force all inherited classes to have public static variables that are defined in the child class?  Aka:  APacket.ID   = 0; // Abstract parent class, has static ID variable (0) PacketPos.ID = 1; // Inherits from APacket, has static ID variable (1) PacketVel.ID = 2; // Inherits from APacket, has static ID variable (2)   I want all my network packet classes to have unique and public static ID and Length variables.  Is something like this possible?
I am developing a set of classes that implement a common interface. A consumer of my library shall expect each of these classes to implement a certain set of static functions. Is there anyway that I can decorate these class so that the compiler will catch the case where one of the functions is not implemented.  I know it will eventually be caught when building the consuming code. And I also know how to get around this problem using a kind of factory class.  Just curious to know if there is any syntax/attributes out there for requiring static functions on a class.  Ed Removed the word 'interface' to avoid confusion.
I am a bit confused. When can we omit the preposition on before weekdays? (Monday, Tuesday etc.) Sometimes I read weekdays without the preposition on. If the preposition is left out, does it work the same way, or does it change the meaning?  Example without the preposition     The UGC issued the public notice Monday after its two previous orders   in this regard were overlooked by the DU.   Example with the preposition     The commission on Monday also issued a public notice against the FYUP   in all leading newspapers for parents and students. What does Morgoth look like? Is Morgoth, the original enemy in J. R. R. Tolkien's Middle-earth ever visually described? I envisage him as a bigger, meaner version of the physical Sauron, but I cannot find any reference in The Simarillion. $a_1 a_1', a_2 a_2', ..., a_n a_n'$ is not a reduced modulo system $\mod p$. If $a_1, a_2, ..., a_n$ is a reduced residue system $\mod p$ and $a_1', a_2', ..., a_n'$ is another reduced residue system $\mod p$ then $a_1 a_1', a_2 a_2', ..., a_n a_n'$  is not a reduced modulo system $\mod p$.  Not able to show a counter to it. Help Needed. How can I iterate over each file in a directory using a for loop?  And how could I tell if a certain entry is a directory or if it's just a file? This is a trivial problem, but it annoys me that I can't get to the bottom of it:  I'm running Windows 8, Powershell version 3.0. By right-clicking on the title bar I can go into the Properties and change the font, size, background colour etc without any problems.  After closing and restarting Powershell, all of the changes I've made stick except that if I've set the font to Lucida Console then on reopening I get the Raster font.  (Note that all of the above applies to when I run Powershell as Administrator.)  So:   If I set the font to Lucida, then it switches to Lucida for the remainder of the session. If I set the font to anything other than Lucida, then it stays as that after closing and reopening. If I alter the window sizes or text colours or anything else, the changes persist after reopening. The only thing that goes wrong is that if I set the font to Lucida, it switches to 'Raster fonts' when I reopen. But cmd and powershell ISE don't have this problem - only the powershell console.   Can anyone suggest what might be going wrong?  (One observation I've made is that upon re-opening Powershell after setting the font to Lucida, at first the width of the window is what it would be if the font were Lucida, but then after a second, it widens slightly to accommodate the raster font.) Should we sign-then-encrypt, or encrypt-then-sign? Frequently, we want to send messages that are (a) encrypted, so passive attackers can't discover the plaintext of the message, and (b) signed with a private-key digital signature, so active attackers can't make Alice think that a message came from Bob when it didn't. Is it better to (a) generate the digital signature from the (hashed) plaintext, and then encrypt a file containing both the plaintext message and the digital signature? Or is it better to (b) encrypt the message first, and then generate a digital signature from the (hashed) encrypted file? Or (c) combine encryption and public-key digital signatures in some other way? A closely related earlier question (  ) seems to focus on symmetric-key MAC authentication. As , Do the same issues with (symmetric-key) MAC-then-encrypt apply to (public-key) sign-then-encrypt? "shyer" or "shier" My Longman dictionary states that the comparative of 'shy' is 'shyer'. However, at least two online dictionaries also give the form 'shier' as being acceptable:  and . On an English language  I came across a reference to British (shyer) vs. American (shier) spelling. But an Ngram chart shows that even in American English 'shyer' is much more used.  My problem is that I've been told that it is definitely wrong, but if it's in dictionaries then... has there been a change to what is wrong?   P.S.: What are the fundamental differences between the mainstream *NIX shells and what scenarios might prompt you to use one over the other?  I understand that some of it probably comes down to user preference but I've only ever used Bash and I'm interested to hear where another shell might be useful. Also, is there an impact on user-written shell scripts when running under one shell or another or is it simply a matter of changing the shell at the top of the file?  My instinct says it's not that easy. How to connect faces between 2 edge loops? I'm trying to fill empty space in my mesh, and I looked at the knife tool page on the Blender Wiki, and I'm not sure if there's a way to make it so that a new edge is made using the knife tool. I took a screenshot, and hopefully it'll explain better than I can of what I'm trying to do. Oh and I'm using Blender version 2.71, by the way. I have this, in D1:  =sum(D3:D)   I want D1 to always be the sum of the rest of column D (D2 is a header)  I sometimes move a row, from eg 8 to 3, and that causes D1 to change to sum(d4:d).    I want D1 to stay as my sum of the column. I installed CCSM to enable window previews in Unity. But when I went into extras, there was no 'window preview' option.  So I tried experimenting with other options in Compiz and now there are no borders in the dialogue boxes (close, minimize, restore buttons are not there, I had enabled some 'flat....' option in Compiz.  Later, I uninstalled Compiz and then reinstalled it. Now it says      "Failed to load session Ubuntu"   I can't even access through the guest account, I am new to Ubuntu.(please explain in detail).  All I have access to is the login screen (it still shows my custom wallpaper). Please help, I don't want to lose my stuff. How can I test for POSIX compliance of shell scripts? Considering that POSIX is the closest thing to a common standard among all unices, I'm interested in knowing if there's a shell that supports it exclusively. While most modern shells provide support for POSIX (and will run POSIX compliant scripts without any problem), they don't do a good job at pointing out non compliant features.  Is there any shell that implements POSIX and POSIX only, in such a way that it'd throw an error for any non compliant feature?  EDIT I want to clarify that I'm not asking for general tips for writing portable shell scripts. The related question mentionned in the comments already covered this. I thought of this question when I found out that bash has a --posix option but only to discover that it only affects some intialization behaviors which is not exactly what I'm looking for. Text formatting now allowed in comments (List of proven and disproven abilities) A bounce-rate attack to manipulate SEO? This is a question to experienced people that might help us shed some light on the issue.   We noticed a very strange behavior on our site, in Google Analytics. Some dude from Finland, namely, from Kouvola city is hitting one of our pages - only one page on our site, 'bout a hundred times per day, all with an average bounce rate of 90%+...  This is causing our overall bounce rate to go up by 1 to 3% per day... which is very disturbing.. since we're trying to do our best in order to keep it as low as possible. And obviously having it jumped from ~24% to 27%, just because of that crazy dude is not making us happy at all... We tried implementing a geo-targeted script in order to catch this particular visitor and deliver him a juicy message, and it seemed like it helped in the beginning, it has stopped for a day or two, but now he's back...   The geo-targeted script was also logging all IP addresses for page requests originating from Finland in order to find out more details and (in order to block them on the server level, later).. but thing is, it was all mainly cable or DSL connections with various, but not constantly repeating IPs... we are all wondering what is he up to really ?   I think that this page should be kept updated with ideas on how to combat this and perhaps someone could also shed light on what it might be ? What is the reason for doing this "bounce-rate attack", as I call it?  There was a similar question asked on stackoverflow earlier, with no meaningful answer - here - What do you call someone who has extensive knowledge but won't share it? Facebook changed how their API serves profile pictures that are requested with a non-application scope UID. Now because before Graph API 2 all applications shared the original UID, if users like me has joined Stack Exchange websites before  2, rolling out their profile pictures are not shown properly. Facebook suggests to use an access token to query those profile pictures, either an application access token or a user access token. A user access token is not a reliable option at all, because it would only work for users who joined website with Facebook and are currently logged in. Application access tokens, by the way, can be used by creating sort of a proxy that would retrieve a profile picture from Facebook and display it. Yet still it's not perfect. I think the best solution is to communicate with Facebook and ask them to offer an opportunity to convert old Graph API 1 UID's to application scope user IDs. I am asking this question because I've always had the impression that manuscripts submitted to a journal in my field (theoretical linguistics) take an insanely long time to get published, and sometimes I get the impression that this is because, most of the time, nobody other than the author cares about getting things done within a reasonable amount of time. Some examples from personal experience follow.   For the last paper I submitted before getting my PhD, I had to wait nine months from the submission date to get reviews back from the referees. Last week I got a review request from a journal I had never reviewed for previously. The review deadline is March 15 (almost four months). In early October, I submitted a manuscript to a journal that I know asks reviewers to return reviews within 6 weeks. I checked the status of the manuscript online and it still says "with editor". Earlier this year, I was about to start writing a review when my wife went into labor. By the time we came back from the hospital, I had forgotten about the review, so I missed the deadline. The editor didn't contact me to ask about the review until two months after the deadline. Late in 2013, I was asked to write a survey chapter for a handbook. The expected publication date of the handbook is summer 2016.   All of this is not me being unlucky with editors and referees. In private conversations through the years, many colleagues have confirmed that it is virtually unheard of to get reviews back within 3 months of submission; 5 or 6 months seems to be a good average, but in some cases it can take longer (see my first point above). In general, everybody seems to have accepted that the submission-to-printed-journal process is going to take a bare minimum of one year, and that's assuming that the manuscript is accepted without revisions. If revisions are required, two years is not out of the question. Also, it's not like our papers are ridiculously long. I've reviewed about 100 papers so far, and the longest one was about 50 single-space pages; 30-35 single-spaced pages is closer to average.  I remember that, when I was a postdoc, my astrophysics housemate mentioned that in his field the entire submission-to-printed-journal process took only three or four months. I really can't see a good reason why theoretical linguistics shouldn't operate on similar timeframes, other than the fact that everybody seems to have grown used to things taking way longer than they really need to. What are the wait times in other fields? How do you manage to get things done quickly? I have recently noticed a huge (>3.5GB) file in the DCIM/.thumbnails folder. I have tried deleting it, but the next time I open the Camera app it rebuilds the file (and locks up the phone, sometimes displaying a "media scanning in progress" message, in the process.)  The total file size of all the (approximately 2,000) photos displayed in the Gallery is around 500MB. There are in addition around 35,000 images in folders which contain .nomedia files to instruct Android to ignore the media therein. The total file size of these is around 1.5GB. The Gallery app is correctly ignoring these images, but I wonder whether the Camera app is misbehaving and actually processing them.  I think this problem has emerged since the ICS upgrade ... either when the phone (Samsung Galaxy Note) was first updated from Gingerbread or at some later date.  Any ideas, please? Is there a reason the British omit the article when they "go to hospital"? Why do British speakers omit the article in constructions like "go to hospital" or "go on holiday"? Pretty much all American speakers would rephrase those as "go to the hospital" and "go on a holiday", I think. Is there any good reason, or forgotten sense behind those words that might explain why the articles are ommitted?  Are there other common constructions other than those two that the British use that drop the article?  EDIT: I just realized per Kosmonaut's comment that Americans do much the same thing with a few nouns, so this isn't all that special.   Do grammaticists designate nouns that can have their article dropped with anything, i.e. do they have anything in common? Are primes (ignoring $2$) equally likely to be $1~\text{or}~3\pmod 4$? For all primes $p\neq 2$, it's easy to see that $$p\equiv 1~\text{or}~3\pmod 4$$ I was wondering if it's equally likely ($50\%-50\%$) that prime modulo $4$ is $1$ or $3$. And if so, is there a simple proof?