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
/** | |
* Test for correct heading attribution based on textual contents and style name | |
* <p><em>Note:</em> Formatting is not tested here since mocking would add quite a bit of bloat.</p> | |
*/ | |
@Test | |
@DomainSpecific | |
public void testHeading() { | |
// Step 0: Setup fixture | |
final class TestDatum { | |
public final String text; |
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 sums up the number of pages of all pdfs in a given directory | |
counter=0 | |
hash pdfinfo 2>/dev/null || { echo >&2 "pdfinfo is required, but not installed. Aborting."; exit 1; } | |
if [ -n "$1" ]; then dir=$1; else dir="."; fi | |
for file in $dir/*.pdf; do | |
currentcount=$(pdfinfo "$file" | sed -n 's/^Pages:\s*\([0-9]\+\)/\1/p') |
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 python | |
# you will need http://github3py.readthedocs.org/en/latest/#installation | |
# I'm not sure if this works on Windows due to the use of strptime() | |
from github3 import login | |
import datetime | |
import json | |
# Amend the following two lines as necessary |
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
all=`awk '{s+=$1} END {print s}' <(find subset-026/ -type f -exec xmlstarlet sel -t -v 'count(//Function)' {} \;)` | |
boolean=`awk '{s+=$1} END {print s}' <(find subset-026/ -type f -exec xmlstarlet sel -t -v 'count(//Function[@Type="Boolean"])' {} \;)` | |
echo "$boolean / $all" | bc -l |
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
#include <stdio.h> | |
#include <stdbool.h> | |
bool f(char achar) { | |
switch (achar) | |
{ | |
case 'q': | |
return true; | |
break; | |
case 'w': |