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
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/base/jquery-ui.css" type="text/css" media="all" /> | |
<link rel="stylesheet" href="http://static.jquery.com/ui/css/demo-docs-theme/ui.theme.css" type="text/css" media="all" /> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script> | |
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js" type="text/javascript"></script> | |
<script src="http://jquery-ui.googlecode.com/svn/tags/latest/external/jquery.bgiframe-2.1.2.js" type="text/javascript"></script> | |
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/i18n/jquery-ui-i18n.min.js" type="text/javascript"></script> | |
<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
def observe(self, observation, gameState): | |
""" | |
Updates beliefs based on the distance observation and Pacman's position. | |
The noisyDistance is the estimated manhattan distance to the ghost you are tracking. | |
The emissionModel below stores the probability of the noisyDistance for any true | |
distance you supply. That is, it stores P(noisyDistance | TrueDistance). | |
self.legalPositions is a list of the possible ghost positions (you |
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 |
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
<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> | |
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
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
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
#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
<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> |
OlderNewer