How to get any medical journal into your RSS reader even if they don’t provide an RSS feed


What is RSS?

For the non-initiate, RSS is a very useful protocol that is used all over the web. You can think of it as a way of separating a stream of content from the website where it’s normally viewed. Nearly every blog has an RSS feed, as do news sources, web comics, and even academic journals. Podcasts are like a specialised version of RSS for audio files only.

What makes RSS great is that I can take all the RSS links from all the news sites, blogs, webcomics and journals that I’m interested in and put them together into a single aggregator (I use Feedly). In this way, I don’t have to be constantly checking all these websites to see if there’s new stuff posted.

But what about medical journals that don’t provide RSS?

Unfortunately, there are some medical journals that do not have an RSS feed. For example, the JNCI (the Journal of the National Cancer Institute) does not have one. (If I’m wrong, please put the link in the comments.) So if I want to know what’s been published recently in the JNCI, I have to visit their site, or look on their Twitter. This is annoying, since the whole point of RSS is to have all the content you want to consume (or as much of it as possible) in the same place.

Pubmed allows users to save any search as RSS feeds

Pubmed provides a wonderful and open, standards-compliant service, but almost no one seems to know about it! This is great for people who are actively researching a subject, and also for people who just want to keep up with a particular journal or subject area.

Some of you have probably figured out where I’m going with this by now, but if you haven’t, I’ll spell it out. Let’s continue with the example of JNCI.

How to put new articles from any journal into Feedly

This assumes you already have an account on Feedly, but you can do this with any RSS reader, of course.

  1. Visit Pubmed in your browser
  2. Click “Advanced” under the search field
  3. Under “Builder,” click “All fields” and choose “Journal”
  4. In the text field beside the box where you selected “Journal,” enter the name of the journal you’re interested in (it will autocomplete, if you have done this correctly, you should see something like “Journal of the National Cancer Institute”[Journal] in the uneditable text field at the top)
  5. Click “Search”
  6. Under the search field at the top of the page, click the “Create RSS” link
  7. Choose how far back you want your search to go (I chose 20)
  8. Click the “Create RSS” button
  9. Right-click the orange “XML” button and click “Copy link”
  10. Go to Feedly, and paste the link into the “Search” field at the top right
  11. There should be one result, click “Follow” and choose which collection you want to keep it in

You’re done! Now whenever Pubmed indexes a new entry for that journal, it will appear in your RSS reader!

You can also make RSS feeds for any search you want on Pubmed

Of course, you may not be interested in everything a journal has to say, so you can refine the search to only include “breast cancer” or you can drop the journal identity part of the search entirely. The world is your oyster!


    title = {How to get any medical journal into your RSS reader even if they don’t provide an RSS feed},
    journaltitle = {The Grey Literature},
    author = {Benjamin Gregory Carlisle},
    address = {Montreal, Canada},
    date = 2017-06-15,
    url = {}


Carlisle, Benjamin Gregory. "How to get any medical journal into your RSS reader even if they don’t provide an RSS feed" Web blog post. The Grey Literature. 15 Jun 2017. Web. 28 Jun 2017. <>


Carlisle, Benjamin Gregory. (2017, Jun 15). How to get any medical journal into your RSS reader even if they don’t provide an RSS feed [Web log post]. Retrieved from

Can you predict the outcome of the 2017 UK general election?


In 2015, I posed the following question to the internet:

Can you predict the outcome of Canada’s 42nd federal election?

I collected 76 eligible forecasts of seat counts for the major political parties in Canada and analysed them.1 The answer was “no,” but the results continue to be informative, especially now that everyone looks back on the election of Trudeau to a majority government as having been a “sure thing.”

Now that there’s a general election in the UK, and their parliament is reasonably similar to ours, I’ve launched a similar project eliciting predictions of seat counts for the four major political parties listed on the Wikipedia page for the 2017 UK general election.2

The link is here:

Do it do it do it!

Tell your friends! Tweet it! You don’t need to be a UK citizen to predict. As always, the best forecaster will be offered a beer, courtesy of me (if you’re over 18).

I will be closing the page to new submissions as of 2017 June 8 at 20:30 (London time).


  1. Carlisle, BG. “No, you can’t predict the outcome of Canada’s 42nd federal election”, The Grey Literature, 2015.
  2. Wikipedia contributors, “United Kingdom general election, 2017,” Wikipedia, The Free Encyclopedia,,_2017&oldid=776746852 (accessed April 24, 2017).


    title = {Can you predict the outcome of the 2017 UK general election?},
    journaltitle = {The Grey Literature},
    author = {Benjamin Gregory Carlisle},
    address = {Montreal, Canada},
    date = 2017-04-23,
    url = {}


