This file contains hidden or 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
| <gui:dataTable | |
| id="${searchTableId}" | |
| draggableColumns="true" | |
| columnDefs="${columnDefinitions}" | |
| controller="search" action="$action" | |
| params="${searchURLParams}" | |
| paginatorConfig="[ | |
| rowsPerPage: 10, | |
| template : '{PreviousPageLink} {PageLinks} {NextPageLink} {CurrentPageReport}', | |
| pageReportTemplate : '{totalRecords} total records' |
This file contains hidden or 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
| btrace { | |
| templates { | |
| // all methods within mydomain classes | |
| methodTimerTemplate { | |
| template = 'btrace-templates\\ManyMethodTimerTemplate.template' | |
| targetClasses { | |
| '/com\\\\.mydomain\\\\..+/' { | |
| targetMethods = [ '/.+/' ] | |
| } | |
| } |
This file contains hidden or 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 java.util.Map; | |
| import static com.sun.btrace.BTraceUtils.*; | |
| import com.sun.btrace.annotations.*; | |
| @BTrace | |
| public class ManyMethodTimerTemplate { | |
| @TLS private static Map<String, Long> startTimes = newHashMap(); | |
| <% targetClasses.eachWithIndex { className, classData, classIndex -> %> | |
| <% classData.targetMethods.eachWithIndex { targetMethod, methodIndex -> %> |
This file contains hidden or 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 kleinFactory = new KleinFactory() | |
| def kleins = [] | |
| while (kleinFactory.isAlive()) | |
| kleins << kleinFactory.createKlein() |
This file contains hidden or 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 Rectangle(w,h) { | |
| this.width = w; | |
| this.height = h; | |
| } | |
| Rectangle.prototype.area = function() { | |
| return this.width * this.height; | |
| }; | |
| function PositionedRectangle(w,h,x,y) { | |
| Rectangle.call(this, w, h); |
This file contains hidden or 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
| // extends and inherits | |
| function heir(p) { | |
| function f() {} | |
| f.prototype = p; | |
| return new f(); | |
| } |
This file contains hidden or 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
| // extending without inheriting | |
| function mixin(from, to) { | |
| var property; | |
| for (property in from) { | |
| if (!to.hasOwnProperty(property)) { | |
| to[property] = from[property]; | |
| } | |
| } | |
| return to; | |
| } |
This file contains hidden or 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
| // Method 2: constructor returning an object literal with methods attached | |
| function Rectangle2(w,h) { | |
| var width = w, height = h; | |
| return { | |
| getWidth: function() { return width; }, | |
| getHeight: function() { return height; }, | |
| setWidth: function(w) { width = w; }, | |
| setHeight: function(h) { height = h; }, | |
| area: function() { return width * height } | |
| }; |
This file contains hidden or 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 Rectangle(w,h) { | |
| this.width = w; | |
| this.height = h; | |
| } | |
| Rectangle.prototype.area = function() { | |
| return this.width * this.height; | |
| }; |
This file contains hidden or 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 heir(p) { | |
| function f() {} | |
| f.prototype = p; | |
| return new f(); | |
| } | |
| PositionedRectangle.prototype = heir(Rectangle.prototype); | |
| PositionedRectangle.prototype.constructor = Rectangle; |