Use cases for hardlinks?

Question: In what situations would one want to use a hard-link rather than a soft-link?  I personally have never run across a situation where I'd want to use a hard-link over a soft-link, and the only use-case I've come across when searching the web is deduplicating identical files.
Comment: Well the first hardlink to a file is pretty darn useful.
Comment: There are good answers below, but consider the (moot) historical context.  When Unix was new, disk drives were slow and had limited capacity and buffering. A hard link was simply another direct entry in the file system to the same file.  Whether you were accessing **ls**, or as you liked to call it, **list**, was irrelevant. If you had made **list** a soft link, its use would involve finding it in the directory, reading the special file called *list*, see that you want the file *ls*, find **ls** in the directory, and read the actual *ls* file from disk. A **huge** difference in performance!
Comment: POSIX directory semantics would have to be designed differently: `..` is always the same inode as `.` in the parent directory.  Things like `find` can check that link-count=2 to detect leaf directories, and avoid `stat`ing the entries from readdir to look for subdirectories.  But that's only a minor feature enabled by support for hardlinks of non-directory files (regular, symlink, device, socket, and named-pipe).  (Yes, symlinks have their own inode, and can be hardlinked.)
Comment: One reason for using hardlinks I haven't seen in my review of SO, of a "global" nature. Imagine a filesystem where files are generally small (mostly short memos, say), but to keep things organized you may need pointers to the same file in different places. With symlinks, each pointer uses up an inode. Such filesystems may already have an issue with running out of inodes. Using hardlinks as pointers helps with this issue. inodes are limited in number; names for them are not (at least, not in the same way).
Comment: @OrangeDog: Yes, but you only need a link-count field in the inode if you want to support multiple links.  (You might need a flag for the in-memory version of inodes to handle the unlinked but still-open case.  fsck after a crash without journaling would still have to look for inodes with no links either way.)
Comment: I'm using hard links to archive log files in my dev environment. Whenever I rebuild, the log directory is deleted and recreated. By hard-linking the individual log files elsewhere I can save a reference to the logs. A cron job periodically checks whether the reference is the same file as the log file and if not, creates a new hard-link.
Answer: Aside from the backup usage mentioned in another comment,  which I believe also includes the snapshots on a BTRFS volume, a use-case for hard-links over soft-links is a tag-sorted collection of files. (Not necessarily the best method to create a collection, a database-driven method is potentially better, but for a simple collection that's reasonably stable, it's not too bad.)
A media collection where all files are stored in one, flat, directory and are sorted into other directories based on various criteria, i.e.: year, subject, artist, genre, etc. This could be a personal movie collection, or a commercial studio's collective works. Essentially finished, the file is saved, not likely to be modified, and sorted, possibly into multiple locations by links.
Bear in mind that the concept of "original" and "copy" are not applicable to hard-links: every link to the file is an original, there is no "copy" in the normal sense. For the description of the use-case, however, the terms mimic the logic of the behavior.
The "original" is saved in the "catalog" directory, and the sorted "copies" are hard-linked to those files. The file attributes on the sorting directories can be set to r/o, preventing any accidental changes to the file-names and sorted structure, while the attributes on the catalog directory can be r/w allowing it to be modified as needed. (Case for that would be music files where some players attempt to rename and reorganize files based on tags embedded in the media file, from user input, or internet retrieval.) Additionally, since the attributes of the "copy" directories can be different than the "original" directory, the sorted structure could be made available to the group, or world, with restricted access while the main "catalog" is only accessible to the principal user, with full access. The files themselves, however will always have the same attributes on all links to that inode. (ACL could be explored to enhance that, but not my knowledge area.)
If the original is renamed, or moved (the single "catalog" directory becomes too large to manage, for example) the hard-links remain valid, soft-links are broken. If the "copies" are moved and the soft-links are relative, then the soft-links will, again, be broken, and the hard-links will not be.
Note: there seems to be inconsistency on how different tools report disk usage when soft-links are involved. With hard-links, however, it seems consistent. So with 100 files in a catalog sorted into a collection of "tags", there could easily be 500 linked "copies." (For an photograph collection, say date, photographer, and an average of 3 "subject" tags.) Dolphin, for example, would report that as 100 files for hard-links, and 600 files if soft-links are used. Interestingly, it reports that same disk-space usage either way, so it looks like a large collection of small files for soft-links, and a small collection of large files for hard-links.
A caveat to this type of use-case is that in file-systems that use COW, modifying the "original" could break the hard-links, but not break the soft-links. But, if the intent is to have the master copy, after editing, saved, and sorted, COW doesn't enter the scenario.
Comment: FYI: btrfs snapshots aren't hardlinks. They have different behavior (e.g., modifying one copy doesn't modify the other). And `stat` will show only one link.
Comment: @derobert Not sure how snapshots work, little investigation shows interesting things. For unchanged files/directories `stat` show the same inode number, but different device ID. Must have something to do with the way subvolumes are overlaid on the main, rarely mounted, volume. I suspect that if the main volume was mounted `stat` would show a link count equal to the number of snapshots that held that version of the file. COW probably takes care of the modifying one not affecting any others. Mere speculation based on mild curiosity, but not curious enough to dig deeper.
Comment: Each symlink has its own inode, so it uses up an inode entry in the filesystem.  Traditional Unix filesystems require you to choose how much space to reserve for inodes at FS creation time, instead of allocating it as-needed like XFS does.  So it's actually significant that the symlink version would use up many more inodes (even besides the VFS cache footprint implications).
Answer: Hard links are useful for cases where you don't want to tie the existence of both files. Consider this:
touch a
ln -s a b
rm a

Now b is useless. (And these steps may happen quite far apart, be done by different people, etc.)
Whereas with a hard link,
touch a
ln a b
rm a

b is still present and correct.
There are a number of scenarios where this is useful. One which is commonly encountered is de-duplication:

within a file system, e.g. in your home directory, de-duplication tools can replace copies with hard links; this preserves some of the  "independence" of the two files, in that one can still be deleted without affecting the other, but it does mean that changes to one will be visible in the other (unless the tool making the change uses the "save to new file and rename" strategy)
within a backup system, hard links are often used to maintain multiple snapshots: if a given file is backed up every day, the backup system can hard link all the copies (but not the original), which reduces the space requirements while still ensuring that each snapshot is self-supporting at the file system level.

Another use-case is to make a file available in some other location. For example, if you have a script which you maintain in a "development" location, you may want to hard-link it to a location on your path; this ensures that the script remains available even if you remove it in your development directory. (There are a number of caveats in this scenario however; you may find it more appropriate to "install" a specific version in your path, or use a symlink.)
Comment: @DepressedDaniel hard links are fine *inside* a backup system, you just don't want the backups to be hard linked to the live files. But in any case a backup should never be reachable directly from a live system...
Comment: @MatthewCline You would want this behavior when managing efficient incremental backups. Especially when old backups are deleted, in a soft-link based backup system you would have to check and relink all newer backup files/links to a valid base again, whereas hardlinks do that job "for free" on inode level.
timeshift/backintime for example use hardlinks extensively.
Comment: @orzechow I don't think you want hard link behavior anywhere near your backup system. https://github.com/bit-team/backintime/wiki/FAQ#how-does-snapshots-with-hard-links-work backintime foolishly assumes that all changes to files will be by a remove-create cycle rather than updating in place.
Comment: This is not an answer-- specifically, it's not a use case. It's just a demonstration of hard links behavior.
Comment: @ThomasPadron-McCarthy that's a misunderstanding. BiT uses hard-links  only to link identical files inside different snapshots. They are NOT linked to the original file! (I'm the BiT Dev)
Comment: But when is that desirable?  I've never found myself in a situation where I want that behavior.
Comment: @DepressedDaniel As StephenKitt points out, I meant hardlinks _within_ the backup. You're right, that diff-based increments would use even less memory. But hardlink-based backups have the huge benefit, that all snapshots are fully functional folders in a file system. This is handy, because you can restore (or chroot or ...) specific snapshots without the backup software used to create this snapshot.
Comment: @DepressedDaniel: Are you saying that Back In Time uses hard links to the original files, and not just to other files within the backup? If so, that sounds so strange that I expect there is some misunderstanding.
Comment: Use-case? I have a script `foo.sh` in a git repo (/my/git/repo/foo.sh), and I also use the script from a location outside the git repo (/my/scripts/foo.sh). Create a hard link: `ln /my/git/repo/foo.sh foo.sh` & move the hard link to `/my/scripts`.
Answer: A single program may change its behavior depending on what name it is launched as:
$ ls -li `which pgrep` `which pkill`
208330 -r-xr-xr-x  2 root  bin  19144 Jul 26  2016 /usr/bin/pgrep
208330 -r-xr-xr-x  2 root  bin  19144 Jul 26  2016 /usr/bin/pkill

Which over in the source is decided via something like
if (strcmp(__progname, "pgrep") == 0) {
    action = grepact;
    pgrep = 1;
} else {
    action = killact;

though the exact details wil vary depending on the OS and language involved.
This allows (mostly) identical code to not have to be compiled out to two (mostly) identical binaries. Bear in mind unix dates to days when disk space was super expensive, though according to Stevens in APUE chapter 4 symlinks were implemented in BSD4.2 (1983) to replace various limitations of hardlinks. A test program to check whether the symlink name is used as the program name might look something like:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
    printf("called as '%s'\n", *argv);
    exit(0);
}

And tested via:
$ cc -o myname myname.c
$ ln -s myname alias
$ ./myname
called as './myname'
$ ./alias
called as './alias'
$

