The Atom Editor

 
Being new to the Windows platform, I’m on the look for a good text editor that can do the myriad of tasks that we do each day.  Notepad is not an option, let’s be real.  I’m looking for something that can be extended and has been designed from the bottom up for wrangling text and writing code.  Ultimately, I would like something that is amenable to teaching both R and Python using a single interface.  RStudio is great for R but sucks for Python.  Juypter notebooks are clunky and toy-like.
 
Atom is created by the Github folks and is integrated into ‘the mothership’ repository.  Here is what I did to get it up and running and having Python running correctly.
 
Packages
 
Packages are extensions to the main editor that accomplish some function to make you life a bit easier.  Here are some of the ones I find helpful.   You can find packages and install them using Settings -> Install.  Then search for the packages and hit the install button.  
 
Minimap
 
If you have scripts and/or code that is longer than a single page (and who doesn’t) minimap provides a graphical depiction of your code on the right-hand side of the window to allow you to easily jump up and down the file.  Here is an example on an R script.
 
 
Script
 
Script is a package that runs code in the editor directly.  This means you can run individual lines as you develop and look at the output.  Very helpful.
 
Themes
 
There are a ton of themes, both overall for the editor as well as syntax highlighting, available.  To install one, select Install -> Theme and type a name from Settings.  Here is the atom-material-syntax being installed.
 
 
Once installed, you can change both the UI and the syntax colors.
 
 
 
As I expand more into using Atom, I’ll add additional posts showing how I have configured it for use in my daily coding activities.
 
 
 

Rice Center Presentations

Some awesome presentations by lab members at today’s research symposium.

Bonnie Roderique speaking about the James Spinymussel.

Matt DeSaix presenting work on migration connectivity in Prothonotary warblers.

Jane Remfert & Wyatt Carpenter discussing the Carver Community Project

Dr. Gary Machlis

Today, we had the first event in the Global Environment Speaker Series hosted by the VCU Center for Environmental Studies and the Departments of Geography & the Environment and Environmental Studies from the University of Richmond—a set of units that already has a lot of collaborations among faculty, curricula, and students.

We invited Dr. Gary Machlis to come and speak on his new book entitled, “Conservation in America: A char for rough waters

It was a great talk and the poster session.   We have to incorporate more inter-unit dialog and collaboration.  

Syndication Between WP Sites

