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 bisect | |
class NFA(object): | |
EPSILON = object() | |
ANY = object() | |
def __init__(self, start_state): | |
self.transitions = {} | |
self.final_states = set() | |
self._start_state = start_state |
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
<apex:component selfClosing="true" | |
controller="CommunityUserPhotoUploadController" | |
allowDML="true"> | |
<apex:attribute name="subject" type="Id" | |
assignTo="{!userId}" | |
required="true" | |
description="The User ID for the community user"/> | |
<apex:form> | |
<apex:image value="{!largePhotoUrl}"/> |
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 DependentPicklistDemoController { | |
@AuraEnabled | |
public static List<Contact> getContacts() { | |
return [ | |
SELECT Id, Name, AccountId, Account.Name | |
FROM Contact | |
LIMIT 200 | |
]; | |
} |
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 S1Reporting { | |
/* | |
* @see Salesforce1 Reporting REST API Developer Guide | |
*/ | |
public class GetAnalyticsReportsResponseBody { | |
@AuraEnabled | |
public String name; | |
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 OneLeadController { | |
@AuraEnabled | |
public static Id createLead(Lead newLead) { | |
insert newLead; | |
return newLead.Id; | |
} | |
@AuraEnabled | |
public static List<Id> createLeads(List<Lead> newLeads) { |
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 NullSObjectPropertyBugDemoController { | |
@AuraEnabled | |
public static Id editLead(Lead newLead) { | |
Id newLeadId = null; | |
try { | |
upsert newLead; | |
newLeadId = newLead.Id; | |
} |
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
/* | |
* Database.Batchable that can be executed, assuming you have a custom object | |
* named Experiment__c that already exists in your org, with a custom | |
* Text field named Title__c | |
*/ | |
global class BatchableExperiment | |
implements Database.Batchable<Task>, Iterable<Task>, Iterator<Task> { | |
/* | |
* The ID of the Experiment record created for this batch job |
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
<apex:page controller="PieChartRemoteController"> | |
<script> | |
var noData = new Object(); // Simply a dummy placeholder for data attribute | |
var App = App || {}; // To hold functions | |
App.retrieveChartData = function(callback) { | |
var year = document.getElementById('theYear').value; | |
Visualforce.remoting.Manager.invokeAction( | |
'{!$RemoteAction.PieChartRemoteController.getRemotePieData}', | |
year, |
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
trigger SetNewOwner on Case (before insert, before update) { | |
for (Case eachCase : Trigger.new) { | |
if (eachCase.NewOwner__c != null) { | |
eachCase.OwnerId = eachCase.NewOwner__c; | |
eachCase.NewOwner__c = null; | |
} | |
} | |
} |