Comment: @thrig, the question specifically asks for use cases that cannot be accomplished by symlinks or are, at least, preferable rather than using symlinks.  Your answer apply to both HLs and SLs.
Comment: But isn't that usually handled with softlinks?
Comment: BusyBox takes this to the maximum.
Comment: @MatthewCline it could be today, but symlinks did not exist prior to 4.2BSD (1983) according to Stevens in APUE.
Answer: When my P2P software finishes downloading a certain file, the file is placed in a specific directory. Downloaded files hardly ever need to be edited. The common case is I make a hardlink in a different directory where I need the file to be.
Advantages:

I still share the file in P2P network as I should even if I rm or mv the "copy".
The file is also at the path where I need it; most of such locations are not shared.
I can rm the "original" to stop sharing the file; this operation doesn't affect the "copy" in desired place.
My diskspace is used just once.

The main point: if I knew in advance which file I would rm first, I might go with a symlink; but I never know.
Answer: Filesystems are a simple and yet an efficient way to organize and classify files (this is their very primary reason for existence).  Hardlinks allow a higher degree of flexibility in this matter.
As mentioned, there is no concept of original and copies when dealing with hardlinks, all directory entries (hardlinks) are simply references to the existence of the file (point to its inode) with no precedence, hence there are also no broken hardlinks...
So here there are some of the use cases that hardlinks attend but softlinks don't:

Imagine you have a collection of movies or music or other media and want to have different classification criteria applied, like songs classified by artist in a branch (each artist has its own sub-directory); by genre in another branch (each in a different sub-directory), etc..  Still you don't want to duplicate the files nor to decide where to put the "original" so that you have the freedom to reclassify without having to "manage" and re-link files when moving in order to avoid broken links.
Another reason is to avoid the waste of storage space that would be required for having multiple copies of the same file and yet allow the chroot syscall to benefit from a subset of files in the "master" filesystem root (symbolic links could never reference files from outside the chroot sandbox, even if they have relative paths).
Another very important but rarely mentioned reason for hardlinks to exist are the .. subdirectories.  The .. directories actually are (in most unix fs implementations) hardlinks to the parent directory, without hardlinks this has to be implemented in a completely different way, while the existence of hardlinks makes this very easy to be implemented.
Comment: For point 1, using uuids as the 'canonical' name for files, and making all the human-readable names symbolic links to the uuids, is an alternate solution.
Comment: Although the suggestion of uuids sound academically correct, using uuids for filenames doesn't sound very practical, and again, the objective is to simplify things, not make them more difficult or "less human understandable".  Besides, having uudis for the "canonical" file reference would just be an additional indirection to the actual file inode, so, there is no point to be accomplished in this approach as it offers no advantage, just disadvantages like: impact on performance, additional disk space to store more directory entries, having a bunch of files with "weird" names around...
Answer: Very common, real-world example that needs hardlinks:
git clone --reference <repository>

This clones from an local Git repo with nearly zero copying. Instead of copying the object files (immutable files used by Git for its "database"), it simply hardlinks them.
Any repo can remove an object, but the inode stays valid for the rest of the repos. And if an object is removed from all repos, it's deleted from disk. Hard links make for a beautifully robust and fast solution. Very common in CI servers.

There is a non-hard-link version: git clone --shared <repository>. This, however, is fickle and has many more caveats since everyone is working on the same directory.
Answer: I had recently a use case for a somewhat safe update procedure for U-Boot based systems where uImage is a soft-link pointing to the image to boot, the idea was that a power outage should pose no problems, no matter at which point in the process it happens (assuming the file system plays along):

ln image.bin backup_image.bin
ln -sf backup_image.bin uImage

// replace image.bin

ln -sf image.bin uImage
rm backup_image.bin

Without hardlinks it wouldn't be that simple.
/edit:
Thanks to the comments I now know that it would be better to do:
ln image.bin backup_image.bin
ln -sf backup_image.bin uImageNew
mv uImageNew uImage || rm -rf uImage && mv uImageNew uImage

// replace image.bin

ln -sf image.bin uImageNew
mv uImageNew uImage || rm -rf uImage && mv uImageNew uImage
rm backup_image.bin

(The rm is here in order to be able to better escape a strange state, e.g. if uImage is something unexpected which would make mv fail [but not necessarily the previous ln -sf solution].)
Comment: +1 because this is conceptually a very nice reason, but unfortunately `ln -sf` is not atomic. It deletes the old symlink and makes a new one. To fix this you need to make a new symlink with a temporary name and `rename(2)` (`mv`) it to name of the one you want to replace.
Comment: BTW, see here for my version of `install.sh` that solves the problem: https://git.musl-libc.org/cgit/musl/tree/tools/install.sh
Comment: @R.. You're right!  `stat("uImage", {st_mode=S_IFREG|0777, st_size=0, ...})` `unlink("uImage")`, `symlink("backup_image.bin", "uImage")`
Comment: @R.. Note that `mv` even with `-f` might fail if the destination already exists as e.g. an symlink that is part of a symlink loop. Demo: `ln -sf foo bar; ln -sf bar foo; echo "Before:"; ls -l foo bar; >testfile; mv testfile foo || { echo "Using mv -f"; mv -f testfile foo; }; echo "After:"; ls -l foo bar`
Answer: BackupPC is a backup system that uses hard links on the servers to provide file-level deduplication.
Files are first stored in a "pool" directory tree based on their md5 hash.    Any backup that makes use of that file makes a hard link to the pool file.  As backups expire/are deleted, their hard links are removed from the filesystem.
Hard links are superior to soft links here because they provide automatic reference counting.  A cron job periodically deletes any files in the pool directory that don't have more than one link.
This method has some disadvantages (principally, that it is difficult to use filesystem-based tools to replicate the backup store), but it's proven to be quite robust in practice.

Another use case:  the tomcat java web application server treats file names as metadata.  A java "war" file must be named based on its path on the web server.
e.g.: foo.war  is the java code that serves the url /foo
Unfortunately, it resolves symlinks before making this decision.
So, say you want to deploy an application build, and give it a descriptive file name (e.g., with a release number or date).  You can't make a symlink to the file with the "real" name - you have to make a hardlink.
foo.war symlinked to foo-20170129.war doesn't work
foo.war hardlinked to foo-20170129.war works.
i don't like this tomcat behavior, but hardlinks give me a way around it.
Answer: One use that I have had for hard links is when downloading or uncompressing a broken file. The program that does the downloading or uncompressing (such as unzip or unrar) will often automatically remove the incomplete file when it encounters an error, and there is usually no option to keep it. If I want to keep the file, I can make a hard link to it.

Use cases for hardlinks?


How could siblings rivalry / jealousy be useful to human evolution?