Carlisle, Benjamin Gregory. "Can you predict the outcome of the 2017 UK general election?" Web blog post. The Grey Literature. 23 Apr 2017. Web. 28 Jun 2017. <>


Carlisle, Benjamin Gregory. (2017, Apr 23). Can you predict the outcome of the 2017 UK general election? [Web log post]. Retrieved from

Introducing Serlingbot


My boyfriend and I were watching an episode of The Twilight Zone this week, in which a newly-minted revolutionary dictator is told by a departing member of the overthrown government that a particular mirror would show him his assassins. Of course, this leads him to kill his closest friends.

Sorry, should have said “spoilers” or something. Although really, you’ve had 56 years to see this episode. If you’re not caught up, that’s on you.

At the end of the episode, my first thought was: Trump would probably have fallen for that line too.

Inspired by that episode and of course by a Scottish newspaper immediately prior to Trump’s inauguration, I had an idea: A Twitter bot that downloads photos tweeted by the White House, turns them greyscale, overlays them with Rod Serling and tweets them again.

On my first Google search, I found a transparent PNG of Rod Serling. The Internet had also prepared a repository of json-formatted Rod Serling monologues. All I had to do was find a PHP library to connect to the Twitter API, and I was good to go!

You can follow @serlingbot on Twitter, and it will regularly send you photos from a few selected Twitter accounts that have been Serling-ed.

But that’s not all!

If you tweet a photo to @serling on Twitter, it will reply to you—with your photo Serling-ed.

And if you don’t have Twitter, I have made a non-Twitter web version of Serlingbot, where you can enter a link to an image on the web, and it will Serling your photo for your own private use.

I like to think that Rod Serling himself would have appreciated the idea of being resurrected as a post-apocalyptic robot, doomed to condemn a totalitarian government from beyond the grave. It’s something that might have happened … in the Twilight Zone.


    title = {Introducing Serlingbot},
    journaltitle = {The Grey Literature},
    author = {Benjamin Gregory Carlisle},
    address = {Montreal, Canada},
    date = 2017-04-21,
    url = {}


Carlisle, Benjamin Gregory. "Introducing Serlingbot" Web blog post. The Grey Literature. 21 Apr 2017. Web. 28 Jun 2017. <>


Carlisle, Benjamin Gregory. (2017, Apr 21). Introducing Serlingbot [Web log post]. Retrieved from

Media literacy for the Trump era


I have compiled and explained a list of four five common fallacies that I have noticed while consuming news media in the age of Trump. These aren’t new since Trump was made president, but I feel like they are exacerbated by the current administration. They’re meant to be taken in the spirit of the “laws of the internet” that dictate “if you can imagine it, there’s porn of it,” or “any sufficiently long internet argument will eventually invoke Hitler,” etc.

The law of imputed 12 dimensional chess

No matter how demonstrably stupid Trump’s action, it will always be depicted by some as a part of an inscrutable master plan.

Every time Trump does or says something bad, it will be followed up by a series of hot takes, tweets or op-ed pieces in which we all try to guess what his real goal is. E.g. “He’s banned Muslims from entering the United States. But what is his endgame here? What is he trying to distract us from?”

Muslims being banned is the real crisis. Just because us white people aren’t directly affected doesn’t mean that the real evil is coming later. It’s not a feint to make us look the wrong way. That was it. This is not a drill. Real people are being hurt.

I think there’s a few reasons that this fallacy occurs so often. It’s hard to admit, but Trump isn’t a genius who beat the political system by being some calculating mastermind. That would be easier to take in some ways. (He’s profoundly stupid,1 but he’s wealthy and the system is just not set up to protect us from people like him.) As best I can guess, the “12 dimensional chess” theories are appealing due to: 1. simple self-centredness and latent racism (i.e. “It’s bad, but it doesn’t affect me, so the badness must be something else”), 2. a desire to avoid admitting that the left was beaten by an idiot or 3. a McCarthy-like impulse to cast the villain as omnipotent.2 Take your pick.

The law of sacrificing marginalised communities

Marginalised communities will be the ones most negatively affected by Trump’s policies, but they will also be the ones blamed for it, directly or indirectly.

Here is an example of what I mean: The February 2017 cover of The Economist3 features the profiles of Trump and Putin facing each other. Trump is wearing lipstick and there’s a kiss mark on Putin’s cheek. The implication is that Trump and Putin are gay.

