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
player = new Player() | |
player.assignGun (new Ak47()) | |
console.log player.myGun().toStr() | |
class Player | |
constructor: (@name, @lives, @gun) -> | |
@guns = [] | |
@currentGun = null | |
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 void testModifyingRootAndResetingSystem() | |
{ | |
assertEquals(0, getFilesNumberInRepo()); | |
TestRoot root = new TestRoot(); | |
assertEquals(1, getFilesNumberInRepo()); | |
((Persisteble)root).takeSnapshot(); | |
assertEquals(1, getFilesNumberInRepo()); | |
assertEquals("000000000000000000000.snapshot", |
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 void setUp() | |
{ | |
Pat.unload(); | |
removeDatabaseFiles(); | |
world = new World(); | |
library = world.getLibrary(); | |
} | |
public void testLendBookToReader() | |
{ |
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 class ProlongCopy | |
extends IlybraAction | |
{ | |
public ActionForward execute(ActionMapping mapping, | |
ActionForm form, | |
HttpServletRequest request, | |
HttpServletResponse response) | |
{ | |
BookForm bookForm = (BookForm) form; | |
String prolongDate = bookForm.getReturnDate(); |
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
/** @@pat.transaction */ | |
public void prolongCopy(Copy copy, DateRepresentation newReturnDate) | |
{ | |
copy.returnDate = newReturnDate; | |
} | |
public Copy getCopyById(Long id) { | |
return (Copy) copies.get(id); //copies is java.util.Map | |
} |
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
/** @@pat.transaction */ | |
public void removeBook(Book book, DateRepresentation removalDate) | |
{ | |
books.remove(book); | |
removedBooks.put(book.getId(), book); | |
book.setRemovalDate(removalDate); | |
... | |
} |
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
<target name="pat_annotationc" depends="compile"> | |
<taskdef name="annotationc" | |
classname="org.jboss.aop.ant.AnnotationC" classpathref="compile_classpath"/> | |
<annotationc compilerclasspathref="run_classpath" | |
classpathref="run_classpath" | |
bytecode="true"> | |
<src path="src/"/> | |
<include name="**/*.java" /> | |
</annotationc> | |
</target> |
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
<target name="pat_aopc" depends="pat_annotationc"> | |
<taskdef name="aopc" | |
classname="org.jboss.aop.ant.AopC" classpathref="compile_classpath" /> | |
<aopc compilerclasspathref="run_classpath" | |
classpathref="run_classpath" | |
verbose="false"> | |
<classpath path="run_classpath" /> | |
<src path="${build.classes.dir}" /> | |
<aoppath path="${etc.dir}/" /> | |
</aopc> |
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
#example of BAD code duplication among 2 controllers | |
#that could be at least extracted to 1 base controller | |
#and /:show game.name/ should be used | |
class A::Controller | |
before_filter :check_perms | |
def set_points | |
player.set_points params[:points] | |
redirect_to :action => :index | |
end |
OlderNewer