Question: It looks like a useless burden and a waste of energy, why it evolved?
Answer: First, it must be understood that not all traits in an animal are evolved or selected traits – some are only variations. Some of these variations may be selected by some evolutionary pressure in the future and then become evolved or selected traits.
For example, each of the various hair colors (black, brown, blond, red, white, etc.) is not an evolved or selected trait – all of them are only variations in hair colors. For now, there is no evolutionary pressure to select any of them, so present-day people have various hair colors. But suppose there is a strange disease that gradually kills off people who do not have blond hair; then the blond hair will be selected by this evolutionary pressure. And after some time, there will be only people (or the majority of people) with blond hair. At this stage, the blond hair will become a selected trait. These also happened to the variation of the finch's beaks in Galapagos, some of which were selected by evolutionary pressure in some specific ecological niches. This pressure led to speciation that resulted in various kinds of finches that Darwin found in various niches. So were true for variations in appendages, which at first were in in-complete forms but later were selected by evolutionary pressure in various ecological niches and evolved into arms, wings, and fins.
How do we know that a trait is an evolved/selected trait or a variation of a trait? One important characteristic is that, if it's an evolved/selected trait, it will appear in all or in the majority of that species. So, for example, the human hand, the bird wing, and the fish gill appear in all humans, birds, and fish – these are evolved/selected traits.
Yet, not all traits that are present in all/the majority of a species always are evolved/selected traits. Some may be just vestigial traits or just results of genetic drifts (see Evolution's Useless Traits). But these are exceptions rather than the general rules.
The general rules of evolution are variations in traits, competition, differential production/survival among different traits, and heritability of (some) traits (Natural selection, Natural Selection – Wikipedia).
For the case in question, siblings jealousy/rivalry that is strong or destructive does not seem to be an evolved/selected trait because it does not occur in all humans and not in the majority of human families. It's probably just a variation trait in some families. And minor jealousy/rivalry is not an evolved/selected trait either. It is probably just one emotion of several emotions that the versatile amygdala (and other emotion-creating neural centers) can produce (to flag various kinds of stimuli that an animal encounters). The amygdala is the evolved/selected trait; any of the various emotions (including sibling jealousy/rivalry) that it can produce is not.


PDB codes for misfolded proteins?

Question: I'm searching for PDB code examples for "healthy proteins" and misfolded ones, so I can compare the 3D structure.
I'd prefer pairs of a "protein misfolding disease", but could be any. Can I find such a list or how should I search for the particular codes?
I'm particularly interested in ones that also cointain SS-bonds.
Comment: Do you mean disulphide bonds between cysteine residues ? These are really rare unless it is chemical modifcation
Comment: I'm not sure they are rare, when opening random PDB files, I often come accross disulphide bonds...
Comment: Hi @JakeB there is a misunderstanding. Disulphide bonds are incredibly well conserved, even in RNA viruses. Misfolding resulting from a disulphinde bond is rare.
Answer: Searching "misfolded" on the RCSB PDB turns up 64 hits. Most of these won't be relevant, but there are some interesting entries on tumor associated EGFR and misolded RNA.
In order to experimentally obtain a structure of a protein it generally has to be in a stable conformation, i.e. at low energy. Being soluble also helps. This usually corresponds to the "healthy" form, as misfolding would lead to aggregation.
That said, the structures of certain aggregates have been obtained. For example, see this recent article.
There is also the concept of mutating a protein sequence to fold to a different structure, see for instance here, though I guess you are looking for cases with the exact same sequence.
Answer: There are very few real structures of soluble misfolded proteins, for the reasons described by jgreener. An example with a disulfide bond is beta-2-microglobulin, eg PDB entries 2XKS vs 2XKU.
Atomic-resolution structures of amyloid fibrils may be what you're looking for, such as 6GK3 for beta-2-microglobulin amyloid (which has its disulfide intact). A search for "amyloid fibril" at rcsb.org will find many structures. But many amyloid precursor proteins are intrinsically disordered, or are fragments of native proteins.
There's no list that I know of, but here's a recent review: https://www.ncbi.nlm.nih.gov/pubmed/30237470
Answer: PDB 5E83 sickle cell anaemia.
All details for comparison to wildtype rbc are found in,
Oksenberg, D., Dufu, K., Patel, M.P., Chuang, C., Li, Z., Xu, Q., Silva-Garcia, A., Zhou, C., Hutchaleelaha, A., Patskovska, L., Patskovsky, Y., Almo, S.C., Sinha, U., Metcalf, B.W., Archer, D.R.
GBT440 increases haemoglobin oxygen affinity, reduces sickling and prolongs RBC half-life in a murine model of sickle cell disease.
(2016) Br.J.Haematol. 175: 141-153

PDB codes for misfolded proteins?


Working as Equity Research Analyst

Question: I have a offer from a research firm in which the job is to give investment advice on a particular stock in the capital market. My duty is to study the company and analyse it thereby coming to conclusion whether to buy or sell the stock. I know studying and analysis company's engaging in haram activities are not allowed in Islam but is it ok if I limit to giving advice on companies that have halal dealings?
Answer: Yes. It's halal as you are facilitating the trading of Halal products i.e. shares in halal companies.
Answer:
Those who consume interest cannot stand [on the Day of Resurrection] except as one stands who is being beaten by Satan into insanity. That is because they say, "Trade is [just] like interest." But Allah has permitted trade and has forbidden interest. So whoever has received an admonition from his Lord and desists may have what is past, and his affair rests with Allah . But whoever returns to [dealing in interest or usury] - those are the companions of the Fire; they will abide eternally therein. (Qur'an 2:275)

If you are indulged only in halal dealings with them, then your case is analogous to trading, irrespective of whether the opposite is a believer or not.
So, you can and it is permissible.
But,

Prophet Muhammad (peace be upon him) said "If you see something wrong try to correct it with your own hands, if you are not able try to correct it by talking to the person that did that wrong, if not try by your heart and this is the least of faith."

So, try to implement the aspects of the above hadith as much as possible.
May the creator guide us all.

Working as Equity Research Analyst


How does rest work?

Question: As seen here, different rests mean different bonuses. But how do I rest? In-game, I guess I need a bed or something like that? And In Real Life, do I have to wait some time here? Or I just wait the fictional game-time?
Comment: A related question: http://rpg.stackexchange.com/questions/21461/how-does-time-work-in-3-5-pathfinder
Answer: The exact rules of resting are left vague, as it says in the link you included. The exact method of resting is generally up to the dungeon master, but in general you can expect that to rest you need only be able to spend the full length of time, 8 hours for example, sleeping in a location where you will not be interrupted. It is not stated anywhere that you need a bed, or something similar, but the DM may say otherwise.
As for having to wait in real life, no you do not have to wait. Generally the DM will just say that you have rested and do a time skip, or say that you have been interrupted by a wandering monster which would require an encounter, for example, and then continue play.
Comment: I'd also argue a character sleeping in the wild will suffer effects of Fatigue if sleeping on hard ground without a bedroll or blanket. Sleeping outside during cold weather without a camp fire could be grounds for suffering Fatigue as well. More unclear are the benefits of eating a hot meal & taking a hot bath in an inn, vs. living in your clothes for weeks, eating cold trail rations?
Comment: Those conditions are not explicitly stated in the rules, and are thus up to the DM. There are actually some rules on the effects of weather http://www.d20srd.org/indexes/wildernessWeatherEnvironment.htm

How does rest work?


How do I run a Java program in a single node cluster in hadoop? Do I need to convert my java code into a JAR file and then execute?

Question: I want to run my custom java code/program on a single node hadoop cluster.
How do I run a Java program in a single node cluster in hadoop? Do I need to convert my Java code into a JAR file and then execute?
Comment: You must at least compile the java files. Pure java files "run" only in IDEs (because they are compiled first in the background for you). If you deploy all needed classfiles or a jar which contains these classfiles is up to you.
Answer: Yes, you need to convert into .Jar file. I will explain you step by step
1)Write your java code in Eclipse IDE.
2)To create jar of your project, follow this link
3)Copy your dataset to HDFS using following command
<code>$ bin/hadoop dfs -copyFromLocal /path/to/file/on/filesystem /path/to/input/on/hdfs
</code>
4)Run your jar by giving path of a dataset which is stored in HDFS, you can follow command
<code>$ bin/hadoop jar path/to/jar/on/filesystem /path/to/input/on/hdfs /path/to/outputdir/on/hdfs
</code>
5)The following command is used to verify the resultant files in the output folder.
<code>$ bin/hadoop fs -ls /path/to/outputdir/on/hdfs
</code>
6)The following command is used to see the output in Part-00000 file. This file is generated by HDFS.
<code>$ bin/hadoop fs -cat path/to/output_dir/part-00000
</code>
Hope this helps you.


BizSpark worth it?

Question: http://blogs.msdn.com/somasegar/archive/2009/06/19/microsoft-bizspark-serving-15-000-startups-and-counting.aspx
Any recommendations on this topic ?
Answer: I heard about this a while back and thought that the "Network Partner" requirement was a little weird.  Now, you don't have to do that.  You can make your request directly to Microsoft without a network partner.
I think the network partner idea is good but it's poorly implemented.  They do nothing to help introduce startups to partners that are willing to help.
I went ahead and signed up for the service a few weeks ago.  You basically get a full MSDN subscription for free.  That means you can get legitimate versions of Visual Studio, Expression, even operating systems for free.
I find it very helpful to have access to various Windows operating systems so I can test my software (I run a software startup, not a web startup) on various platforms.
After 3 years you just pay $100.
I would say, yes, it's worth it.
Answer: I know several people enrolled in this program. As long as you meet the requirements it seems like a good deal.
1. The startup must be less than three years old,
2. The startup company's revenue must be less than $1 million,
3. If the startup goes public, you are out of the program.
You do have to pay a $100 program fee but that is not due until you exit the program.
Answer: My personal experience and comment on this for startups is that microsoft are incredibly unhelpful, terminally slow in responding and answering emails and applications, there is no way to speak to a real person... no phone numbers, no address, no contact names... They specify simple criteria on the web site, but when you apply they say you are not eligible... and don't give a reason, if you then push and say why? the response you get is obvious that they have not even looked at your website let alone your business and what you are trying to do. So, as a result, I feel that they are offering the service for purely for good PR, but are actually in no way actually wanting to help startups, I have been 6 weeks emailing every few days, they have an auto responded which says they will answer in 2 business days and its been 6 weeks.... So I am getting nowhere... I don't think microsoft really want to help startups at all . Very disappointed and annoyed with them. I can't see how this approach to interacting with startups will work for them? My recommendation would be to pick somebody else and avoid Microsoft.
Comment: They did eventually respond and I have eventually got onto the program. however it is very, very slow and incredibly painful process to get on.. maybe this is by design... however you look at it not good for startups.
Answer: So I just went through the process of signing up and I have to say that if you are start-up building in the .Net stack then BizSpark is a no brainer. I especially love the free Azure credit and the exemption that you can use the benefit for production purposes whereas normal MSDN users can only use it for dev/testing purposes. This shows that Microsoft gets it and at this stage of the game it really helps our little initiative.
Throw into the mix Visual Studio online that allows up to 5 devs free and suddenly its really amazing to build something using MS tech if you are a small start-up.
Regarding the slowness, I initially had the same problem after signing up with my support emails being ignored and all that. After a few weeks on a whim I sent a hail mary to my country's BizSpark contact detail instead of the .com one and that made all the difference. I got an amazing response from the local team being phoned within a few hours of dropping the mail. By the end of the day my application was approved.
My only suggestion to Microsoft would be to throw in an Office365 benefit to host your start-up Emails since then you quite literally can start a 1-5 man company with zero infrastructure and tool overhead and obviously MS wins in the medium to long run since products get developed in their stack.
+1 Microsoft.

BizSpark worth it?


Kenward-Roger and REML

Question: I am doing some mixed model analyses using the lmer function in R's lme4 package. I am using the lmerTest package to obtain p-values for fixed effects with the Kenward-Roger method of estimating denominator degrees of freedom. My understanding is that to test fixed effects in a mixed model, maximum likelihood should be used instead of REML. However, when using the Kenward-Roger method in lmerTest, REML is required. Why is this the case, and is this appropriate, given that REML is not typically recommended for testing fixed effects in mixed models?
Comment: So? You can't do likelihood ratio tests, but you can still do Wald tests on fixed effects.
Comment: Welcome to the site @Peat. Why do you say that fixed effects can only be tested with maximum likelihood? That's a very strange claim. Please provide references; "I overheard at the watercooler" is not one. Also, please go back to edit your post and format the R packages and function names; see the help bar on the right for the specific ways to do that with reverse single quotes.
Comment: @StasK: REML gives less biased estimates for the variance, it does so by ''eliminating'' (the coefficients of) the fixed effects from the likelihood function. Therefore the restricted likelihood of models with different fixed effects may not be compared. This can be found in Applied Longitudinal data analysis by Fitzmaurice, Laird and Ware (on page 103-104 of the second edition). See also http://stats.stackexchange.com/questions/99895/why-does-one-have-to-use-reml-in-stead-of-ml-for-choosing-among-nested-var-cov/171529#171529
Comment: @StasK, I think you should post an expanded version of your comment/explanation as an answer ...
Answer:
REML is not typically recommended for testing fixed effects in mixed models