The LGBTQ+ community has been betrayed by Trump’s recent executive order that rolled back protections for trans people.4 Gay men are now being turned back at the US border after being interrogated and humiliated over the private contents of their phones.5 Things are bad and I don’t know if they’re going to get better.

But of course, the joke that’s currently in vogue is that Trump is gay. (Ooh! Burn!)

Now, I get it. I’ve made jokes like this in the past, but I’ve had a change of heart on the subject. It would certainly bruise the egos of Trump and Putin to be called gay, but then they’re not going to be reading my Twitter feed. Other people will read my messages though, and they will be getting the message that it’s okay to use “gay” as an insult, or to throw marginalised communities under the bus to make a cheap shot at a world leader who honestly doesn’t care.

This is just one example of a marginalised community that’s being indirectly blamed for their own oppression, but I guarantee you that for every similar issue that comes up, there will be self-styled “centrists” or “moderates” who tell the more progressive elements of society that it’s “their own damn fault” for getting uppity and demanding something that the mainstream has had all along. You’ll often see this happen along with the phrase “This is why Trump won,” blaming progressives, women, LGBTQ+, whatever for the rise of Trump.

Watch for it. Any protest or statement with a progressive bent will be met by an opportunistic “centrist” who wants to shut you up by telling you that they agree with your general goal, but that you must be nicer about it and accept a glacially slow pace of progress, and that anything other than that “is why Trump won.”

The law of conservative victimhood

No matter how empowered conservatives become, they will always find a way to make their own victimhood the focus.

This is also an impulse I can sympathise with. I grew up in a super-conservative community, and so I was taught from a young age to believe that it is Christians and conservative Christians especially who are a marginalised minority in Canada. I was taught—and I fully believed—that Christianity was persecuted, and indeed if you define Christian orthodoxy narrowly enough, one can certainly maintain that delusion for quite some time. So I understand where they’re coming from.

But it’s still stupid.

Conservatives always have the upper hand. They aren’t a persecuted minority. That’s just what conservatism is—it’s the political inclination to support the status quo. It’s the people who have power working to support the institutions that got them there. The highest office in the United States has just been awarded to a conservative. The House and the Senate both have Republican majorities. Conservatives are not victims. Not in any sense. In fact, they hold a disproportionately large amount of power over the machinery of government.

And yet, conservatives will defend their victimhood as if that were their very essence.

If there comes a day when there is a shortage of foreign workers to pick the vegetables that Americans want to eat, the tragic hero of the story when it is told will be the poor hard-working American who can’t afford how expensive vegetables have become, and not the foreign workers who were deported. Count on it. Or if a queer person is beaten, the biggest controversy will be whether or not it’s fair to label the aggressor as “homophobic.” And we’re already seeing the beginning of what I expect will be a steady stream of op-ed pieces about how people who supported Trump are the real victims of liberals who are being big meanies about the fact that their choice for President is a fascist.6

It shouldn’t have to be said, but if you supported a fascist by voting for him, and that fascist’s policies mean that your friend is the victim of hate somehow, you should have the perspective to understand that you are not the victim in this situation. You are closer to being the aggressor.

This dynamic is probably strongest along racial lines, but you also see it along the queer-straight axis as well. (E.g. “They excluded police officers from Pride? That’s the greatest injustice in the history of the queer rights struggle!”)

C.f. The “Liberal bubble”

The law of false centrism

No matter how far the political centre is pulled to the right by extremists, anyone who questions “centrism” by advocating policies to the left of where the new political centre has been pulled will be dismissed as insane.

To make a facetious example, if Trump is saying that we need death camps for Muslims at every border crossing and his opponents are saying we shouldn’t have any, the fallacy of centrism would be to say that we only need death camps at certain major border crossings.

This one makes me worried for the future because the main message of the Democratic party from 2016 seems to have been, “If you’re politically to the left of Clinton, we don’t want or need your votes, you dirty Bernie bro. You’re just as bad as Trump.” This message only leads to political victories if everyone is really, really excited about being a political moderate. And only if they’re also okay with the political “centre” being shifted to the right.

From a Canadian perspective, it’s very easy to see how the American political spectrum is shifted. The policies of the centre-right party in Canada (The Liberal Party) would be considered so far left wing in America as to be absolutely unthinkable.

The law of imperfect protests

No matter how despicable the thing that is being protested, if the protest can be criticized—in any way—”moderates” will focus on that.

This mostly goes for student protests, but you see it in other contexts. I’ve seen it a dozen times if I’ve seen it once, and sometimes from people that I would otherwise consider to be very intelligent. Usually you see it shortly after a protest, and often it starts with a somewhat strained observation that the protest is “so ironic.”

