Skip to content

Instantly share code, notes, and snippets.

/************************************************
*WordCloud methods below are modifications of wordcloud by yoah.bardavid@gmail.com and razbarvaz@gmail.com
*wordcloud is part of the following project: http://visapi-gadgets.googlecode.com
*The visapi-gadgets project is licensed under Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*Modifications include:
* inclusion of a some sort of a log scale
* exclusion of single letter words
* exclusion of excludedTerms
* exclusion of numbers
* attempt to merge plural and singular
CmdUtils.CreateCommand({
name: "mail",
takes: {"message": noun_arb_text},
icon: "chrome://ubiquity/content/icons/email.png",
modifiers: {to: noun_type_contact},
description: "Begins composing an email to a person from your contact list.",
help: "Currently works with the mail client you have set as your default application to handle mailto: links. Try selecting part of a web page (note: images, and other dynamic elements will not be included) and then issuing "mail this". You can also specify the recipient of the email using the word "to" and the name of someone from your contact list or address book. For example, try issuing "mail hello to jono" (assuming you have a friend named "jono").",
preview: function(pblock, directObj, modifiers) {
var html = "Creates an email message ";
if (modifiers.to) {
int[] e12 = {10, 12, 15, 18, 22, 27, 33, 39, 47, 56, 68, 82};
for(int i = 0; i < e12.length(); i++){
for(int j = i; j < e12.length(); j++){
values.add(i, j);
}
}
@Nemo157
Nemo157 / .gitignore
Created August 11, 2010 04:36
Very simple 2 pass assembler for the University of Canterbury 2010 ENEL353 assembly language. Currently only supports labels and pure assembly.
*.elf
@Nemo157
Nemo157 / Makefile
Created August 19, 2010 23:43
A simple Makefile for LaTeX projects.
# Author:
# Wim Looman
# Copyright:
# Copyright (c) 2010 Wim Looman
# License:
# GNU General Public License (see http://www.gnu.org/licenses/gpl-3.0.txt)
## User interface, just set the main filename and it will do everything for you
# If you have any extra code or images included list them in EXTRA_FILES
# This should work as long as you have all the .tex, .sty and .bib files in
@Nemo157
Nemo157 / gist:657765
Created November 1, 2010 07:14
WIAB ant output
nemo157@files3 wave-devel/wave-protocol
â ant
Buildfile: build.xml
init:
[mkdir] Created dir: /home/nemo157/wave-devel/wave-protocol/build/core
[mkdir] Created dir: /home/nemo157/wave-devel/wave-protocol/build/test
[mkdir] Created dir: /home/nemo157/wave-devel/wave-protocol/build/instr
[mkdir] Created dir: /home/nemo157/wave-devel/wave-protocol/build/staging
[mkdir] Created dir: /home/nemo157/wave-devel/wave-protocol/build/testoutput
@Nemo157
Nemo157 / Benchmark.cs
Created November 15, 2010 21:51
A simple microbenchmarking file.
// The MIT License
//
// Copyright (c) 2008 Jon Skeet
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@Nemo157
Nemo157 / extensions.cs
Created November 17, 2010 00:23
Converts integers to ordinal strings.
public static class MyExtensions
{
public static String ToOrdinalString(this Int32 num)
{
switch (num % 100)
{
case 11:
case 12:
case 13:
return num.ToString() + "th";
- class:
name: Enum;DefinitionType
properties:
- Unknown
- OidValueAssignment
- Scalar
- Table
- Entry
- Column
#!/usr/bin/env ruby
# see http://timeless.judofyr.net/tailin-ruby for what the define_singleton_method's are about
define_singleton_method(:find_nth_largest_tco) do |a, b, n, low, high|
if (high < low)
return nil
end
mid = low + (high - low) / 2
k = mid + binary_search(b, a[mid]) + 1