Recognize that languages have goals and communities. It helps to evaluate them in that context. Features that are high priority to you may not be high priority to the majority of users in that language.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "bufio" | |
| "fmt" | |
| "log" | |
| "os" | |
| ) | |
| func main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "awesome_print" | |
| module XmlParsing | |
| require "ox" | |
| class Reader < ::Ox::Sax | |
| def initialize file_path, target, target_handler | |
| @target_handler = target_handler | |
| @target = target | |
| @file_path = file_path |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8" ?> | |
| <Data> | |
| <Series> | |
| <id>83462</id> | |
| <Actors>|Nathan Fillion|Stana Katic|Molly C. Quinn|Jon Huertas|Seamus Dever|Tamala Jones|Susan Sullivan|Ruben Santiago-Hudson|Monet Mazur|</Actors> | |
| <Airs_DayOfWeek>Monday</Airs_DayOfWeek> | |
| <Airs_Time>10:00 PM</Airs_Time> | |
| <ContentRating>TV-PG</ContentRating> | |
| <FirstAired>2009-03-09</FirstAired> | |
| <Genre>|Drama|</Genre> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Create a scatterplot with any species as the data points. | |
| # To choose your species, go here: http://phylopic.org/ , then enter the name of the spp you want. Click on the image and click 'thumbnail', click on the picture, and then copy the link in the address bar of your browser. It should end with 'thumb.png' Paste it in place of the link below. | |
| library(TeachingDemos) | |
| library(png) | |
| # Paste a link to a png of your favourite animal here. This will be an aardvarkplot. Make sure it ends with .thumb.png. | |
| # If it doesn't end with .thumb.png reread the instructions above and try again. | |
| link = "http://phylopic.org/assets/images/submissions/cfee2dca-3767-46b8-8d03-bd8f46e79e9e.thumb.png" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #usage: | |
| #{% loop_directory directory:images iterator:image filter:*.jpg sort:descending %} | |
| # <img src="{{ image }}" /> | |
| #{% endloop_directory %} | |
| module Jekyll | |
| class LoopDirectoryTag < Liquid::Block | |
| include Liquid::StandardFilters | |
| Syntax = /(#{Liquid::QuotedFragment}+)?/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| example.md: example.Rmd | |
| ./knit | |
| example.ipynb: example.md | |
| notedown example.md | sed 's/%%r/%%R/' > example.ipynb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| options(PlosApiKey = "<insert your API key here!>") | |
| #install_github("rplos", "ropensci") | |
| library("rplos") | |
| library("ggplot2") | |
| require("dplyr") | |
| # Convert author strings to counts | |
| countAuths <- function(cell) | |
| length(unlist(strsplit(cell, ";"))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class SomeClass(object): | |
| x = 1 | |
| y = 2 | |
| def __init__(self, z): | |
| self.z = 0 # New attribute created | |
| delattr(self, 'z') # Attribute deleted--throws error if you try to access it | |
| def some_method(self): | |
| self.b = 1 # New attribute created |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| editor.addKeyMap({ | |
| "Tab": function (cm) { | |
| if (cm.somethingSelected()) { | |
| var sel = editor.getSelection("\n"); | |
| // Indent only if there are multiple lines selected, or if the selection spans a full line | |
| if (sel.length > 0 && (sel.indexOf("\n") > -1 || sel.length === cm.getLine(cm.getCursor().line).length)) { | |
| cm.indentSelection("add"); | |
| return; | |
| } | |
| } |