E.g. “It’s so ironic,” said the moderate, “They claim to be against death camps, and yet there’s a small amount of litter left after the protest”

This example is really exaggerated, although who knows, we may get there. The fallacy I’m trying to point out is that the violence of white nationalism or fascism or being an outright peodphile apologist is nowhere near the level of violence of a stupid student protester who breaks a window or something while protesting against it. These are absolutely not equivalent, and a protest that doesn’t go 100% perfectly shouldn’t be a reason to throw up one’s hands and say, “Well, I can’t support these protesters because they broke a window. Their position looks just as violent as the white nationalists’.”

“Moderates” love to point out The Irony of this situation, and they also love to ring their hands over how the poor fascist just wanted to speak, and how this protest has somehow damaged Free Expression itself (as if protests weren’t also speech as well).

Like the other fallacies, this is not particular to the Trump era, but it seems much worse now. Watch for it and the others, as well as their themes and variations.

Edit (2017 March 6: Added “The law of imperfect protests”)




    title = {Media literacy for the Trump era},
    journaltitle = {The Grey Literature},
    author = {Benjamin Gregory Carlisle},
    address = {Montreal, Canada},
    date = 2017-02-27,
    url = {}


Carlisle, Benjamin Gregory. "Media literacy for the Trump era" Web blog post. The Grey Literature. 27 Feb 2017. Web. 28 Jun 2017. <>


Carlisle, Benjamin Gregory. (2017, Feb 27). Media literacy for the Trump era [Web log post]. Retrieved from

Are pronouns up for debate or not?


There’s been a lot of ink spilled recently about the use of pronouns and preferred names in academia. At U of T, one professor in particular is kicking up a fuss about having been asked to use students’ preferred names and pronouns. A CBC editorial on the subject by Neil Macdonald recently provided an entertaining example of a baby boomer throwing a sputtering temper tantrum over the fact that he’s being asked to think about other people.

I could begin demanding that my colleagues refer to me as “blort” or “zonge” with the expectation that they would respectfully begin doing so.

(Imagine wanting to be treated with respect! Hilarious! Also, for the record, the singular “they” is not some newfangled invention of “those damn SJW’s.” There’s at least one example of it in Shakespeare. See A Comedy of Errors, Act IV, Scene 3.)

It’s almost not worth saying that this is a generational thing, and when the boomers have passed on, their faux indignation over being asked to be a decent human being will die with them. In a couple decades, this debate will seem as weird to us as a prof who insists that freedom of expression means that he has the right to use the n-word to refer to students who are people of colour.

But let’s take the question of whether we should debate another person’s pronouns at face value, just for fun. Academia is supposed to be an anything-goes bare-knuckle cage-match of ideas, right? Are there legitimate reasons why we might not want to have a debate over pronouns?

I’ve come up with two.

Intellectual honesty

Let’s start with the example of smoking and lung cancer. I’ll get back to the debate at hand, I promise.

Smoking causes lung cancer. This is a fact.

Yes it’s a probabilistic thing; yes, it’s true that not all smokers get lung cancer; yes, it’s true that not all people with lung cancer smoked. But the causal link between smoking and lung cancer is so well established that it is now beyond doubt.

If, in 1950, there was a formal debate at McGill called “Does smoking cause lung cancer?”, that might have been an appropriate debate to have. There was genuine uncertainty over the issue at the time.

However, if I saw a poster on campus today in 2016 for a debate with the same title, I would take it to be a major failing in terms of either scientific judgement or intellectual honesty on the part of the organisers. I would question either their motives or their competency. For a person who wants an answer to the question of whether smoking causes lung cancer, the appropriate response is to point them toward the library, where there are reams of good data on the subject. A debate would not be appropriate.

The reason for this is that a formal public debate presupposes a certain equipoise between the sides being debated. Just framing certain issues as needing to be discussed by academics in the manner of a debate can be dishonest, like in the smoking/lung cancer debate example.

And so sometimes when a person says that something is “not a matter of debate,” it’s not because that the person is some insecure authority whose policies cannot bear scrutiny and they wish to stifle dissent by barring discussion. Sometimes when a person says that something is “not a matter of debate,” they just mean that it would be irresponsible and dishonest to use the machinery of academic “debate” to introduce unwarranted uncertainty where the issue has already legitimately been settled.