There's an important distinction here.

testing fixed effects by comparing models fitted with different fixed effects is nonsensical when using REML. In R, this would correspond to using anova()
doing Wald tests of fixed effects (i.e., looking at the estimated curvature of the likelihood surface and computing standard errors of the parameters) is fine. In R, this would correspond to using summary().
Answer: Note that the Kenward-Roger method bases on REML but introduces a modification on the estimated covariance matrix for small samples. See their original work in Biometrics (1997): "Small sample inference for fixed effects from REML". So it would not make sense to implement their method with something else than REML.

Kenward-Roger and REML


How to control rise time of output of LTSpice's Voltage Controlled Switch?

Question: I have a RC delay circuit as input into a Voltage Controlled Switch in LTSpice.  It's working the way I want, except I can't figure out how to shorten the rise time of the signal that emerges from the switch once it's triggered on.  This is the "swout" signal in the below schema and it's also shown graphically.  The 10-90% rise time for it is measured as 1.1 microseconds.  Is there a way to get it much lower, on the order of a few nanoseconds?
Answer: What you are experiencing is not the rise time of the "real circuit", but the limitations of the simulation engine.
The rise time of the swout output is theoretically zero, since the switch is ideal and there is no reactive element on the output line that can introduce a delay. What you measure depends on the time resolution (the time step) of the simulation algorithm. If you put a maximum limit to the time step that is much smaller than 1ns, e.g. 100ps, you'll see a shorter rise time.
Change, for example, the simulation directive to:
.tran 0 150u 0 100p startup uic

to see what I mean.
In other words, trying to measure the rise time in that circuit is pointless and nonsensical because the modeled circuit is "too ideal" to show a non-zero rise time at its output.
If you want meaningful results in that respect, you should model the real circuit more accurately. For example, add a non-zero series resistance for the switch (around 10 milliohm for a real mechanical switch) and add at least a capacitor in parallel to R2 to model the parasitic capacitance that the switch is going to drive in the real world. Then you'll see a "real" rise time.
Comment: This is a quality answer, thank you.  I was aware I was missing the parasitics and that is why I was surprised, being an ideal switch, the rise time was in the microsecond range.  But your explanation regarding the limitations of the simulation software and needing the shorter time step answers that question.  I added the 100p time step and indeed saw the rise time dramatically fall.  Now that I see how it's working, I can concentrate on adding accurate parasitics.  Thanks.
Answer: The switching behaviour of the switch (actually, its transitions from fully opened to fully closed) can be controlled to give the appearance of a rise/fall time, at least in LTspice.
If you look in the manual, at the switch, you'll see there are options for setting a hysteresis, alongside a warning that positive hysteresis should never be used., while the negative hysteresis makes the transitions follow the logarithm of the control voltage. These said, seeing your schematic, it uses a pulse through an RC lowpass (which, by the way, can be specified inside the source, with Rser and Cpar), so there is room for plenty of rise/fall time.
Your switch model card also only specifies the threshold voltage, Vt, no hysteresis, Vh (it defaults to zero), so if you add this: Vt=2.5 Vh=-2.5 to your model card, you'll get your very smooth rise time, you may even have to reduce the RC time constant in the commanding source.
If you read further down in the manual, you'll see there is a level=2 switch, which makes the transitions even smoother, following a tanh() curve, at the cost of never fully reaching the final values.
Your choices, I'd recommend the default level=1 (which doesn't need to be specified) with negative hysteresis. BTW, you don't have to specify Vh to be for the full input range, it can also be Vh=2.5 Vt=-1, for example, or Vt=-1m, with the obvious effect of reducing the rise/fall times of the switch. Don't forget about Ron and Roff, either, but try not to make them with too many orders of magnitude different, like Ron=1p Roff=1T, because that could be problematic for the solver. mOhms and GOhms can work just fine, for example.
Comment: It's great that you also mentioned the use of the `level=2`directive.


How to get eth network hash rate from Etherscan API?

Question: I have looked through all of the docs (https://etherscan.io/apis) and couldn't find how to get this from their APIs, yet they display this number in multiple places on their site. Was hoping for some guidance.
Comment: Hi,

Etherscan shows entire data graphically till date, the hashrate of the network is shown here: https://etherscan.io/chart/hashrate and keep your mouse on the chart for daily reading.

Thanks
Comment: Thanks for your response. I need an API my server can call to on an interval. Manually doesn't work for my use case.
Answer: You can use the following EtherChain API:
https://etherchain.org/api/basic_stats

Under the stats section:
   ...
   "stats": {
        "blockTime": 15.4004,
        "difficulty": 1458229412239493.5,
        "hashRate": 109976005162231.83,
        "uncle_rate": 0.3029
    }
}

