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
require 'graphql' | |
require 'json' | |
require 'sinatra' | |
books = [ | |
{id: 0, title: "A year at the wall", year: 2018, author: 0, themes:["mountains", "swords", "walkers"]}, | |
{id: 1, title: "From basterd to king of the north", year: 2017, author: 0, themes: ["war", "king"]}, | |
{id: 2, title: "Me and my dragons", year: 2017, author: 1, themes: ["dragons"]}, | |
{id: 3, title: "I drink and I know things", year: 2017, author: 3, themes: ["rhum", "wine"]}, | |
{id: 4, title: "How to get hated by the whole world", year: 2015, author: 4, themes: ["war", "king"]} |
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
before_script: | |
- sudo add-apt-repository ppa:ubuntu-wine/ppa -y | |
- sudo apt-get update -qq | |
- sudo apt-get install wine1.6 xvfb | |
- sudo Xvfb :1 & | |
- export DISPLAY=":1.0" | |
- export WINEDEBUG="fixme-all" | |
- wine --version | |
script: |
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/sh | |
CRATE_NAME="$1" | |
MASTER_DOC_ONLY="$2" | |
PUBLISH_CRATE="no" | |
PUBLISH_DOC="no" | |
if [ -z "$CRATE_NAME" ]; then | |
echo "Please provide crate name as first argument" | |
exit 1 | |
fi |
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
import java.io.IOException; | |
import java.util.Vector; | |
/** | |
* Utility class to print pretty tables in a console | |
*/ | |
public class TabPrinter { | |
private int num_col = 0; | |
private String[] titles = null; |
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
import java.util.Random; | |
import java.util.concurrent.Semaphore; | |
/** | |
* A 2 level priority queue (Normal and VIP priority). | |
* Any VIP element will be queued with other VIP element, and will | |
* be available in priority. Picking an element can be blocking if needed. | |
* @author Pierre-Henri Symoneaux | |
* | |
* @param <E> Type of the objects to store |
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
/* | |
* Author : Pierre-Henri Symoneaux | |
*/ | |
#include <stdlib.h> | |
#include <string.h> | |
//Hashtable element structure | |
typedef struct hash_elem_t { | |
struct hash_elem_t* next; // Next element in case of a collision |