As academics, of course we need to be ready to defend any position we take. If there is anywhere that debates should happen over difficult, offensive or extremely technical subjects, it’s within a university. And yet, not all debates are intellectually honest ones to have. Sometimes when a person says, “Let me play devil’s advocate,” the correct response is, “The devil has enough advocates.”

Yelling ‘fire’ in a crowded theatre

Not all speech is benign. The famous example is that if you falsely yell “fire” in a crowded theatre, you could kill people.

The same goes for other forms of speech, including academic or political “debates.” After Harper dredged up the niqab debate in the 2015 election, there were violent physical attacks on Muslims in Montreal. The Brexit and Trump campaigns also both arguably brought about spikes in hate crimes in the UK and the US. If you have debates like, “Should we ban Muslims from our country?” those can—and we have seen recently that they do—incite violence against Muslims.

Other sorts of speech can cause harm even more directly. Let’s imagine the example of a trans student in a small class who doesn’t want to be outed as trans to her peers. Imagine that the student goes to the teacher on the first day of class and says, “I know the class list has my name as ‘John,’ but I go by ‘Jane,’ and I’d like you to use ‘she/her’ when referring to me.”

Let’s further imagine that the professor is of the type who refuses to respect a student’s preferred name and pronouns on principle. Just by exercising their “right to freedom of expression,” this professor could out the student to their peers against the student’s will, which could directly put them at risk of harm. This student might be threatened or harmed, but even if the student is lucky and nothing bad happens, she might just feel threatened by this behaviour, which is a harm in itself.

Part of the problem is that discussions that can cause harm or risk of harm to others are often initiated by people who don’t bear any of that risk themselves. So for example, when Harper decided to “have a debate” on the niqab for his own narrow political ends, he did so knowing that he would never be the target of the anti-Muslim violence that followed. Similarly, a cis prof who refuses to use preferred names and pronouns will never be on the receiving end of violence against trans people, and they aren’t even in a good place to evaluate the level of risk that they may be imposing on other people against their will.

The prof at U of T wants to paint himself as the brave intellectual, bucking the orthodoxy and asking questions that no one else has the courage to ask, while his opponents won’t even meet him for an honest discussion. All I see is a guy who doesn’t have any skin in the game, who can afford to debate the level of respect owed to other humans because it will never affect him personally.

What does it mean when someone says their pronouns aren’t up for debate, then?

When a person says their pronouns “aren’t up for debate,” they are not saying that there is no defense for the position they’re taking. There is a field of study that has considered, among other things, the question of pronouns and preferred names. In a lot of academic institutions, it’s called “Gender Studies.” You’ve probably made fun of it. But the fact that you’re ignorant of an entire academic discipline and decades worth of research doesn’t mean that there is a genuine question to be considered. It might just mean that you need to go to the library.

And when a person says their pronouns “aren’t up for debate,” they might mean that what seems like an abstract, academic discussion to you could mean harm or the risk of harm to them. They’re not saying, “My position cannot stand up to criticism.” They’re saying, “I don’t want to be a casualty of this discussion.”


Everything should be open for debate—in principle—but not all debates come from a place of intellectual honesty, and not all debates are benign.


    title = {Are pronouns up for debate or not?},
    journaltitle = {The Grey Literature},
    author = {Benjamin Gregory Carlisle},
    address = {Montreal, Canada},
    date = 2016-11-20,
    url = {}


Carlisle, Benjamin Gregory. "Are pronouns up for debate or not?" Web blog post. The Grey Literature. 20 Nov 2016. Web. 28 Jun 2017. <>


Carlisle, Benjamin Gregory. (2016, Nov 20). Are pronouns up for debate or not? [Web log post]. Retrieved from

A gift of the fae folk, I assume?


What is this thing?

What is this thing?

I tried to go to the Snowden talk at McGill a couple weeks ago. The lineup was too crazy huge for us to get in, so we went to Thomson House, the McGill grad students’ pub, and hooked a laptop into a TV there to watch.

Seriously, what?

Seriously, what?

On the way back, in a pile of stones upturned by the construction between the Leacock and Brown buildings on the McGill campus, I found a little medallion marked with strange symbols. It has a pentagram on one side and Death on the other.

I don’t know what to make of it. I assume it was left for me by the fairy folk, and that it’s a good omen?


    title = {A gift of the fae folk, I assume?},
    journaltitle = {The Grey Literature},
    author = {Benjamin Gregory Carlisle},
    address = {Montreal, Canada},
    date = 2016-11-14,
    url = {}


Carlisle, Benjamin Gregory. "A gift of the fae folk, I assume?" Web blog post. The Grey Literature. 14 Nov 2016. Web. 28 Jun 2017. <>


