http://pegjs.org/online
Expression
= head:Factor tail:Factor* {
return head + tail.join("");
}
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script src="//cdn.jsdelivr.net/pouchdb/3.2.0/pouchdb.min.js"></script> | |
| <script src="pouchdbMapReduceGroupByExample.js"></script> | |
| </head> | |
| <body> | |
| </body> | |
| </html> |
| <html> | |
| <body> | |
| <pre id="display"></pre> | |
| <script src="//cdnjs.cloudflare.com/ajax/libs/es5-shim/4.0.5/es5-shim.min.js"></script> | |
| <script src="//cdn.jsdelivr.net/pouchdb/3.2.0/pouchdb.min.js"></script> | |
| <script src="index.js"></script> | |
| </body> | |
| </html> |
| // NOTE: This is not a by-the-book implementation of the UnitOfWork pattern. If you don't feel it is | |
| // OK, then you can call this class Transaction or anything like that | |
| public class UnitOfWork { | |
| // static reference to entityManagerFactory | |
| public static UnitOfWork createUnitOfWork() { | |
| EntityManager entityManager = entityManagerFactory.createEntityManager(); | |
| return new UnitOfWork(entityManager); | |
| } | |
| var runAfterFiveSeconds = delayedAdd(2, 3); | |
| var multiplication = function (result) { | |
| return result * result | |
| }; | |
| var printResult = function (result) { | |
| console.log(result); | |
| }; | |
| var multiplicationAfterFiveSeconds = runAfterFiveSeconds(multiplication); | |
| multiplicationAfterFiveSeconds(printResult); |
| FirefoxProfile fxProfile = new FirefoxProfile(); | |
| fxProfile.setPreference("browser.download.folderList",2); | |
| fxProfile.setPreference("browser.download.manager.showWhenStarting",false); | |
| fxProfile.setPreference("browser.download.dir","c:\\mydownloads"); | |
| fxProfile.setPreference("browser.helperApps.neverAsk.saveToDisk","text/csv"); | |
| WebDriver driver = new FirefoxDriver(fxProfile); | |
| driver.navigate().to("http://www.foo.com/bah.csv"); |
| import org.junit.Test; | |
| import org.mockito.Mockito; | |
| import org.openqa.selenium.*; | |
| import java.util.List; | |
| import java.util.Map; | |
| import java.util.Set; | |
| import static org.hamcrest.Matchers.is; | |
| import static org.junit.Assert.assertThat; |
| import org.mockito.invocation.InvocationOnMock; | |
| import org.mockito.stubbing.Answer; | |
| import static org.mockito.Mockito.mock; | |
| public class Dummies { | |
| private static class NoMethodShouldBeCalledAnswer implements Answer<Object> { | |
| private String className; |
| var Banco = (function () { | |
| function Banco(nomeBanco) { | |
| if (nomeBanco === void 0) { nomeBanco = 'testes'; } | |
| this.checkEhString(nomeBanco); | |
| this.db = new PouchDB(nomeBanco); | |
| } | |
| Banco.prototype.checkEhString = function (id) { | |
| if (typeof id !== 'string') { | |
| throw new Error('Argumento deve ser uma string e nao um objeto! Recebido: ' | |
| + JSON.stringify(id)); |
| 0x1750dd0f8cd22ee9d849ab11ebc62adb37ffc10a |