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
IEnumerator SpawnArrows() | |
{ | |
yield return new WaitForSeconds(startWait); | |
while (true) | |
{ | |
for (int i = 0; i < arrowCount; i++) { | |
if (!isStunned) { | |
// is archer facing right? | |
bool facingRight = ((int) _transform.rotation.eulerAngles.y) == 0; | |
// calculate origin of arrow (0.5 pixels to left or right of archer) |
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
using UnityEngine; | |
using System.Collections; | |
public class GameController : MonoBehaviour | |
{ | |
public GameObject hazard; | |
public Vector3 spawnValues; | |
public int hazardCount; | |
public float spawnWait; | |
public float startWait; |
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
// PHP 5 | |
$m = new MongoClient(); | |
$db = $m->test; | |
$collection = $db->todos; | |
$collection->update( | |
array("_id" => new MongoId($id)), | |
array('$set' => | |
array("title" => "MongoDB Tutorial") | |
) | |
); |
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
dependencies { | |
compile ('org.hibernate:hibernate:3.1.3') { | |
exclude group: "commons-logging", module: "commons-logging" | |
} | |
compile ('org.springframework:spring-context-support:3.2.16.RELEASE') { | |
exclude group: "commons-logging", module: "commons-logging" | |
} | |
providedCompile 'javax.servlet:javax.servlet-api:3.1.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
Unable to compile class for JSP: | |
An error occurred at line: [60] in the generated java file: [/var/www/tomcat/8021-kauairpt/work/Catalina/localhost/kauairpt/org/apache/jsp/index_jsp.java] | |
The method getDispatcherType() is undefined for the type HttpServletRequest |
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
# Apache Tomcat 8 | |
sudo apt-get install tomcat8 | |
# Oracle Java JRE 8 | |
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" >> /etc/apt/sources.list | |
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" >> /etc/apt/sources.list | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886 |
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
$(document).ready( | |
$('p.error').each(function() { | |
var text = $(this).text(); | |
if (text.toLowerCase().indexOf("date field must be between") >= 0) { | |
$(this).empty(); | |
$(this).text('The birth date must be prior to January 18, 1995.'); | |
} | |
}); | |
); |
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
import org.springframework.web.servlet.mvc.SimpleFormController; | |
public class BillController extends SimpleFormController { | |
private BillService billService; | |
public BillController() { | |
setValidator(new BillValidator()); | |
} |
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
for (SomeListener listener : listeners) { | |
try { | |
listener.update(someEvent); | |
} | |
catch (Exception e) { | |
// Log error. | |
} | |
} |
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
SomeObject obj = new SomeObject(); | |
// perform some changes | |
assertEquals(4, obj.getStrings().size()); | |
assertTrue(obj.getStrings().contains("hello")); | |
assertTrue(obj.getStrings().contains("world")); | |
assertTrue(obj.getStrings().contains("foo")); | |
assertTrue(obj.getStrings().contains("bar")); |