Carlisle, Benjamin Gregory. (2016, Nov 14). A gift of the fae folk, I assume? [Web log post]. Retrieved from

How to get R to parse the <study_design> field from XML files

by helpfully provides a facility for downloading machine-readable XML files of its data. Here’s an example of a zipped file of 10 XML files.

Unfortunately, a big zipped folder of XML files is not that helpful. Even after parsing a whole bunch of trials into a single data frame in R, there are a few fields that are written in the least useful format ever. For example, the <study_design> field usually looks something like this:

Allocation: Non-Randomized, Endpoint Classification: Safety Study, Intervention Model: Single Group Assignment, Masking: Open Label, Primary Purpose: Treatment

So, I wrote a little R script to help us all out. Do a search on, then save the unzipped search result in a new directory called search_result/ in your ~/Downloads/ folder. The following script will parse through each XML file in that directory, putting each one in a new data frame called “trials”, then it will explode the <study_design> field into individual columns.

So for example, based on the example field above, it would create new columns called “Allocation”, “Endpoint_Classification”, “Intervention_Model”, “Masking”, and “Primary_Purpose”, populated with the corresponding data.

require ("XML")
require ("plyr")

# Change path as necessary
path = "~/Downloads/search_result/"

xml_file_names <- dir(path, pattern = ".xml")

counter <- 1

