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
enquire.register("screen and (max-width:803px)",{ | |
match: function(){ | |
//code to do when the media query matches | |
}, | |
unmatch: function(){ | |
//code do do when the media query does not match | |
} | |
}); |
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
private void CreateButtons() | |
{ | |
int y = 50;//y-hnit takkans | |
int x = 0;//x-hnit takkans | |
int width = 35;//Breidd takkans | |
int height = 35;//Hæð takkans | |
int xMargin = 3;//x - Margin takkans | |
int yMargin = 3;//y - Margin takkans |
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
/** | |
* Circular Tooltip (SO) | |
* http://stackoverflow.com/q/13132864/1397351 | |
*/ | |
* { margin: 0; padding: 0; } | |
body { | |
overflow: hidden; | |
background: url(http://theearlcarlson.com/experiments/amTooltip/img/bg.jpg); | |
} | |
/* generic styles for button & circular menu */ |
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/python | |
# Head ends here | |
def displayPathtoPrincess(n,grid): | |
#Find where you are, and where the princess is | |
princessX, princessY = findInArray('p',n,grid) | |
princeX, princeY = findInArray('m',n,grid) | |
if princessY > princeY: | |
print '\n'.join(["DOWN"] * (princessY-princeY)) | |
elif princeY > princessY: |
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/python | |
# Head ends here | |
def nextMove(n,y,x,grid): | |
princessX, princessY = findInArray('p',n,grid) | |
if princessY > y: | |
return "DOWN" | |
elif y > princessY: | |
return "UP" | |
if x > princessX: | |
return "LEFT" |
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/python | |
dirts = [] | |
finished = False | |
selected = -1 | |
def find_all_dirts(board): | |
global dirts | |
n = len(board) | |
m = len(board[0]) | |
for x in range(n): |
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/python | |
# Head ends here | |
dirts = [] | |
unfound = [] | |
full_board = None | |
selected = None | |
def update_board(board): | |
global full_board, unfound, dirts, update_count | |
if full_board == None: |
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
complement_memo = {} | |
def complement(ar): | |
a, b = ar | |
total = 0 | |
for i in xrange(a,b+1): | |
if not i in complement_memo: | |
complement_memo[i] = count(i) | |
total += complement_memo[i] | |
print total |
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 <cmath> | |
#include <cstdio> | |
#include <vector> | |
#include <iostream> | |
#include <algorithm> | |
#include <map> | |
using namespace std; | |
int count(unsigned int u) | |
{ | |
unsigned int uCount; |
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/python | |
#class Node: | |
# def __init__(self,point,parent=None): | |
# self.point = point | |
# self.parent = parent | |
# Head ends here | |
explored = [] | |
def nextMove( x, y, pacman_x, pacman_y, food_x, food_y, grid): |
OlderNewer