This file contains 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
extern mod extra; | |
use extra::future::Future; | |
use std::num; | |
/** | |
* Speculatively execute consumer using the guessed value. | |
*/ | |
pub fn spec<A: Eq + Send, B>(producer: ~fn() -> A, | |
predictor: ~fn() -> A, |
This file contains 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
extern mod cssparser; | |
extern mod extra; | |
extern mod servo_style; | |
use std::io::file_reader; | |
use std::cell::Cell; | |
use std::task; | |
use cssparser::*; | |
use extra::time::precise_time_ns; |
This file contains 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
(defvar systems '((usg-unix-v "UNIX" "good") | |
;; `string-equal' converts symbols to string automagically | |
((lambda (sys) (string-equal "gnu/linux" sys)) "UNIX" "good") | |
("^windows" "Windows" "bad") | |
(darwin "Mac OS" "far superior"))) | |
(defun assoc-match (key alist) | |
"Return non-nil if KEY matches the `car' of an element of ALIST. | |
The `car' of each element of ALIST can be a: |
This file contains 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
# Adapted from rkj | |
PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} | |
%{\e[0;34m%}%B└─%B[%{\e[1;35m%}%(!.#.$)%{\e[0;34m%}%B]%{\e[0m%}%b ' |
This file contains 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
# Comment while saved under plain-text mode. | |
# Made entirely from within the web interface | |
# Commit 2. Edited from within Emacs | |
# Commit 3. Made from web interface, setting language to shell | |
# Commit 4. Now another edit in emacs. Only added this line of text and saved. |
This file contains 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
#!/bin/bash | |
# This program is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU General Public License as | |
# published by the Free Software Foundation; either version 3, or (at | |
# your option) any later version. | |
# This program is distributed in the hope that it will be useful, but | |
# WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
This file contains 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
##' Select spectra based on the path of their associated raw file. | |
RAW_FILE_NAME_QUERY_TEMPLATE <- 'SELECT raw_file_path, | |
run_index, spectra.start_time, array_length, mz_array, intensity_array, | |
polarity, total_ion_current, lowest_observed_mz, highest_observed_mz | |
FROM runs LEFT JOIN spectra ON spectra.run_id = runs.id | |
WHERE runs.raw_file_path = \'%s\' AND ms_level = %d | |
%s /* Will be filled with TIME_RANGE_QUERY_TEMPLATE */ | |
ORDER BY spectra.start_time ASC' |
This file contains 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
## Reverse the order of the arguments. | |
foo <- function(iterVar, quux) { | |
UseMethod("foo", object=quux) | |
} | |
## Need to be reversed in the implementation as well | |
foo.myClass <- function(iterVar, quux) { | |
## `paste()` combines its arguments into a single string. | |
paste("within foo.myClass. quux:", quux, "iterVar:", iterVar) | |
} |
This file contains 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
#!/usr/bin/env Rscript | |
##' Generate a Selected Ion Chromatogram (SIC) from a run in a database. | |
##' | |
##' Retrieves spectra from a MySQL database and generates an SIC using the | |
##' specified parameters. Database connection information *must* be passed in | |
##' using the following environment variables: | |
##' | |
##' - MZDB_HOST: Computer on which the database is running. | |
##' - MZDB_USER: Username for authentication. |
This file contains 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
;; Display all the monospace fonts available to Emacs in a dedicated buffer | |
(defun font-is-mono-p (font-family) | |
;; with-selected-window | |
(let ((wind (selected-window)) | |
m-width l-width) | |
(with-temp-buffer | |
(set-window-buffer (selected-window) (current-buffer)) | |
(text-scale-set 4) | |
(insert (propertize "l l l l l" 'face `((:family ,font-family)))) |
NewerOlder