# Makes data frame by looping through every XML file in the specified directory
for ( xml_file_name in xml_file_names ) {
  xmlfile <- xmlTreeParse(xml_file_name)
  xmltop <- xmlRoot(xmlfile)
  data <- xmlSApply(xmltop, function(x) xmlSApply(x, xmlValue))
  if ( counter == 1 ) {
    trials <- data.frame(t(data), row.names = NULL)
  } else {
    newrow <- data.frame(t(data), row.names = NULL)
    trials <- rbind.fill (trials, newrow)
  # This will be good for very large sets of XML files
  print (
      " processed (",
      format(100 * counter / length(xml_file_names), digits = 2),
      "% complete)"
  counter <- counter + 1

# Data frame has been constructed. Comment out the following two loops
# (until the "un-cluttering" part) in the case that you are not interested
# in exploding the <study_design> column.

columns = vector();

for ( stu_des in trials$study_design ) {
  # splits by commas NOT in parentheses
  for (pair in strsplit( stu_des, ", *(?![^()]*\\))", perl=TRUE)) {
    newcol <- substr( pair, 0, regexpr(':', pair) - 1 )
    columns <- c(columns, newcol)

for ( newcol in unique(columns) ) {
  # get rid of spaces and special characters
  newcol <- gsub('([[:punct:]])|\\s+','_', newcol)
  if (newcol != "") {
    # add the new column
    trials[,newcol] <- NA
    i <- 1
    for ( stu_des2 in trials$study_design ) {
      for (pairs in strsplit( stu_des2, ", *(?![^()]*\\))", perl=TRUE)) {
        for (pair in pairs) {
          if ( gsub('([[:punct:]])|\\s+','_', substr( pair, 0, regexpr(':', pair) - 1 )) == newcol ) {
            trials[i, ncol(trials)] <- substr( pair, regexpr(':', pair) + 2, 100000 )
      i <- i+1

# Un-clutter the working environment

remove (i)
remove (counter)
remove (data)
remove (newcol)
remove (newrow)
remove (columns)
remove (pair)
remove (pairs)
remove (stu_des)
remove (stu_des2)
remove (xml_file_name)
remove (xml_file_names)
remove (xmlfile)
remove (xmltop)

# Get nice NCT id's

get_nct_id <- function ( row_id_info ) {
  return (unlist (row_id_info) ["nct_id"])

trials$nct_id <- lapply(trials$id_info, function(x) get_nct_id (x))

# Clean up enrolment field

trials$enrollment[trials$enrollment == "NULL"] <- NA

trials$enrollment <- as.numeric(trials$enrollment)

Useful references:



    title = {How to get R to parse the <study_design> field from XML files},
    journaltitle = {The Grey Literature},
    author = {Benjamin Gregory Carlisle},
    address = {Montreal, Canada},
    date = 2016-10-6,
    url = {}


Carlisle, Benjamin Gregory. "How to get R to parse the <study_design> field from XML files" Web blog post. The Grey Literature. 06 Oct 2016. Web. 28 Jun 2017. <>


Carlisle, Benjamin Gregory. (2016, Oct 06). How to get R to parse the <study_design> field from XML files [Web log post]. Retrieved from

How to open XML files in LibreOffice from the WHO ICTRP


The WHO provides a “Search Portal” for the International Clinical Trials Registry Platform at the following address:

Try it out! Do a search for “ixabepilone AND endometrial” for example. This will return a table of 4 clinical trials (or it did on 2016 Sept 21) with a red button at the top right that says “Export results to XML.” If you click this button (then “I agree,” then “Export all trials to XML”) your browser will save an XML file with the results in it.

Using LibreOffice to parse these data

LibreOffice Calc XML import

LibreOffice Calc XML import

LibreOffice has a great tool for importing XML information, like the sort you just downloaded from the WHO database.

Open LibreOffice Calc, then click on Data > XML Source …

But there’s a problem

If you navigate to where your browser saved the XML file and choose it as the “Source File,” you’ll have a problem. The “Map to Document” field won’t be populated by elements from the XML file as expected.

I reported the bug to the LibreOffice people, but in the meantime …

Here’s a workaround

Open up the XML file in a plain text editor (Notepad, Atom, Scratch, etc.).

The first line will look like this:

<?xml version=’1.0′ encoding=’UTF-8′ ?><Trials_downloaded_from_ICTRP>

Just change that line so that it looks like this:

<?xml version=”1.0″ encoding=”UTF-8″ ?><Trials_downloaded_from_ICTRP>

The only difference here is that the single quotes are replaced with double quotes. LibreOffice will read the file as expected now!

Click where it says “Trial” under “Trials_downloaded_from_ICTRP” in the “Map to Document” field, choose A1 as the “Mapped cell,” and click the Import button!

You can now read through WHO ICTRP files on LibreOffice Calc.


    title = {How to open XML files in LibreOffice from the WHO ICTRP},
    journaltitle = {The Grey Literature},
    author = {Benjamin Gregory Carlisle},
    address = {Montreal, Canada},
    date = 2016-09-21,
    url = {}


Carlisle, Benjamin Gregory. "How to open XML files in LibreOffice from the WHO ICTRP" Web blog post. The Grey Literature. 21 Sep 2016. Web. 28 Jun 2017. <>


Carlisle, Benjamin Gregory. (2016, Sep 21). How to open XML files in LibreOffice from the WHO ICTRP [Web log post]. Retrieved from

Unboxing elementary OS Loki


On Friday, the latest version of elementary OS was released: version 0.4, Loki. I’ve been using elementary since Freya public beta 2, and it’s been a great general purpose working machine.

So I backed up all my files, downloaded the disc image and re-formatted my computer. Here are my impressions and notes:

  • The installer worked really well. No surprises. It was straightforward, fast, and it worked on the first time. I just restarted my computer with the USB installer drive in it, and it worked. On the first try.
  • For reference, to install the previous version, Freya, I had to use another computer to download wifi drivers so that I could get the computer on the internet. It took a few tries. Not this time!
  • Also, the previous version had a really hard time with rebooting. I had to fiddle around in GRUB settings to make it work. This time it worked right out of the box.
  • Loki is designed to be simple. This means that certain features, like adding software repositories, is disabled. Hence, right away I installed: software-properties-common, gdebi and elementary-tweaks, of course.
    • gdebi was necessary to install, R Studio, Vocal, etc.
    • Single-click to open files by default in the file manager? Really?
  • I needed to follow the instructions on the following page to get R running:
  • I needed to install Dropbox from here:
  • This version of Loki is based on Ubuntu 16.04 rather than 14.04, which fixed a lot of the problems that I forgot I had. For example, this allowed me to upgrade to the newest version of LibreOffice. LibreOffice was working mostly fine before, except for a weird graphical glitch with the Zotero plugin (the buttons’ colours were inverted).
  • Now that I’m on the topic, installing LibreOffice from the AppCenter didn’t work. I had to un-install and then install from the command line. That was weird.
  • The system tray is much better now. There were a few apps that just never appeared up there despite my best efforts to fix them.
  • I don’t actually care for the new “AppCenter” that comes with Loki very much. Some of the software that’s in there doesn’t “just work.” (LibreOffice for example didn’t work until I installed it using apt-get in the Terminal.)
  • Adobe Digital Editions still works perfectly through Wine, so I can still get all my library books on my Kobo that way.
  • I installed Deja Dup from the command line, and then followed these instructions to hook it up to the file manager:
  • The Music app is very iTunes-like. And by that I mean that it is what iTunes used to be like before it became bloated and unusable. It’s a simple, single-purpose app that opens from a cold start in less than a second on my computer. There’s no store. It doesn’t sync my phone. All it does is index the music files in my ~/Music folder, and allows me to play them.
  • Actually, come to think of it, that’s what I like about elementary OS as a whole. It’s Mac-like, but without a lot of the really annoying bloaty stuff that makes it hard to actually get work done on a Mac.
    • How many times do I have to tell my computer, “No, I don’t have or want an Apple ID?”
    • “No, I don’t want this update to GarageBand.” Stop asking me.



    title = {Unboxing elementary OS Loki},
    journaltitle = {The Grey Literature},
    author = {Benjamin Gregory Carlisle},
    address = {Montreal, Canada},
    date = 2016-09-11,
    url = {}


Carlisle, Benjamin Gregory. "Unboxing elementary OS Loki" Web blog post. The Grey Literature. 11 Sep 2016. Web. 28 Jun 2017. <>


Carlisle, Benjamin Gregory. (2016, Sep 11). Unboxing elementary OS Loki [Web log post]. Retrieved from

This is the best ever!


We're calling it "Two Queens Honey"

We assembled our apiary with … Pride (haha it’s a gay joke)

I am the most hipster now

I am unreasonably excited about this and have been for months.

As of last Sunday, I am the most hipster ever. This has been a project that’s a long time coming. I’m sure that my colleagues are tired of hearing me talking about it: A few weeks back we bought an apiary, assembled it, painted the top like a Pride flag, and then on the 29th, we went to pick up our bees!

On the night that they arrived, it rained fairly intensely, and hearing this, Alain and I ran to the back porch to check on them, like worried parents.

They were okay.

This brings me one step closer to my dream of being the undisputed king of the hipsters by walking up and down the Plateau wearing an ironic beard of bees.

Ten Thousand Babies

Ten Thousand Babies

We now have ten thousand babies

This is a lot of bees. They came on 5 wooden “frames” with a sort of waxy backing that’s reinforced with wire, on which the bees make their honeycomb and fill it with wax or pollen or eggs. We do have a friend who knows what he’s doing, and with his help, we transferred the 5 frames into a much bigger 8-frame box.

To do so, we had to pick up each frame by hand and slowly transfer it over. You’d think that the bees would start getting stabby at that point, but they really didn’t care. At all. Honeybees are super-chill. I had probably a couple dozen bees going over my bare hands while moving them over to their new home, and none of us got stung. Alain moved the frame that had the queen on it.



Our neighbour was in the back yard that morning. She almost certainly saw the giant swarm of bees while we were moving them from one box to another. No comment yet. There, of course, is no longer a giant swarm. The picture attached above makes it seem like there’s thousands of bees flying around everywhere, but they were just excited in that picture because they were still moving over from their old box to the new one.

Unless you’re actively looking for bees in our back yard, you’d never know that there’s an apiary with 10-80 k bees in it right there. There’s always a few at the entrance, but you can stand even a metre away and bee totally unaware that our little ladies are there, doing their thing.

We're so cute!

Two Queens Honey!

Among the problems I never thought I’d have, “too much honey” used to bee one of them

By the way, get used to the “bee” puns. They’re going to bee awful. I will also point them all out and explain the jokes as we go along. Puns are the highest form of humour after all, and jokes are better when you explain them.

We might have as much as 23 kg of honey from this season, and so we’ve decided to sell it along with the wax. We’re calling our product “Two Queens Honey.” (That one is a gay joke, and also a bee pun!) The flavour of honey is determined by the plants that the bees feed on, so I wanted to take up our lawn and put in nothing but hot peppers, just to see if we could get honey with a bit of a … sting.

My idea was vetoed. Alas.

Honestly, I’m amazed that this idea wasn’t shot down earlier. To quote Alain,”I never would have done this if we weren’t together,” or as my ex-wife put it, “This is another reason why you and Alain are a much better match.”

We are planning on taking a beer-brewing course later in the summer, so there may be Two Queens Honeybeers coming. More on this story as it develops.


    title = {This is the best ever!},
    journaltitle = {The Grey Literature},
    author = {Benjamin Gregory Carlisle},
    address = {Montreal, Canada},
    date = 2016-06-4,
    url = {}


Carlisle, Benjamin Gregory. "This is the best ever!" Web blog post. The Grey Literature. 04 Jun 2016. Web. 28 Jun 2017. <>


Carlisle, Benjamin Gregory. (2016, Jun 04). This is the best ever! [Web log post]. Retrieved from


A word from our sponsors

Tag bag

Recent comments

Old posts

All content © Benjamin Carlisle