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
# Last modified November 15, 2011 | |
# Returns the oral description of a set of numbers | |
def oralDescription(string): | |
firstchar = string[0] | |
for i in range(0, len(string), 2): | |
print "There are", string[i], "of", string[i+1] | |
oralDescription("112111") |
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
# valueIterationAgents.py | |
# ----------------------- | |
# Licensing Information: Please do not distribute or publish solutions to this | |
# project. You are free to use and extend these projects for educational | |
# purposes. The Pacman AI projects were developed at UC Berkeley, primarily by | |
# John DeNero (denero@cs.berkeley.edu) and Dan Klein (klein@cs.berkeley.edu). | |
# For more info, see http://inst.eecs.berkeley.edu/~cs188/sp09/pacman.html | |
import mdp, util |
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
<script> | |
//reset type=date inputs to text | |
$( document ).bind( "mobileinit", function(){ | |
$.mobile.page.prototype.options.degradeInputs.date = true; | |
}); | |
</script> | |
<link rel="stylesheet" href="datepicker/jquery.ui.datepicker.mobile.css" /> | |
<script src="datepicker/jQuery.ui.datepicker.js"></script> | |
<script src="datepicker/jquery.ui.datepicker.mobile.js"></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
#example1 { | |
-moz-border-radius: 15px; | |
border-radius: 15px; | |
} | |
#example1 { | |
border-radius: 5px 10px 5px 10px / 10px 5px 10px 5px; | |
} | |
#example1 { |
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
function updateOrientation() { | |
var contentType = "show_"; | |
switch(window.orientation){ | |
case 0: | |
contentType += "normal"; | |
break; | |
case -90: | |
contentType += "right"; | |
break; |
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
win.addEventListener('focus', function(e) { | |
Titanium.Media.showCamera({ | |
success:function(event) | |
{ | |
var cropRect = event.cropRect; | |
var image = event.media; | |
var data_to_send = { | |
"file": event.media, | |
"name": 'camera_photo.png' |
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
<script> | |
if (!localStorage.pageCounter) { localStorage.setItem('pageCounter',0); } | |
localStorage.setItem('pageCounter',parseInt(localStorage.pageCounter)+1); | |
document.write(localStorage.pageCounter); | |
</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
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> | |
<article> | |
<p>Finding your location: <span id="status">checking...</span></p> | |
</article> | |
<script> | |
function success(position) { | |
var s = document.querySelector('#status'); | |
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
<script> | |
function success(position) { | |
alert(position.coords.latitude); | |
alert(position.coords.longitude); | |
} | |
function error(msg) { | |
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
# Add this to the chooseAction in bustersAgent | |
pacmanPosition = gameState.getPacmanPosition() | |
legal = [a for a in gameState.getLegalPacmanActions()] | |
livingGhosts = gameState.getLivingGhosts() | |
livingGhostPositionDistributions = [beliefs for i,beliefs | |
in enumerate(self.ghostBeliefs) | |
if livingGhosts[i+1]] | |
likelyghostPosition = max(livingGhostPositionDistributions[0].iteritems(), key=operator.itemgetter(1))[0] | |
minDist = 999 |