Comment: API still works but documentation is down (can't find it in case URL just changed)
Answer: The network hash rate is likely calculated.  There does not appear to be an API for retrieving the network hash rate.  Hovering over the network hash rate value on the home page says that it is averaged over the last 5000 blocks.  The formula for computing the network hash rate is:
Difficulty / Avg Block Time = Hash Rate
You could estimate the Avg Block Time by using that value from your own output and see how that compares to the numbers on Etherscan.
Etherscan also provides links to CSV files for their charts at the bottom of each chart page.  You could download the CSV data for the Difficulty Chart and the Average Block Time Chart and do the computation yourself or directly download the Hash Rate Growth Chart Data directly.  It looks like it gets updated every 5 mins.
Answer: There is a not so straightforward way of getting the current difficulty from Etherscan. We will be using the GETH Parity Proxy.
Firstly, we will use the eth_blockNumber call to get the current block number. This value is given under the result property.
Next, we use the eth_getBlockByNumber to get the information regarding the current block. We will be passing in the block number from the previous step. In the response object, result.difficulty will be a hex string representing the difficulty associated with that block. Simply convert this to a decimal and we're done.


How can I generate unique random patterns (similar to the ones in Nutella jars)?

Question: How can I generate unique patterns, as they did for these Nutella jars? See, for example, the video Algorithm designs seven million different jars of Nutella.
Comment: You are probably looking at something like randomly generated constructive grammars. Not sure if that is considered an AI technique. Nowadays you might also choose to use a GAN (which is definitely considered a modern AI technique), but to do so with abstract shapes and patterns like in the picture you would proabably generate a training set using some randomly generated constructive grammars . . .
Answer: Some excerpts from     Nutella 'Hired' an Algorithm to Design New Jars. And It Was a Sell-Out Success:
The "algorithm" is called HP Mosaic and is included free in HP SmartStream Designer for HP printers.
More about how the algorithm works here: https://www.linkedin.com/pulse/hp-mosaic-20-steven-chow
HP Mosaic takes the vector PDF file as input (also known as a Seed file), and generates a large number of variations on the file by transforming it — scaling, transposition, and rotation — randomly.


Cheapest train travel from Innsbruck to Munich via Mittenwald

Question: We intend to travel from Innsbruck (Austria) to Munich (Germany) via Mittenwald which is reputed as a scenic train route between the two countries. Please advise the cheapest way to do this.
Comment: Unquestionably the Bavarian hiking trails would be the cheapest and most scenic. At least through Mittenwald and up to the outskirts of Munich.  "Faleri, falera, faleri..."
Answer: surely ride from Innsbruck to Munich via Mittenwald train is more scenic rather than straight train from Innsbruck to Munich. i have used this route couple of times and found cheaper. First train ticket from db train website  Innsbruck to garnish Partenkirchen would cost around 12 to 14 euros. Second journey from garmisch to munich through bus from flixbus website and ticket would cost somewhere between 5 to 8 euros , also if booked in advance bus ticket might be lot cheaper.
Comment: please be informed that you will be crossing Mittenwald through train from Innsbruck to garmish Partenkirchen
Answer: On the German side, i.e. from Mittenwald northwards, the cheapest ticket is the Regio-Ticket Werdenfels, hands down. It is €19 for a single person and an additional €4 for every further traveller. It is now valid for an entire day for unlimited travel in DB's Werdenfels network and the Munich S-trains. All the lines are highlighted on this map. Note that you must use regional trains (RE and RB; the red ones) and cannot use ICE trains. But that is okay, since regional trains go every hour and there are only a few ICE trains on weekends last time I checked (and the Innsbruck–Mittenwald leg seems to have been discontinued).
On the Austrian side, I am not aware of any special offer tickets. The single fare is €10.60 for a flexible ticket or €10.20 if you choose your train in advance.
The route is most definitely scenic; you can check out a few pictures on this site.


Android for Work or Custom Rom?

Question: We are attempting to present our progressive web application inside android for our end users who are seniors and would like to have special requirements met that I am not sure which approach we should move forward with. Help from the community would be much appreciated!
We have developed a web application that we would like to run on top of in a sort of advanced kiosk mode on an android OS in a tablet device. Additionally we need to offer our users an interface to modify their wifi settings. These are our rough requirements and wonder if we can reach them using Android for Work or if the community has recommended solutions such as if a custom ROM is necessary:

boot into kiosk mode
initial boot screen is branded or customizable
remove the android header bar
expose via our interface connectivity settings like wifi, bluetooth, and cellular data
access to the device camera
access to power off function
access battery levels

My research into current EMM provider solutions on the market shows that these solutions can really do a lot with the Android OS with the Device Owner permission. We are testing one option now. I'm just not sure if this would be the right approach. Your help is appreciated.
Answer: You could try the Android Management API, it allows to manage a device the same way an EMM provider would do.

Android for Work or Custom Rom?


Does  Drupal have an AJAX solution for search results, preferably with Apachesolr integration?

Question: Specifically, I'm referring to being able to have the top 5 search results display as options in a drop down menu while the user types in a search query, somewhat similar to how node reference autocomplete works. It would be great to have such functionality work with Apachesolr.
Comment: What you describe is not live-search, but automcompleting search suggestions.
Comment: Autocomplete Search Suggestions is already an existing solution, which I described as being what Apachesolr_autocomplete provides.
I'm looking for something that provides the top 5 search results for the current search phrase in an Ajax drop down menu.
Answer: Depending on your needs, there are a couple of solutions.  Probably the closest thing to Apple's Live Search feature is the Finder module.  It does not integrate with Apache Solr at this time, however.
I would also keep your eye on the Inline Ajax Search module as Solr integration is on the roadmap.  It might need some contributions to push integration through.
A third solution to try is the Apache Solr AJAX module.  It might not fit exactly what you are trying to do, however it allows for inline refreshing of the page when queries are entered and filters are enabled.
Answer: Acquia offers a solution built on Solr. http://network.acquia.com/services/acquia-search
Comment: Hmmm this looks cool, but, the project I'm working on is heavily reliant on Pressflow, so I'm guessing anything acquia built is not going to be compatible?
Comment: Pressflow is just a distribution of Drupal (a profile), which means it's just adding on modules, themes, content types and views in a bundle. The base is still Drupal. Solr should still work fine.
Comment: Oh ok I'll give it a try thanks. I thought that Acquia provided some base modules that required registering and paying, and assumed they might be Acquia locked. I guess I should be more adventurous :)
Comment: I work for Acquia, and I want to reiterate that Acquia doesn't build modules with secret functionality that you have to pay for.  The value of Acquia Search is a fully managed, enterprise-grade, scalable Solr instance, but there isn't any additional functionality beyond what the Apache Solr Search Integration module provides.  In addition, any module that works with Apache Solr Search Integration will work with Acquia Search.
Answer: I would suggest installing the module http://drupal.org/project/apachesolr_autocomplete, this out of the box will let you see Solr's keyword suggestions.
The next issue is showing nodes in the search results and not search terms, there is a hook called apachesolr_modify_query($query,'apachesolr_autocomplete'); which will allow you to write a custom module to intercept the query as it goes to Solr and tell it to search for nodes and not search suggestions.
The remaining problem you have is simply down to theming the search results so that they look like the regular search.
There already are two theming functions avaliable:

theme_apachesolr_autocomplete_highlight
theme_apachesolr_autocomplete_spellcheck

Hope this helps.
At the end of the day you could write the entire module yourself without starting with the base module apachesolr_autocomplete, but I feel it takes a lot of the heavy lifting off you and would be an advantage.


Is there any difference between "unproductive" and "nonproductive"?

Question: If you can find any difference between "unproductive" and "nonproductive," could you explain that with some illustrative sentences?
Comment: @Martha: I did have that nagging feeling... perhaps 'unproductive' not only means not producing, but actually destroying, where 'nonproductive' means not doing either?
Comment: AFIAK, No, there is no difference.
Comment: @John, there *is* a very slight difference in connotation/usage, but I'll be damned if I can articulate it.
Answer: There is a difference. Unproductive suggests something that could be useful produces nothing of value. Nonproductive suggests that same something produces nothing useful at all.
Answer: Being unproductive implies that something could have been productive but no action was taken. Nonproductive implies that something was unsuccessfully trying to be productive.

John was unproductive and sat around all day watching movies.
John spent three nonproductive hours trying to write a novel.
Comment: I believe this answer is more accurate and articulated than mine. Use this one.
Comment: Thank you very much, MrHen and HaL. Your answers are very useful:)
Answer: Nonproductive=achieving little
Unproductive is when something could be produced but despite the reason (ie: lack of effort, mistakes, laziness) nothing has been produced
Answer: I feel Non productive means something which is capable of being productive happens to be not productive, temporarily or otherwise.Or something like an asset which was earlier productive has now turned out to be non productive. On the other hand unproductive means something which is not capable of being productive.
Answer: Non-productive: something which could be useful but employed in something which turned out to be of no use
e.g.: politicians spending on distribution of gifts to voters. it doesnt help in country's development in any way
Unproductive:
something which doesn't prove to be productive but is needed in order to avoid losses.
e.g.: expenses incurred on maintenance
Answer: Generally, "non-" means "not" while "un" means "the opposite of".
"Non-productive" refers to someone or something who isn't producing the thing that they're meant to be producing, such as a cleaner or cleaning machine who is just moving the mess around but without making it worse.
"Unproductive" refers to someone or something who is producing the opposite of what they should be producing, such as a cleaner or cleaning machine making a greater mess than the one they started with.
It's like the difference between producing zero ("non-productive") or negative ("unproductive") units of a thing.
Admittedly, the two are used interchangeably in practice, but that doesn't mean that it's right to do so. You could say that such people are being unproductive with regard to their use of the term "non-productive".


My Boss owes money but I am named on letter from debt collection agency (UK)

Question: My employer has an outstanding debt with a company he aked me to speak with a couple of years ago. Now that company has my name listed as a "contact". He received a letter from a debt collection agency in regard his failure to pay them however, although it was sent to his business adresss, it had my name on it. I am concerned that this may now effect my credit rating so I asked him to phone them and remove my name, but they wouldnt. They said I was only a "contact" but I am still concerned. Any advice would be much appreciated. I am in the UK. Thanks
Comment: I did a soft search and it seems ok...for now....However it is a Limited company, so am I correct in thinking that the companies debt/credit rating will not effect me as an individual. I am not a director just an employee, I just dont like that a debt collection agency has my name though and I am still worried as I am rather ignorant how it all works.  Thanks
Comment: Have you checked your credit report to see if it's on it?
Answer: I would not be overly concerned unless they started contacting you directly on your personal time or it showed up on your credit report.
It is very likely that you are listed simply for their own records. This is correct for them to do, since you spoke to them in the past as an agent of your company. There should not be any legal connection to your personal finances.
If it continues to be a concern, I would question whether I wanted to work for such an employer. I do not know your entire situation, but this kind of misbehavior is a red flag if not addressed.
Answer: You havent signed a contract, so you are only an authorised contact so you have nothing to worry about at all.  Your credit reference can only be affected if you are a signed party on the contract.  I would imagine that they wont remove your details as you may assist them by contacting your emplorer, and effectively chase the debt for them especially if you seem to be family member or a friend of the business owner.
How did you find out about the debt, did they phone you?  If you really want peace of mind, you could write to them and confirm that you are not authorised to be contacted by phone or in writing regarding the debt, and that you are not in anyway liable for the debt and that your contact details must be put beyond use, and as you are concerned, say that if they take any further action against you such as affect your credit ref etc then you will take them to 'your' local magistrates court to seek compensation.  Use strong terms and insist they must do what you ask rather than just say that you would like something done etc.  Say that you 'Will' take further action which is generic, and that you 'May' do specific things so that it sounds strong but you haven't have committed to any thing in particular.  This would most likely be more than enough to stop further contact.


Zero entropy change

Question: If you put a object in contact with a heat reservoir that is infinitesimally higher in temperature than the object and allow equilibrium to be reached the entropy change is zero right?
Answer: When talking about infinitesimals, you need to specify how close to zero it is. The entropy loss is $\delta Q\over T$ and the gain is $\delta Q \over T-\delta T$, so the net gain is $\delta Q \delta T \over T^2$ to leading infinitesimal order, and it vanishes linearly in $\delta T$ and $\delta Q$ both.
For iterated infinitesimal processes that approximate a path in state space, the entropy gain will zero when you compose it from many nearly-reversible paths, so in this sense, the entropy gain is zero.

Zero entropy change


Is there a good reason to have a handheld Aviation Microphone in GA?

Question: I have a Cessna 172P in which the handheld microphone has stopped working. Before I replace, I was wondering if there is any good reason to even have one? I have PTTs on both the pilot and copilot, yoke.
Comment: Have you ever used it? I've only seen an instructor use it once, when the radio jack failed for the mic input.
Comment: Have used it once in the last 20 years when I didn't have my headset with me.
Comment: They are not incredibly expensive, I wouldn't have it high on the priority list, but you can replace it if you want. It is an owner-replaceable part since it just plugs into a jack, you shouldn't need an avionics department (and bill) unless you need to pull your panel apart to get to it.
Comment: I used mine a bunch.  It's nice to have if your ptt breaks.
Answer: According to the 172 Minimum Equipment List from Cessna (S and R models)

these are both Category C items which the MEL states

Category C: Items in this category shall be rectified within ten (10) calendar
  days, excluding the day of discovery.

So it looks like you may need to fix it but in the event you are flying it looks like you need an alternative (headset should do that) and or a backup headset on hand.
However the 4th column states that zero are required for dispatch so you can fly without it.
As people are noting in the comments in a lot of planes these mic's go more or less unused or are inop these days. I know I have never personally used one in any of the archers I have flown.
Comment: That's for a commercial operation.
Comment: Still a category C
Answer: Ask yourself the question; you call tower to respond to an instruction or something, and there is no response, or tower starts calling you because they haven't heard from you even though you thought you'd talked to them, and you need some kind of standby device right now to talk with without having to fumble around.  Be nice to be able to grab a mic that normally just sits there unused.
Maybe you have a spare headset on board, but imagine having to fumble around to get it out and plug it in while your attention is needed elsewhere.
So if you have a spare headset plugged in and ready to go that you can grab without much effort and use, not a big deal, but if that's not the case and you fly in controlled airspace a lot, I would say you should have one.
Comment: I have the number for local ATC saved in my phone for this purpose
Comment: What about "not local" ATC?


Question on search engine optimization for nodejs website

