This file contains hidden or 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
# Takes a list of lists 'l' and returns a flattened list of the elements and subelements of l | |
def flatten(l): | |
return reduce(lambda x,y:x+y,l) |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"github.com/PuerkitoBio/goquery" | |
"strings" | |
) | |
func crawl (url string) { | |
doc, err := goquery.NewDocument(url) |
This file contains hidden or 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
" If you prefer the Omni-Completion tip window to close when a selection is | |
" " made, these lines close it on movement in insert mode or when leaving | |
" " insert mode | |
autocmd CursorMovedI * if pumvisible() == 0|pclose|endif | |
autocmd InsertLeave * if pumvisible() == 0|pclose|endif |
This file contains hidden or 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
# Configuration file for the audio service | |
# This section contains options which are not specific to any | |
# particular interface | |
[General] | |
Disable=Socket | |
# Switch to master role for incoming connections (defaults to true) | |
#Master=true |
This file contains hidden or 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.concurrent.*; | |
import java.util.*; | |
public final class MLFQueue { | |
private int MAX_NUM_OF_PROCESSES = 20; | |
private int queue1Quantum = 8, queue2Quantum = 16, contextSwitchTime=2; | |
private int lastProcessQueue; | |
private Object[] queues = new Object[3]; |
This file contains hidden or 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.ArrayList; | |
import java.util.Arrays; | |
import java.lang.Math; | |
class Process | |
{ | |
public static final boolean CPU_BURST=true, IO_BURST=false; |
This file contains hidden or 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
execute pathogen#infect() | |
:set expandtab | |
:set tabstop=2 | |
:set shiftwidth=2 | |
:set autoindent | |
:set smartindent | |
:set ruler | |
:set mouse=a | |
:set number |
This file contains hidden or 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
#Ctrl-a instead of Ctrl-b | |
unbind C-b | |
set -g prefix C-a | |
#Ctrl-a takes you back to your last window | |
bind-key C-a last-window | |
#load man page | |
bind-key ? command-prompt "split-window -h 'exec man %%'" |
This file contains hidden or 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 <stdlib.h> | |
#include <conio.h> | |
void loadFile(); | |
void processFile(int); | |
char txtfile[512]; | |
int recordsize=22; | |
char id[9]; |
This file contains hidden or 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
//Array of cards to display in the game | |
var cards = ["0", "A", "2", "3", "4", "5", "6", "7", "8", "9", "J", "Q", "K", "♥", "♠", "♦", "♣"]; | |
//Max of 24 attempts (48 clicks) | |
var tries = 48; | |
//Attempt counter | |
var attempts = 0; | |
var pairsLeft = 8; | |
var section = document.getElementsByTagName('section')[0]; | |
var canvas = document.getElementsByTagName('canvas')[0]; | |
var a = canvas.getContext('2d'); |
NewerOlder