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
// Get the first assessments that link to the current one, and grant access if we can view it | |
def currentuser = context.getUser(); // The current user object | |
def assessment = args["assessment"]; | |
def incoming_links = assessment.getLinksTo(); | |
if( incoming_links ) | |
{ | |
def first_incoming = incoming_links[0]; // We assume only one incoming link |
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
[#assign query = {}] [#-- Could also do query = {'firstName':'John', 'lastName':'Davies'} --] | |
[#assign results = searchForm.performSearch( query, context.user, '', 'ASCENDING' ) ] |
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
[@main_template] | |
[#include "/assessment_macros"] | |
[#include "/pager_macros"] | |
[#include "/SearchForm_custom_header"] | |
[#include "/SearchForm_Results"] | |
[#include "/SearchForm_Mobile_Results"] | |
[#assign searchForm = context.componentStorage.getApplicationByIdentity("applicationTest").getChildByIdentity("SearchFormCustom")] | |
[#assign currentSearch = request.search!{}] | |
[#assign assessment = currentSearch] |
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
$ ./emulator -verbose -no-audio -avd DroidTest | |
emulator: found SDK root at /home/james/Downloads/android-sdk-linux | |
emulator: Android virtual device file at: /home/james/.android/avd/DroidTest.ini | |
emulator: virtual device content at /home/james/.android/avd/DroidTest.avd | |
emulator: virtual device config file: /home/james/.android/avd/DroidTest.avd/config.ini | |
emulator: using core hw config path: /home/james/.android/avd/DroidTest.avd/hardware-qemu.ini | |
emulator: Found AVD target API level: 14 | |
emulator: found skin 'WVGA800' in directory: /home/james/Downloads/android-sdk-linux/platforms/android-14/skins | |
emulator: autoconfig: -skin WVGA800 | |
emulator: autoconfig: -skindir /home/james/Downloads/android-sdk-linux/platforms/android-14/skins |
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
trigger Auto_Create_Sale on biz3__Order__c (after insert) { | |
if( Trigger.new.size() == 1 ){ | |
biz3__Order__c order = Trigger.new[0]; | |
biz3__Sales_Order__c so = new biz3__Sales_Order__c(); | |
so.biz3__Contact__c = order.biz3__Contact__c; | |
so.biz3__Order__c = order.Id; | |
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
class TestCreateSalesOrder { | |
private static testmethod void testCreateSalesOrder(){ | |
Contact c = new Contact(LastName='Test'); | |
insert c; | |
biz3__Order__c order = new biz3__Order__c( Name='Test', biz3__Contact__c = c.Id ); | |
insert order; | |
biz3__Sales_Order__c[] sales = [SELECT Id FROM biz3__Sales_Order__c WHERE biz3__Order__c = :order.Id]; | |
System.assertEquals( 1, sales.size() ); |
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
public class TestSalesforceBug { | |
enum Day { | |
MON, TUE, WED, THU, FRI | |
} | |
@IsTest static void testMe(){ | |
Set<Day> d = new Set<Day>{ | |
Day.MON, Day.TUE, Day.WED | |
}; |
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 fib( n: Long ):Long = { | |
def fib_tailrec( n:Long, a:Long, b:Long ):Long = { | |
n match { | |
case 0 => a | |
case _ => fib_tailrec( n - 1, b, a + b ) | |
} | |
} | |
fib_tailrec(n, 0, 1) | |
} |
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
moment.parseInTz = function () { | |
var args = [], i, len = arguments.length - 1; | |
for (i = 0; i < len; i++) { | |
args[i] = arguments[i]; | |
} | |
var m = moment.apply(null, args); | |
var preTzOffset = m.zone(); | |
m.tz(arguments[len]); | |
return m.add('minutes', m.zone() - preTzOffset); | |
}; |
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
var bob = Bacon.Model({ | |
name: "Bob", | |
age: 30 | |
}); | |
console.log( bob.lens("name").get() ); // "Bob" as expected | |
Bacon.constant(1).onValue(function(){ | |
console.log( bob.lens("name").get() ); // Undefined | |
}); |
OlderNewer