Question: I just made my first website and I had some questions about how google would index it. For this website, content is only generated once the user interacts with a map seen on the website. I read this article that said Google does not index content that requires interaction. Does this mean my website won't be indexed? Do you have any tips on how I can fix this issue? It has a lot of content that can be shown once a user interacts with it but before any interaction, the website's content is pretty empty. I made this website in nodejs and expressjs with the handlebars template.
Answer: It's true that this makes your content not indexable.
The general solution for this is to design a system for deep linking, where someone can share a link to a specific resource on your website (this could even just be a query string), and that resource loads immediately without any user interaction.
For instance, a link like this that opens up your map to a specific piece of content:
http://example.com/map.php?location=1234
Then, the trick is to surface those deep links somewhere so crawlers will stumble upon them. People will naturally surface them by linking in to your site from other sites, but you may want to create something like a "featured locations" page or blog about it to create more deep links for the crawlers.
Another idea: From each location deep link, you could also deep-link nearby locations or related locations, so the crawlers can start to traverse your locations sort of like linked pages.
Some people might suggest just slapping all your deep links into a sitemap and calling it a day, but there are probably issues with that.
Comment: Thanks. I will try this
Comment: By a "featured locations" page, do you mean make that page on my website or make a new website for those featured links?
Comment: @jk23541 Either way! All that matters is that crawlers can find the links.


How to get through a notice period in good health?

Question: I found a new job with nice and talented colleagues. My salary got a huge increase.
I can't wait to start the new job. However, my notice period is of several months and I completely lost any and all motivation. I want to avoid burning bridges, but I have zero ambition left for my current job and I would rather move on today.
I do not look forward going back into that office, and I have no enthusiasm about future plans. I felt uncomfortable before, and even more now that I got another job.
How to get through a lengthy notice period, without burning bridges, in these conditions?
Comment: @JoeStrazzere: I up-voted your comment specifically because it's about 1000% nicer than something I would say to someone if they asked me this  same question in person.
Answer: How about just doing what you agreed on to do (in your contract, in verbal agreements up to now, in written procedures etc), instead of letting it depend on how you feel? They pay your salary during the notice period, don't they?
Would you want your boss to have the same attitude towards you during your notice period, i.e. Well I don't feel like paying him anymore, because he's leaving anyway?
How about asking what you can do in this period to make a smooth transition for everyone?
If you are concerned about get(ting) through a notice period in good health I can tell you that your own attitude will have a lot to do with that.

There is one alternative I can think of, especially if there is not much to actually do in your notice period: you can propose to end your contract earlier.
Comment: @Monoandale Have you asked?
Comment: I would be more than happy for them to STOP paying my salary and letting me go.
Answer: You can do either of these:

Do your best, despite being unmotivated. There will be various times in your life where you'll be unmotivated for prolonged periods of time. If you find that you can't push yourself to work properly despite wanting to, you may need to consult a psychologist - they exist for these kinds of issues. These issues are much more common than most people think.
Take unpaid vacation, or end your contract earlier, after discussion with your current employer. The advantage of this solution is that you can travel around the world, probably for months. There's a risk that you will start the new job and still find yourself unmotivated, in which case you may suffer from a burnout and should seek the help of a psychologist .


Which were the (militarily) strongest countries of the Holy Roman Empire?

Question: The Holy Roman Empire was neither holy, Roman or an empire, but it was still a strong power despite its infighting. What were the strongest countries towards the end of the "empire"?
Comment: @user14394 - I don't believe "Germany" was a country of the Holy Roman Empire.
Comment: It lasted for quite a time, with power constantly shifting. You should specify an historical moment for the answer to be answerable.
Comment: @user14394: Berlin is not a "country". It was the capital of the Kingdom of Prussia though.
Comment: "The Two Headed Eagle": Germany and Austria.
Comment: Berlin sure was....
Comment: The Holy Roman Empire officially ceased to exist in 1806. "Toward the end" Prussia was definitely a major force.
Comment: My vote goes to Prussia
Answer: Austria and Prussia. They were the only major powers during this time which were also part of the Holy Roman Empire. Other countries like bavaria, saxony or Hessia were minor powers.
Here is an "indirect" source: The site shows the major armies of the involved countries of the Napoleonic Wars. Two of them (Austria and Prussia) are part of the Holy Roman Empire (HRE). If there were other strong countries within the HRE they would be listed here, also.
Comment: My issue with listing Prussia here is that they weren't really a country until the 1700's and most of their territory (including the entire Dutchy of Prussia) was outside of the HRE. So for the HRE's 1000 year existence, Prussia really only vaguely deserves this status in the last 100. When you think of the HRE, you usually think of the Middle Ages, and there was no "Prussia" in it in the Middle Ages.
Comment: @T.E.D. while I do agree, I did ask about the end of the empire
Comment: @UncleTres Ah, my bad. I didn't reread the question after you edited it to add that phrase.
Comment: @T.E.D. that's okay
Comment: Its "Hessia"? I thought it was spelled "Hesse".


Check Message If read and unread

Question: i wants update based on id_ .in front end level this id did't get..how to pass this id to conroller..And same thing If i read the inbox message i wants to change inbox font style .
Comment: What is rcp_id_in ? A column?
Answer: read message inbox:
<code>   1. Add new field in inbox message table named `is_read` type `int`.

   2. And write a select query to select is_read and check whether it is 0 or 1.

   3. If 'is_read' = 0 write a CSS style and if 'is_read' = 1 write a different CSS style for the font.

   4. And you can fix your self 0 as unread and 1 as read.

   5. Then write a update query for 'is_read' as 1 , When selecting the inbox message.
</code>

Check Message If read and unread


Ubuntu dpkg error , after crash and filesystem error recovery

Question: Ubuntu recently crashed , causing it's partition damaged ( which is EXT4)
and Ubuntu was unable to boot , because it couldn't mount anything , only displays Busybox
So I used the Live CD to run fsck on the partition, which fixed it , but deleted some nodes
Now Ubuntu is working , but some files were missing ,
for example I lost the Panels configurations and Chromium's Extensions
The Most Annoying problem , that there is some files corrupted ,
for example when I try to install any program, I got this