Syndication is a process whereby you can post something to your site and other locations will detect that you have posted something and then pull in the content to their site, making it look like you wrote it and posted it on their site.  Is that clear?  Here is my use-case:

  1. I post everything I do to rodneydyer.com.
  2. For things that I want to be shown on my work page (https://dyerlab.org), I select a particular Category or Tag for the post.
  3. My work site monitors and any time something at rodneydyer.com comes up with the key Category and/or Tag, dyerlab.org pulls the content of the post in and formats it to look just like I wrote it for that site.

This is particularly interesting for teaching and other uses.  If a class uses WordPress for its webpage, students can provide content for that class page by publishing on their own site.  This allows each student to create a "Digital Portfolio" of work that they maintain (see my thing on Content Silos for more on this).

FeedWordPress Plugin

I'm going to use the FeedWordPress Plugin for this because it was the one that my university uses and I want to standardize the approaches.

To install it, go to Plugins->Add New and search for it.  Install & Activate  .I'm going to use a new Category, named Dyerlab, to trigger the syndication.  So I add a new one.

A new top-level category to handle the syndication.

Configuration

OK, now on my personal page, I have a category "Dyerlab" that I will attach to things that I want to show up on my Dyerlab WordPress site.  To make the connection, we need to get the category feed address.  Unless you are changing something drastic it has the following structure:

https://yoursiteurl/category/categoryname

which in my case is:

https://rodneydyer.com/category/Dyerlab/

You can try it out and you should see (if you have any posts with that category published) a list of just those posts.  If so, perfect.  If not, then you either have not posted anything with that category or you have not set up the category correctly.  Go back and check.

Now, I need to set up the other site, in this case my laboratory site, to monitor my personal site, and any time something is posted, grab it.  Go open your other site and make sure the plugin is installed.  This site will "Pull" the posts from the original site.  Click on Syndication in the bottom left panel and you will open the settings page.  

The syndication settings page.

In the "New Source" box, paste in the category address from your other site.  In my case I pasted in

https://rodneydyer.com/category/dyerlab.

You will be taken to a verification screen where you can verify that things are working properly and select the correct feed type.  There is a 'verify' link that you can use to make sure it is providing good input.  After you select which kind of feed you want, you will be redirected back to the list, as above, but with your new feed in it.

Success

Now, when I write something (like this post) on my site, it will automagically show up on my laboratory site as well. The Cool thing is that wherever it is displayed, it is reformatted to look as if it belonged at that location.  Here is this post on my personal site.

and on my laboratory site

are identical in content, though are individually styles.  Pretty cool!

Featured image bytes amattox mattox (CC BY-NC 2.0).

Syndication

Syndication is a process whereby you can post something to your site and other locations will detect that you have posted something and then pull in the content to their site, making it look like you wrote it and posted it on their site.  Is that clear?  Here is my use-case:

  1. I post everything I do to rodneydyer.com.
  2. For things that I want to be shown on my work page (https://dyerlab.org), I select a particular Category or Tag for the post.
  3. My work site monitors and any time something at rodneydyer.com comes up with the key Category and/or Tag, dyerlab.org pulls the content of the post in and formats it to look just like I wrote it for that site.

This is particularly interesting for teaching and other uses.  If a class uses WordPress for its webpage, students can provide content for that class page by publishing on their own site.  This allows each student to create a "Digital Portfolio" of work that they maintain (see my thing on Content Silos for more on this).

FeedWordPress Plugin

I'm going to use the FeedWordPress Plugin for this because it was the one that my university uses and I want to standardize the approaches.

To install it, go to Plugins->Add New and search for it.  Install & Activate  .I'm going to use a new Category, named Dyerlab, to trigger the syndication.  So I add a new one.

A new top-level category to handle the syndication.

OK, now on my personal page, I have a category "Dyerlab" that I will attach to things that I want to show up on my Dyerlab WordPress site.  To make the connection, we need to get the category feed address.  Unless you are changing something drastic it has the following structure:

[crayon-5b2b595d106cf715331652/]

which in my case is:

[crayon-5b2b595d106dc536825008/]

You can try it out and you should see (if you have any posts with that category published) a list of just those posts.  If so, perfect.  If not, then you either have not posted anything with that category or you have not set up the category correctly.  Go back and check.

Now, I need to set up the other site, in this case my laboratory site, to monitor my personal site, and any time something is posted, grab it.  Go open your other site and make sure the plugin is installed.  This site will "Pull" the posts from the original site.  Click on Syndication in the bottom left panel and you will open the settings page.  

The syndication settings page.

In the "New Source" box, paste in the category address from your other site.  In my case I pasted in

[crayon-5b2b595d106df346760778/]

You will be taken to a verification screen where you can verify that things are working properly and select the correct feed type.  There is a 'verify' link that you can use to make sure it is providing good input.  After you select which kind of feed you want, you will be redirected back to the list, as above, but with your new feed in it.

Now, when I write something (like this post) on my site, it will automagically show up on my laboratory site as well.

Featured image bytes amattox mattox (CC BY-NC 2.0).

Capturing contents within Curly Brackets

OK, just a quickie here. I’m working with a colleague on a manuscript using LaTeX.  The citation formatting for the journal we are looking at uses the numerical citations but bibtex will number the citations by the order in which the \bibitem  values they occur in the bibliography section.  So, it would be great to get them to be in the order in which they occur in the text.

So, our old friend (and sometimes enemy) grep comes to the rescue.  Here is a quick one-liner that allows you to search the text for all the \cite{}  entries and return only the contents within the curly brackets.

Once all the editing is done and we’ve finished on the main body of the text, we can reorder the bibliography section and the numbers will be incremental.

Sometimes I forget how awesome and powerful the unix underpinnings are.

ggproblems

OK, so there is a bit of a circular firing squad going on in some of my R installs with ggplot2.  Apparently, you can get various CRAN/Github versions out of sync and a whole host of different.  Here is how it started:

Read more