Skip to content

Instantly share code, notes, and snippets.

ón __todhchaí__ impórtaigh roinnt
/**
* As described in 'updates' in the nodes
*/
void CHART::do_cell(int i, int k) {
Rule r;
Category A, B, C;
int A_included, B_included;
array2string(a : ARRAY[G]) : STRING is
local
k : INTEGER
do
Result := "<< "
from
k := a.lower
until
k = a.upper
loop
#!/usr/bin/env ruby
def y(n)
case n
when 0 then 1
when 1 then 0
when 2 then -4
when 3 then 0
else y(n - 4)
end
public static int[] countLetters(String input) {
int[] results = new int[26];
for (int i = 0; i < input.length(); i++) {
int cur = input.toLowerCase().charAt(i);
if (cur >= 'a' && cur <= 'z') {results[cur - 'a']++;}
}
return results;
}
bool has_left_recursion(Grammar g) {
for (vector<Rule>::iterator i = g.rules.begin(); i != g.rules.end(); ++i) {
if (i->mother == i->dtrs.front()) return true;
}
return false;
}
#!/usr/bin/env ruby
puts ARGV.map {|x| x += '@tcd.ie'}.join(', ')