(Reading database ... 95%dpkg:
  unrecoverable fatal error, aborting:
  files list file for package
  'libservlet2.4-java' is missing final
  newline

I tried these commands
dpkg --configure -a
apt-get -f install

and from GUI , Synaptic Package Manager > Fix Broken Packages
So this file "libservlet2.4-java"
Does anyone knows what it does ! and where it's location ? and how can I fix/get-correct-version-of it ?
Also , is there any way I could tell Ubuntu to Check for ALL it's files , and if there is something corrupted it should recover it form the CD ?

Edit 1
I just found the file @ /usr/share/doc/libservlet2.4-java
it contains the following files

changelog.Debian.gz  copyright
  README.Debian  README.txt

is anything missing here ??

Edit 2
I even can't remove the package ! , I got the same error form dpkg
I even deleted the whole directory (/usr/share/doc/libservlet2.4-java)
but still have the same problem
Answer: That sounds like the binary cache of the package management system might be corrupted; you can try removing /var/cache/apt/pkgcache.bin to fix this (if this file doesn't exist, apt will re-create it automaticly).


Can I jump a 5-foot pit with only Strength 5?

Question: I'm playing as a half-elf sorcerer. Since my character only has 5 strength, can I take a 5-foot jump over 5-foot pit so as to avoid falling? We are playing on a grid.
Comment: Just out of curiosity, how come their strength is so low?
Comment: Yes, we are playing on a grid. Thank you for ur attitude.
Comment: Thanks for the information. Are you playing on a grid? I could add that as context to the question if you like, it might improve the answers you get.
Comment: just a random roll. I decide it goes to str cuz of low age which is 14. So now it becomes a problem since DM insist im not able to jump over 1 square.
Comment: No problem. Hope you enjoy your stay at rpg.stackexchange! Take the [tour], by the way, to learn more about how the site works.
Answer: According to the PHB page 182 you can do a long jump with a running start of 10 feet as far as your strength score, so 5 feet. A 5 feet jump should be just enough to clear a 5 feet pit, though your DM might require a successful acrobatics check.
But it doesn't really matter, the DM can overrule the rules and if you are not supposed to be able to jump over the pit in order to give your party a challenge than you cannot.
Instead of challenging the DM on the rules ask for clarifications of the rules and then play within the rule-set your DM made (Go around? Use rope? A flying spell? Have a strong PC throw you across? ...) or talk about what rule-set you can agree on.
Comment: @UseNoose Playing with changing rules is no fun. Ask your DM. It could have been a mistake before, or now, or the rules are *supposed* to change (because magic tower), or the pit is actually 6 feet wide, you just can't see it on the grid.
Comment: Rule-set was not clear. But we played 2 sessions already and i was able to do this. Now it changes.
Answer: This boils down to two related issues: if a character can jump five feet, can they clear a pit of exactly that width? And how does the grid change it?
Long jumping
The rules of long jumping are found on Player's Handbook page 182:

When you make a long jump, you cover a number of feet up to your Strength score if you move at least 10 feet on foot immediately before the jump. When you make a standing long jump, you can leap only half that distance.

Sadly, this leaves the issue of distance covered open: there are no ability checks mentioned (but we'll get back to it!), it's essentially either a guaranteed success or a guaranteed failure, but the rules aren't clear which one it should be. I would personally rule in favor of the player, that covering five feet means being able to land safely over a pit exactly five feet wide, but no further. This interpretation is also reasonably consistent with the distance metric used in the sport of long jump.
However, when we take a look at page 175, things get more interesting. A possible use for Athletics check is listed as:

You try to jump an unusually long distance or pull off a stunt midjump.

Therefore, the Strength score should not be interpreted as a hard cap on jump distance, but rather what your character can achieve reliably, 100% of the time. Further than that is possible with a successful Strength (Athletics) check, but it is up to your GM to set the difficulty of this roll. If your GM insists that your character cannot clear a 5-foot pit reliably, you can at least argue that it requires only a slightly better than normal jump (Easy DC) for you to exceed the five feet and cross the pit.
What about the grid?
Strictly speaking, to clear a 5-foot pit that covers an entire grid tile, you would need to be able to jump at least 10 feet.

Rather than moving foot by foot, move square by square on the grid. This means you use your speed in 5-foot segments.

So if you are 2.5 feet away from the pit, you couldn't walk 2.5 feet first, then jump 5 feet, and then move another 2.5 feet. However, if the same pit was shifted so it covered two adjacent halves of two squares, it would be possible as a part of the normal movement. It's fair to say the rules don't make sense in these two instances, so try negotiating for at least an easy Athletics check here with your GM.
Comment: only if everyone is playing gelatinous cubes.
Comment: @Mindwin I'm not making any sense of what you're saying, sorry. All I'm saying is what the rules say to the letter, because it explains a possible reason why OP's GM has forbade the jump.
Comment: Do you have a citation that the *jump* has to occur in 5 foot segments?  Ie, you may have to spend 5*X feet, and *during* that movement make a 1', 5', 7' or 13' jump.
Comment: @Yakk The rules instruct to convert speeds and distances to squares, which seems to me like the rules as intended is no sub-square movement at all. And what would be the sense of using a grid with such anyway?
Comment: @kviiri There is no sub square movement; just sub square sizes.  Like how you can have a one foot thick wall.


How do academics with teaching responsibilities, etc. find the time to do research?

Question: How do academics manage to do research when they are lecturing and running courses, helping students, writing up assignments and tests, marking assignments and tests, supervising graduate students, going to meetings, doing admin, having personal lives, etc. ?
Comment: Grad students.  Who do you think does most of the actual work of research?  And in some universities, if you bring in sufficient grant money, you can buy yourself out of at least part of your teaching load.
Comment: This question should better ask as "**how much time** do academics have to do non-researching responsibilities?"
Comment: I disagree with the previous comment: the question asks how to manage things, not for information about loads
Comment: I'm unsure if this question should have been changed from its original focus on mathematicians to its current generic form. Thoughts welcome at https://academia.meta.stackexchange.com/questions/3726/should-this-question-have-been-kept-discipline-specific
Comment: Who has time? Who has time? But then if we never take time, how can we ever have time? https://youtu.be/hA6ygR4o8s4
Comment: @Yemon Cho: OK, math is probably different.  My experience is with CS & physical sciences, where the professor in charge of a given lab/project might spend a couple of hours a week discussing the research progress & direction.
Comment: Comments are not for extended discussion; this conversation has been [moved to chat](http://chat.stackexchange.com/rooms/58647/discussion-on-question-by-samuel-how-do-academics-with-teaching-responsibilities). Please note that comments can only be migrated once; further off-topic comments may be deleted.
Comment: @jamesqf In answer to your first rhetorical question, this is usually not true in e.g. (pure) mathematics
Answer: How does anyone "find the time" to do anything? The answer is that mathematicians don't "find the time", the time is already there and they make use of it. Your premise that those other activities you mentioned already fill up 100% of the time is simply incorrect. In particular, summers, breaks and other periods with no teaching offer a convenient and relatively distraction-free environment for doing research. But even teaching is not mutually exclusive with doing some research.
Comment: Dan Romik, This answer only provides half of the solution. The other half, according to Richard Feynman, is to negotiate a reduced workload of the work that is not related to research. And even then, this is something that Richard Feynman struggled quite a bit with. http://www.sciencemag.org/careers/2001/04/transition-academia-negotiating-your-way-teaching-sanity
Answer: I am sure you, me and many others are doing research when they eat,before they sleep,when they are watching a football game.
I think you do not "find time". You use the time you have.
The important thing is that you do not have to do research for three hours a day.
I usually say to myself "Ok today you have time to think about problem X for 30 minutes. Use 20 minutes of them.Others will not". And indeed,sometimes in these 20 minutes an idea may come.
(P.S.)When you teach you become better at mathematics.
(P.S. 2) I miss those times when I was undergraduate and I could spent 5 hours for research every day.
Comment: Or you *create* time.
Comment: @Wildcard Physicists tell me that if you travel very, very fast, then time slows down.
Comment: @FedericoPoloni that's useless for you, since upon return you'll discover you actually wasted more time than if you remained stationary.
Answer: Really it depends on how you put your priorities. The list you have made is a perfect summary of legitimate excuses one can make to abstain from thinking of mathematical problems when you are in no mood for them. In reality, the activities you listed do not need to take too much time unless you schedule them all over the week and all over the day. Teaching usually takes 3 days a week (2 if you are lucky), leaving you 4 other days. Within those 3 days, you normally teach about 3 hours per day, leaving you another 13 (assuming you are awake 16 hours per day). To make a decent assignment or test takes about half an hour if you have a clear idea what skills you want to check. Grading is a nightmare if you give 20 problems on each test and try to distinguish between 3 and 4 on a 10 point scale but it gets much easier and faster if you give 6 problems, use a 4 point scale, and have faith in the law of large numbers that will level out minor grading deviations over the semester.
This leaves just students, committees, and personal life. In my experience, those activities take exactly as much time as you are willing to spend on them. You have all options between opening your door at the beginning of your office hours and locking it at the end and running after each individual student in each of your classes urging him to come to your office to discuss his performance, etc. As to the committees, normally you are not obliged to be on more than two and those usually meet for at most 3 hours (very few people can endure longer meetings) once every two weeks or so. As to the personal life, you are the only one to choose its style and intensity though some choices have long range implications.
In other words, you can control your time to a great extent, so, when you are really into something and are making progress on a problem, you can easily downsize everything else to the bare minimum and free up a lot of time. The problem is that such moments are extremely rare and most of the time you feel like a helpless idiot who cannot figure out the simplest thing and should be kicked out for being a useless wreck. Then, to justify your existence, you start stretching other activities and can easily fill all available time with them, creating an illusion of a busy and productive day and thus keeping your self-esteem afloat.
Comment: Downvoted for the implication that the typical workweek is 7 days at 16 hours of work.
Comment: @CapeCode fedja didn't say (or imply to me) that the _working_ week is 7x16, but that the _time available_ is 7x16. Taking three days from that leaves four. Some of that four will be committees etc., some will be personal life.
Answer: The other answers are spot on - you do not need to find time, but use it.
On the other hand, there are very busy times, e.g. terms where I teach too many courses or courses that take of lot of time to prepare. In these times I usually try to reserve at least half a day per week where I do not put any appointments and do research. I make very few exceptions and most of the time these slots are quite productive.
Other simple tricks to work quietly is to simply close the office door for your research periods or work at other places…
Answer: You need to make a schedule that takes into account your needs to be able to the research work you're supposed to do. You can then minimize the time spent on  activities that you don't find all that useful (like grading homework, making homework assignments, etc.), while making sure you get enough quality time for research. What you want to avoid is having your research time broken up into small pieces during which you can get hardly anything useful done.
Many people would ideally want to have large blocks of several hours of uninterrupted study time. E.g. you can put a 3 hour block from 9 am till 12 pm, and another one from 2 pm till 5 pm. Then all your other work that you don't value as much as research work can be crammed into the two hours from 12 pm and 2 pm. This means that you're assigning less quality time for things such as grading homework, e.g. you can do that while eating lunch. On some days you may have to spend a few hours doing other things like teaching, on those days you can perhaps only fit one 3 hour research block into your schedule.
Assigning quality time for research is very important. If you try to get to a more efficient schedule where you work in smaller blocks, you may benefit on the short run, but you'll tend to not go the extra mile with your research work, which will then suffer on the long run. Suppose e.g. that you have just one hour to work on a problem, then you'll tend to not start doing something that would be half finished when investigate a marginal issue. If an approach to attack a problem is not working well and to get to the bottom of that you could write a program to do some simulations, then just the idea of having a half finished program will put you off from even embarking on that, and because it's just to investigate why the method isn't working, you'll tend to just ditch that approach and move on. However, by systematically taking such decisions, you may miss valuable insights on the long run.
You can't predict when you would gain a valuable insight. You won't notice what you have missed,  but after several years you may notice that your colleagues have had more success with their research work than you.
Answer: Great answers up here saying to use the time you have. But what if there is really no time? You have to sacrifice something to work on your research project. In my experience I see people in academia sacrificing the following, from the most frequent to least:

Family
Sleep time
Time spent with friends
Time spent socializing
Leisure (there is usually not much free time left)
Nothing. They just hack up a few low quality publications for check marks.
Work time

My favorite is actually #7, but I'm surprised how few people sacrifice other work for more productive research work. Drop a class or few, re-negotiate work load, talk your way out of bureaucracy, paperwork, admin meetings, useless conferences, etc. Do research during office hours. Let students do simpler parts of your research work. Finally, change a university to one that values research more and willing to pay you for it.
Comment: Unfortunately, various of the factors you list are interconnected. For instance, "change a university" may give you more office hours time for research, and thus more time for your family - if it weren't for the issue that the university that values research less is where your family is, and the one that values research more means you don't see your family all that much at all due to distance. Likewise, "drop a class or few" - fine. But that may lower your chances to get in touch with "students [to] do simpler parts of your research", so in the end you might have even less time to do ...
Comment: ... the "high-level" research you are striving to do.
Answer: By letting other things go.  Which is easy enough to do when you've got that itch!  (The itch to... work on an interesting problem, to read or edit a collaborator's draft, to program a simulation, to look for and read related papers, etc.)


Fields cancellation and energy accounting

Question: When fields cancel in superposition. Where does the energy go? Do they revert to their potential form? Please give an example.
Answer: Two fields can interfere destructively only over a finite region.  Consider a sum of two counter-propagating wave solutions.
$$\psi(x,t)=\psi_{1}(x,t)+\psi_{2}(x,t)=A\cos(kx-\omega t)+A\cos(kx+\omega t)=2A\cos(kx)\cos(\omega t)$$
There are nodes (regions of complete destructive interference) at $x=\frac{2\pi}{k}\left(n+\frac{1}{2}\right)$; the amplitude of the temporal oscillations at these nodal points is zero.  However, there are antinodes, where there is complete constructive interference at $x=\frac{2\pi}{k}n$.
Therefore, the interference relocated the energy away from the regions of destructive interference to the regions of constructive interference.  The total energy, integrated over all space, remains the sum of that of the two interfering fields.
The only way to have complete cancelation over all space is to sum two waves that have equal wavelengths, directions, and amplitudes, but differ in phase by $\pi$.  But that means a sum like
$$A\cos(kx-\omega t)+A\cos(kx-\omega t+\pi)=A\cos(kx-\omega t)-A\cos(kx-\omega t)=0.$$
Note that this wave cancels everywhere in space and time, including at wherever it is supposed to be emitted.  So there was really no nonzero waves present, even at the time of emission; and that is the only way that no energy can be involved.
Comment: @Jtl That can't happen.
Comment: @Jtl See my update.
Comment: But what if the two waves only have destructive interferences and no constructive interferences?
Comment: Look ag right side of https://www.google.com/search?client=ms-android-samsung&source=android-home&source=hp&ei=bs4iXMOdJcHr-Qbxtoe4Cw&q=destructive+interference&oq=destructive+interference&gs_l=mobile-gws-wiz-hp.3..0l5.4352.18277..19887...2.0..5.1063.24157.6-28j1....2..0....1.......5..41j46j0i131j0i70i249.KFeFC-uurjM#imgrc=2ZDkSlsIhEjjmM:  there is no constructive interferences hence output is only a straight line.
Comment: @Jtl Buzz is correct here. You cannot have complete destructive interference. The pictures you linked to are not complete solutions of Maxwell's equations
Answer: Let us start with the example. In a noise cancellation the external sounds vibrations are canceled out by vibrations with amplitudes of opposite signs. The magic behind is the dissipation of energy. An old good hammer, hammered on a piece of steel, will be pushed back. Doing this many times, you could feel, that the steel gets hot, so not all of the kinetic energy of the hammer is reversed. Using a hammer on the ISS is not a good instrument because of the pushback. That's why their hammer is hollow and filled with marbles. The dissipation of the kinetic energy is much more better.
For water waves nearly a perfect cancelation of coherent waves is possible. All the energy is going into heat. Think this like two soft squash balls, all the kinetic energy is converted to heat, means the increase of the vibrations of the involved molecules of the balls.
Answer: If 2 waves travel cross a pond from opposite sides, and let's say they are opposite in phase, in the middle of the pond when they meet they cancel, BUT this is only temporary.  After they pass each other, they are visible again and continue along to the opposites shores!.  Waves cancelling is one of the most poorly explained phenomenons in physics, because they really don't literally cancel, they just temporarily intertact with each other.  The same is true for light waves. In the middle of the pond all the wave energy is stored as tension between the water molecules, this energy is very real but not visible unless you are very very tiny!
Comment: A non-moving field (static field) is an interesting question, it's not really a wave.  You could say it is similar to 2 people pushing on either side of a car, the net force is cancelling but you don't want to get in between them! For static EM fields scientists have invented the term virtual photons to explain things pushing on each other (no energy is transferred during this process only force), these are different than regular light wave photons.  Virtual photons is a very advanced area of study and I'm not sure of other practical application of this concept but to explain static EM fields.
Comment: In fact the 2 wires want to push apart.
Comment: How about magnetic field? When opposite currents exist in 2 wires besides each other. The field cancel (basis of GFCI). So they dont really cancel and just hiding themselves?
Comment: How about magnetic field? When opposite currents exist in 2 wires besides each other. The field cancel (basis of GFCI). So they dont really cancel and just hiding themselves?
Comment: In the case of magnetic field. There seems to be two issues involved. How energy accounting works in magnetic waves cancellation and how you can store energy in magnetic field  via inductors. What is these two different concepts called in physics?
Comment: "*In the middle of the pond all the wave energy is stored as tension...*" - A solid barrier along the line of cancelation would not affect the result. There is no energy transfer across the cancellation line. The waves simply reflect off each other.
Comment: Interesting perspective but the barrier wouldn't reduce the tension in the system so energy and momentum are maintained.


Why were Fe-oxides not usually used for finding skarn Fe ore deposits in geochemical exploration?

Question: I found that Fe-oxides were usually not used for vectoring Fe mineral deposits of skarn type in geochemical exploration. As an indicator element, the common practice told us Fe-oxides should be the most important indicator for Fe mineral exploration. Is there someone who can give an explanation? In addition, which elements can be used for prospecting skarn Fe mineralization?
Answer: Skarn is metamorphosed sedimentary rock, it's iron deposits are in the form of sulfides. This means two things;

There almost certainly will be iron oxide contamination throughout the unit, at least I have never seen a sedimentary rock that didn't have staining from iron oxides. In my Earth Science classes we were always told that copper, and particularly iron oxide(s) were next to useless as diagnostic tools because tiny volumes of metal cause large and widespread colour signatures and sample contamination.
The commercial iron ore deposits in skarn units are unusual in that they are normally sulfides rather than the more usual oxides, thus tracking oxides is not as useful as it would usually be.

You're looking for sulfur based mineralisation so Gypsum may be diagnostic, you're also looking for areas of metal concentration so lower mobility metals like Molybdenum may also be useful.
Comment: Thank you very much, Ash. I have two more questions. Firstly, whether the first thing you presented here only applies to local-scale geochemical exploration, say 1:1000? As far as I understand, this characteristic of sulfur-based mineralization is good for geochemical exploration in a regional scale, which take stream sediment samples. Secondly, it seems that Molybdenum is active under surficial oxidation environment?
Comment: @emberbillow Sorry I've read the first half of your request and have to ask for clarification of my own because I can't understand what you want me to clarify. On the Molybdenum my understanding was that it is only noticeably mobile under extremely acid conditions, down towards pH 3 or less, and will otherwise tend to stay in formation.
Comment: Thank you, Ash. As far as I know, the common sulfide for Molybdenum is molybdenite, which formed under reduced conditions. Once the ore bodies was denudated to earth surface, it tend to be oxidized and became mobile in stream. Thus, I have no idea whether Molybdenum is immobile in surficial environment.
Comment: @emberbillow Ah I see what you're saying, I'm thinking about *in situ* rock sampling rather than looking at streambed erratics, in that case you'd need to look for the most chemically stable sulfides in the stream sediment as a clue to upstream sulfurous ore weathering. Molybdenum oxide is significantly less chemically mobile than iron oxide under neutral pH conditions (an assumed field standard condition that may or may not be valid for a given location) so it will stay concentrated close to the site of sulfide weathering.


Do brake hoods come in different sizes?

Question: I have a Ribble Sportive Carbon road bike.  The brake hoods are much smaller than most other bikes whihc makes them much less comfortable than other bikes (Scott, Specialised etc.)  Can I just replace the hoods to make them more comfortable or put larger hoods over the top of my existing hoods?
Comment: I've many times seen bikes with Velcroed-on pads around the hoods.  Don't know where you get them.
Answer: yep they come in different sized based on what brand the gears are, and what year or model.
Campagnolo, Sram and Shimano the 3 main manufacturer's.
Looking at the stock Ribble sportive bike i'm guessing you will need these:
http://www.wiggle.co.uk/campagnolo-ergopower-replacement-hoods/
or these
http://www.ebay.co.uk/itm/One-23-Replacement-Brake-Hood-Covers-for-Campagnolo-11-speed-WHITE-NEW-/280905184450?pt=UK_sportsleisure_cycling_bikeparts_SR&hash=item416740f4c2
Campagnolo 10 speed, or modern 10 speed replacement hoods
Comment: Some riders do put 2 sets on for races like the Paris Roubaix for cobbles. But they dont fit properly and arnt designed to take 2 sets. you can buy gel pads to re-wrap under the bar tape to make it more comfortable: http://www.ribblecycles.co.uk/sp/road-track-bike/Fizik-Bar-Gel-Set-4-pcs/FIZIHBTP210000000000?utm_campaign=Googlebase&utm_medium=organic&utm_source=Googlebase
Answer: Different makes and models of hoods are going to be different sizes, but as far as different sized rubber replacement hoods for a particular make and model of lever, I believe you are out of luck. The levers are designed with a particular hood shape in mind and I don't recall ever seeing a replacement that was of a different size.
You may benefit from changing the position and angle of your levers on your bar for extra comfort. Some folks like a deep dip in transition from their bars to their levers; personally I find it much more comfortable to have a flat transition from the bars to the levers, which can be achieved by rotating the bars back while pushing the levers down (which effecively keeps the levers at the same angle).
Answer: There used to be a velcro wrap that was padded and wrapped around the brake hoods. I believe I got it from Bike Nashbar or Performance shops. It made the brake hood "rest" area larger as well as helped to cushion road vibrations. I don't see them available any longer and could find no other types of replacements online, but I'd say that you could use some "stick to itself velcro that has the "loop" surface on one side of the band and the "hook" surface on the opposite side, so it will stick to itself when wrapped. You could buy longer bulk strips, say 12" long by 3/4" to 1" wide and wrap the brake hoods to the desired size. You may even be able to place some sort of padding on the hoods before wrapping if desired. This would be more cost effective to try before replacing the brake hoods with a different style.

Do brake hoods come in different sizes?