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
/* Custom download system */ | |
.stdl-page-sum-wrapper { | |
display: block; | |
clear: both; | |
width: 90%; | |
margin: 0 auto; | |
} | |
.stdl-page-sum-element { | |
display: block; | |
float: 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
<span>DESCRIBE-YOUR-ITEM</span> | |
<a href="LINK-TO_YOUR_ITEM" title="Corresponding article or portfolio"> | |
DESCRIBE-YOUR-ITEM | |
</a> |
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
%First create a small function that | |
function [ l ] = ij2l( i, j, n ) | |
%IJ2L Upper Triangle Matrix Coordinates to Single Row Index | |
l = j; | |
for k=1:(i-1) | |
l = l + (n-k); | |
end | |
end |
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
%% Testing th ij2l function | |
%% Let the upper trinagle matrix be | |
% | |
% | 1 2 3 | | |
% A = | 4 5 | | |
% | 6 | | |
% | |
% We want to index the second row, last element: | |
% |
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
void interrupt isr(void) { | |
// Check the USART transmit flag then the receive flag | |
if (TXIF) { | |
... | |
} else if (RCIF) { | |
// The control never reaches this branch! | |
... | |
} | |
} |
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
void interrupt isr(void) { | |
// A very happy ISR | |
if (TXIE && TXIF) { | |
... | |
} else if (RCIE && RCIF) { | |
... | |
} | |
} |
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 boolean findClosestEnemy() { | |
if (enemyList.isEmpty()) { | |
targetEnemy = null; | |
System.out.println("Target enemy NOT found!"); | |
return false; | |
} | |
if (enemyList.size() == 1) { | |
targetEnemy = enemyList.get(0); | |
// System.out.println("Target enemy found!"); | |
return true; |
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
... | |
if (autoAim) { | |
findClosestEnemy(); | |
if (targetEnemy != null) { | |
player.setTargetPosition(targetCircle()); | |
} | |
} else { | |
if (input.isKeyDown(Input.KEY_T)) { | |
player.turnLeft(delta); |
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
public static float calculateAngleForTwoPoints(Circle base, Circle target) { | |
float px = base.getCenterX(); | |
float py = base.getCenterY(); | |
float ex = target.getCenterX(); | |
float ey = target.getCenterY(); | |
float angle = 0; |
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
... | |
if (autoAim) { | |
// determine the rotation direction | |
float base = image.getRotation(); | |
float d1 = calculateDistance(base, targetAngle); | |
float d2 = calculateDistance(base-1.0f, targetAngle); | |
// if the distance is greater than about 3 degree | |
if (d1 > 0.05f) { |
OlderNewer