CouchDB is a NoSQL database for storing JSON documents. It comes with a REST API out of the box so your client applications can persist data while requiring you to write little or no server-side code. CouchDB's killer feature is its ability to easily replicate, which allows for horizontal scaling, easy backup, and for client adapters to synchronize documents. This is perfect if you want to write an application that is offline-first. It's become my go-to database when creating new
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
| @Test | |
| public void postMessage() | |
| { | |
| driver.get("https://csc510-fall16.slack.com/"); | |
| // Wait until page loads and we can see a sign in button. | |
| WebDriverWait wait = new WebDriverWait(driver, 30); | |
| wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("signin_btn"))); | |
| // Find email and password fields. |
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 os | |
| import sys | |
| # constants, configure to match your environment | |
| HOST = 'http://localhost:9200' | |
| INDEX = 'test' | |
| TYPE = 'attachment' | |
| TMP_FILE_NAME = 'tmp.json' | |
| # for supported formats, see apache tika - http://tika.apache.org/1.4/formats.html | |
| INDEX_FILE_TYPES = ['html','pdf', 'doc', 'docx', 'xls', 'xlsx', 'xml'] |
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 static org.junit.Assert.*; | |
| import static org.hamcrest.CoreMatchers.is; | |
| import static org.mockito.Mockito.*; | |
| import static org.mockito.BDDMockito.*; | |
| import org.hamcrest.BaseMatcher; | |
| import org.hamcrest.Description; | |
| import org.hamcrest.Matcher; |
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 static List<Status> findReplies() { | |
| Query query = new Query("iluzcit"); | |
| List<Status> tweets = new ArrayList<Status>(); | |
| Twitter twitter = new TwitterFactory().getInstance(); | |
| try { | |
| QueryResult result; | |
| do { | |
| result = twitter.search(query); |
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.Arrays; | |
| import java.util.Scanner; | |
| class QuickSort { | |
| private static Scanner sc; | |
| public static void main(String args[]) { | |
| sc = new Scanner(System.in); | |
| System.out.println("Enter no of terms"); |
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 Stats(arr) { | |
| var self = this; | |
| var theArray = arr || []; | |
| //http://en.wikipedia.org/wiki/Mean#Arithmetic_mean_.28AM.29 | |
| self.getArithmeticMean = function() { | |
| var sum = 0, length = theArray.length; | |
| for(var i=0;i<length;i++) { | |
| sum += theArray[i]; | |
| } |
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
| <?php | |
| /* | |
| * Author: David T. Sadler (http://davidtsadler.com) | |
| * Date: 2013-03-29 | |
| * License: I release this example into the public domain. Use at your own risk. | |
| * | |
| * Example showing how to list an item to the eBay Sandbox using the eBay Accelerator Toolkit New Schema (EbatNS) for PHP. | |
| * | |
| * This example uses version 815 released on the 2013-03-22. | |
| * http://www.intradesys.de/en/system/files/its_downloads/EbatNs_1_0_815_P5_0.zip |