text:
// Autogenerated by convert_tests.py and process_polyglot.py.
// Do not edit this file directly.
// The template for this file is located at:
// ../../../../../../../templates/Test.java
package com.rethinkdb.gen;

import com.rethinkdb.RethinkDB;
import com.rethinkdb.gen.exc.*;
import com.rethinkdb.gen.ast.*;
import com.rethinkdb.ast.ReqlAst;
import com.rethinkdb.model.MapObject;
import com.rethinkdb.model.OptArgs;
import com.rethinkdb.net.Connection;
import com.rethinkdb.net.Cursor;
import junit.framework.TestCase;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertArrayEquals;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.junit.*;
import org.junit.rules.ExpectedException;

import java.util.Arrays;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.time.OffsetDateTime;
import java.time.ZoneOffset;
import java.time.Instant;
import java.util.stream.LongStream;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.concurrent.TimeoutException;
import java.util.regex.Pattern;
import java.util.Collections;
import java.nio.charset.StandardCharsets;

import static com.rethinkdb.TestingCommon.*;
import com.rethinkdb.TestingFramework;

public class MutationAtomicGetSet {
    // Tests replacement of selections
    Logger logger = LoggerFactory.getLogger(MutationAtomicGetSet.class);
    public static final RethinkDB r = RethinkDB.r;
    public static final Table tbl = r.db("test").table("tbl");

    Connection conn;

    @Before
    public void setUp() throws Exception {
        logger.info("Setting up.");
        conn = TestingFramework.createConnection();
        try {
            r.dbCreate("test").run(conn);
            r.db("test").wait_().run(conn);
        }catch (Exception e){}
        try {
            r.db("test").tableCreate("tbl").run(conn);
            r.db("test").table(tbl).wait_().run(conn);
        }catch (Exception e){}
    }

    @After
    public void tearDown() throws Exception {
        logger.info("Tearing down.");
        r.db("rethinkdb").table("_debug_scratch").delete().run(conn);
        if(!conn.isOpen()){
            conn.close();
            conn = TestingFramework.createConnection();
        }
        r.db("test").tableDrop("tbl").run(conn);
        r.dbDrop("test").run(conn);
        conn.close(false);
    }

    // Matches Python's str() function, which we use.
    // TODO: We might want to handle this in a visit_Call in convert_tests.py instead.
    private static String str(long i) {
        return String.valueOf(i);
    }

    // A hack to concatenate two List<Long>s -- see is_array_add in convert_tests.py.
    private static List<Long> concatLong(List<Long> x, List<Long> y) {
        List<Long> ret = new ArrayList<Long>(x);
        ret.addAll(y);
        return ret;
    }

    // Autogenerated tests below

    @Test(timeout=120000)
    public void test() throws Exception {

        {
            // mutation/atomic_get_set.yaml line #7
            /* err("ReqlQueryLogicError", "Error:"+" encountered obsolete optarg `return_vals`.  Use `return_changes` instead.", [0]) */
            Err expected_ = err("ReqlQueryLogicError", "Error:" + " encountered obsolete optarg `return_vals`.  Use `return_changes` instead.", r.array(0L));
            /* tbl.insert({'id':0}, return_vals=True).pluck('changes', 'first_error') */
            logger.info("About to run line #7: tbl.insert(r.hashMap('id', 0L)).optArg('return_vals', true).pluck('changes', 'first_error')");
            Object obtained = runOrCatch(tbl.insert(r.hashMap("id", 0L)).optArg("return_vals", true).pluck("changes", "first_error"),
                                          new OptArgs()
                                          ,conn);
            try {
                assertEquals(expected_, obtained);
            logger.info("Finished running line #7");
            } catch (Throwable ae) {
                logger.error("Whoops, got exception on line #7:" + ae.toString());
                if(obtained instanceof Throwable) {
                    ae.addSuppressed((Throwable) obtained);
                }
                throw ae;
            }
        }

        {
            // mutation/atomic_get_set.yaml line #12
            /* ({'changes':[{'old_val':null,'new_val':{'id':0}}]}) */
            Map expected_ = r.hashMap("changes", r.array(r.hashMap("old_val", null).with("new_val", r.hashMap("id", 0L))));
            /* tbl.insert({'id':0}, return_changes=True).pluck('changes', 'first_error') */
            logger.info("About to run line #12: tbl.insert(r.hashMap('id', 0L)).optArg('return_changes', true).pluck('changes', 'first_error')");
            Object obtained = runOrCatch(tbl.insert(r.hashMap("id", 0L)).optArg("return_changes", true).pluck("changes", "first_error"),
                                          new OptArgs()
                                          ,conn);
            try {
                assertEquals(expected_, obtained);
            logger.info("Finished running line #12");
            } catch (Throwable ae) {
                logger.error("Whoops, got exception on line #12:" + ae.toString());
                if(obtained instanceof Throwable) {
                    ae.addSuppressed((Throwable) obtained);
                }
                throw ae;
            }
        }

        {
            // mutation/atomic_get_set.yaml line #16
            /* ({'changes':[], 'first_error':"Duplicate primary key `id`:\n{\n\t\"id\":\t0\n}\n{\n\t\"id\":\t0\n}"}) */
            Map expected_ = r.hashMap("changes", r.array()).with("first_error", "Duplicate primary key `id`:\n{\n\t\"id\":\t0\n}\n{\n\t\"id\":\t0\n}");
            /* tbl.insert({'id':0}, return_changes=True).pluck('changes', 'first_error') */
            logger.info("About to run line #16: tbl.insert(r.hashMap('id', 0L)).optArg('return_changes', true).pluck('changes', 'first_error')");
            Object obtained = runOrCatch(tbl.insert(r.hashMap("id", 0L)).optArg("return_changes", true).pluck("changes", "first_error"),
                                          new OptArgs()
                                          ,conn);
            try {
                assertEquals(expected_, obtained);
            logger.info("Finished running line #16");
            } catch (Throwable ae) {
                logger.error("Whoops, got exception on line #16:" + ae.toString());
                if(obtained instanceof Throwable) {
                    ae.addSuppressed((Throwable) obtained);
                }
                throw ae;
            }
        }

        {
            // mutation/atomic_get_set.yaml line #20
            /* ({'first_error':"Duplicate primary key `id`:\n{\n\t\"id\":\t0\n}\n{\n\t\"id\":\t0\n}",'changes':[{'old_val':{'id':0},'new_val':{'id':0},'error':"Duplicate primary key `id`:\n{\n\t\"id\":\t0\n}\n{\n\t\"id\":\t0\n}"}]}) */
            Map expected_ = r.hashMap("first_error", "Duplicate primary key `id`:\n{\n\t\"id\":\t0\n}\n{\n\t\"id\":\t0\n}").with("changes", r.array(r.hashMap("old_val", r.hashMap("id", 0L)).with("new_val", r.hashMap("id", 0L)).with("error", "Duplicate primary key `id`:\n{\n\t\"id\":\t0\n}\n{\n\t\"id\":\t0\n}")));
            /* tbl.insert({'id':0}, return_changes='always').pluck('changes', 'first_error') */
            logger.info("About to run line #20: tbl.insert(r.hashMap('id', 0L)).optArg('return_changes', 'always').pluck('changes', 'first_error')");
            Object obtained = runOrCatch(tbl.insert(r.hashMap("id", 0L)).optArg("return_changes", "always").pluck("changes", "first_error"),
                                          new OptArgs()
                                          ,conn);
            try {
                assertEquals(expected_, obtained);
            logger.info("Finished running line #20");
            } catch (Throwable ae) {
                logger.error("Whoops, got exception on line #20:" + ae.toString());
                if(obtained instanceof Throwable) {
                    ae.addSuppressed((Throwable) obtained);
                }
                throw ae;
            }
        }

        {
            // mutation/atomic_get_set.yaml line #24
            /* ({'changes':[{'new_val':{'id':1},'old_val':null}], 'errors':0, 'deleted':0, 'unchanged':0, 'skipped':0, 'replaced':0, 'inserted':1}) */
            Map expected_ = r.hashMap("changes", r.array(r.hashMap("new_val", r.hashMap("id", 1L)).with("old_val", null))).with("errors", 0L).with("deleted", 0L).with("unchanged", 0L).with("skipped", 0L).with("replaced", 0L).with("inserted", 1L);
            /* tbl.insert([{'id':1}], return_changes=True) */
            logger.info("About to run line #24: tbl.insert(r.array(r.hashMap('id', 1L))).optArg('return_changes', true)");
            Object obtained = runOrCatch(tbl.insert(r.array(r.hashMap("id", 1L))).optArg("return_changes", true),
                                          new OptArgs()
                                          ,conn);
            try {
                assertEquals(expected_, obtained);
            logger.info("Finished running line #24");
            } catch (Throwable ae) {
                logger.error("Whoops, got exception on line #24:" + ae.toString());
                if(obtained instanceof Throwable) {
                    ae.addSuppressed((Throwable) obtained);
                }
                throw ae;
            }
        }

        {
            // mutation/atomic_get_set.yaml line #28
            /* ({'changes':[],'first_error':"Duplicate primary key `id`:\n{\n\t\"id\":\t0\n}\n{\n\t\"id\":\t0\n}"}) */
            Map expected_ = r.hashMap("changes", r.array()).with("first_error", "Duplicate primary key `id`:\n{\n\t\"id\":\t0\n}\n{\n\t\"id\":\t0\n}");
            /* tbl.insert([{'id':0}], return_changes=True).pluck('changes', 'first_error') */
            logger.info("About to run line #28: tbl.insert(r.array(r.hashMap('id', 0L))).optArg('return_changes', true).pluck('changes', 'first_error')");
            Object obtained = runOrCatch(tbl.insert(r.array(r.hashMap("id", 0L))).optArg("return_changes", true).pluck("changes", "first_error"),
                                          new OptArgs()
                                          ,conn);
            try {
                assertEquals(expected_, obtained);
            logger.info("Finished running line #28");
            } catch (Throwable ae) {
                logger.error("Whoops, got exception on line #28:" + ae.toString());
                if(obtained instanceof Throwable) {
                    ae.addSuppressed((Throwable) obtained);
                }
                throw ae;
            }
        }

        {
            // mutation/atomic_get_set.yaml line #33
            /* ({'changes':[{'old_val':{'id':0},'new_val':{'id':0,'x':1}}]}) */
            Map expected_ = r.hashMap("changes", r.array(r.hashMap("old_val", r.hashMap("id", 0L)).with("new_val", r.hashMap("id", 0L).with("x", 1L))));
            /* tbl.get(0).update({'x':1}, return_changes=True).pluck('changes', 'first_error') */
            logger.info("About to run line #33: tbl.get(0L).update(r.hashMap('x', 1L)).optArg('return_changes', true).pluck('changes', 'first_error')");
            Object obtained = runOrCatch(tbl.get(0L).update(r.hashMap("x", 1L)).optArg("return_changes", true).pluck("changes", "first_error"),
                                          new OptArgs()
                                          ,conn);
            try {
                assertEquals(expected_, obtained);
            logger.info("Finished running line #33");
            } catch (Throwable ae) {
                logger.error("Whoops, got exception on line #33:" + ae.toString());
                if(obtained instanceof Throwable) {
                    ae.addSuppressed((Throwable) obtained);
                }
                throw ae;
            }
        }

        {
            // mutation/atomic_get_set.yaml line #37
            /* ({'changes':[],'first_error':'a'}) */
            Map expected_ = r.hashMap("changes", r.array()).with("first_error", "a");
            /* tbl.get(0).update({'x':r.error("a")}, return_changes=True).pluck('changes', 'first_error') */
            logger.info("About to run line #37: tbl.get(0L).update(r.hashMap('x', r.error('a'))).optArg('return_changes', true).pluck('changes', 'first_error')");
            Object obtained = runOrCatch(tbl.get(0L).update(r.hashMap("x", r.error("a"))).optArg("return_changes", true).pluck("changes", "first_error"),
                                          new OptArgs()
                                          ,conn);
            try {
                assertEquals(expected_, obtained);
            logger.info("Finished running line #37");
            } catch (Throwable ae) {
                logger.error("Whoops, got exception on line #37:" + ae.toString());
                if(obtained instanceof Throwable) {
                    ae.addSuppressed((Throwable) obtained);
                }
                throw ae;
            }
        }

        {
            // mutation/atomic_get_set.yaml line #41
            /* ({'changes':[{'old_val':{'id':0, 'x':1},'new_val':{'id':0, 'x':3}}, {'old_val':{'id':1},'new_val':{'id':1, 'x':3}}]}) */
            Map expected_ = r.hashMap("changes", r.array(r.hashMap("old_val", r.hashMap("id", 0L).with("x", 1L)).with("new_val", r.hashMap("id", 0L).with("x", 3L)), r.hashMap("old_val", r.hashMap("id", 1L)).with("new_val", r.hashMap("id", 1L).with("x", 3L))));
            /* tbl.update({'x':3}, return_changes=True).pluck('changes', 'first_error').do(lambda d:d.merge({'changes':d['changes'].order_by(lambda a:a['old_val']['id'])})) */
            logger.info("About to run line #41: tbl.update(r.hashMap('x', 3L)).optArg('return_changes', true).pluck('changes', 'first_error').do_(d -> d.merge(r.hashMap('changes', d.bracket('changes').orderBy(a -> a.bracket('old_val').bracket('id')))))");
            Object obtained = runOrCatch(tbl.update(r.hashMap("x", 3L)).optArg("return_changes", true).pluck("changes", "first_error").do_(d -> d.merge(r.hashMap("changes", d.bracket("changes").orderBy(a -> a.bracket("old_val").bracket("id"))))),
                                          new OptArgs()
                                          ,conn);
            try {
                assertEquals(expected_, obtained);
            logger.info("Finished running line #41");
            } catch (Throwable ae) {
                logger.error("Whoops, got exception on line #41:" + ae.toString());
                if(obtained instanceof Throwable) {
                    ae.addSuppressed((Throwable) obtained);
                }
                throw ae;
            }
        }

        {
            // mutation/atomic_get_set.yaml line #46
            /* ({'changes':[{'old_val':{'id':0,'x':3},'new_val':{'id':0,'x':2}}]}) */
            Map expected_ = r.hashMap("changes", r.array(r.hashMap("old_val", r.hashMap("id", 0L).with("x", 3L)).with("new_val", r.hashMap("id", 0L).with("x", 2L))));
            /* tbl.get(0).replace({'id':0,'x':2}, return_changes=True).pluck('changes', 'first_error') */
            logger.info("About to run line #46: tbl.get(0L).replace(r.hashMap('id', 0L).with('x', 2L)).optArg('return_changes', true).pluck('changes', 'first_error')");
            Object obtained = runOrCatch(tbl.get(0L).replace(r.hashMap("id", 0L).with("x", 2L)).optArg("return_changes", true).pluck("changes", "first_error"),
                                          new OptArgs()
                                          ,conn);
            try {
                assertEquals(expected_, obtained);
            logger.info("Finished running line #46");
            } catch (Throwable ae) {
                logger.error("Whoops, got exception on line #46:" + ae.toString());
                if(obtained instanceof Throwable) {
                    ae.addSuppressed((Throwable) obtained);
                }
                throw ae;
            }
        }

        {
            // mutation/atomic_get_set.yaml line #50
            /* ({'changes':[],'first_error':'a'}) */
            Map expected_ = r.hashMap("changes", r.array()).with("first_error", "a");
            /* tbl.get(0).replace(lambda y:{'x':r.error('a')}, return_changes=True).pluck('changes', 'first_error') */
            logger.info("About to run line #50: tbl.get(0L).replace(y -> r.hashMap('x', r.error('a'))).optArg('return_changes', true).pluck('changes', 'first_error')");
            Object obtained = runOrCatch(tbl.get(0L).replace(y -> r.hashMap("x", r.error("a"))).optArg("return_changes", true).pluck("changes", "first_error"),
                                          new OptArgs()
                                          ,conn);
            try {
                assertEquals(expected_, obtained);
            logger.info("Finished running line #50");
            } catch (Throwable ae) {
                logger.error("Whoops, got exception on line #50:" + ae.toString());
                if(obtained instanceof Throwable) {
                    ae.addSuppressed((Throwable) obtained);
                }
                throw ae;
            }
        }

        {
            // mutation/atomic_get_set.yaml line #54
            /* ({'first_error':'a','changes':[{'old_val':{'id':0,'x':2},'new_val':{'id':0,'x':2},'error':'a'}]}) */
            Map expected_ = r.hashMap("first_error", "a").with("changes", r.array(r.hashMap("old_val", r.hashMap("id", 0L).with("x", 2L)).with("new_val", r.hashMap("id", 0L).with("x", 2L)).with("error", "a")));
            /* tbl.get(0).replace(lambda y:{'x':r.error('a')}, return_changes='always').pluck('changes', 'first_error') */
            logger.info("About to run line #54: tbl.get(0L).replace(y -> r.hashMap('x', r.error('a'))).optArg('return_changes', 'always').pluck('changes', 'first_error')");
            Object obtained = runOrCatch(tbl.get(0L).replace(y -> r.hashMap("x", r.error("a"))).optArg("return_changes", "always").pluck("changes", "first_error"),
                                          new OptArgs()
                                          ,conn);
            try {
                assertEquals(expected_, obtained);
            logger.info("Finished running line #54");
            } catch (Throwable ae) {
                logger.error("Whoops, got exception on line #54:" + ae.toString());
                if(obtained instanceof Throwable) {
                    ae.addSuppressed((Throwable) obtained);
                }
                throw ae;
            }
        }

        {
            // mutation/atomic_get_set.yaml line #58
            /* ({'changes':[{'new_val':{'id':0},'old_val':{'id':0, 'x':2}}, {'new_val':{'id':1},'old_val':{'id':1,'x':3}}]}) */
            Map expected_ = r.hashMap("changes", r.array(r.hashMap("new_val", r.hashMap("id", 0L)).with("old_val", r.hashMap("id", 0L).with("x", 2L)), r.hashMap("new_val", r.hashMap("id", 1L)).with("old_val", r.hashMap("id", 1L).with("x", 3L))));
            /* tbl.replace(lambda y:y.without('x'), return_changes=True).pluck('changes', 'first_error').do(lambda d:d.merge({'changes':d['changes'].order_by(lambda a:a['old_val']['id'])})) */
            logger.info("About to run line #58: tbl.replace(y -> y.without('x')).optArg('return_changes', true).pluck('changes', 'first_error').do_(d -> d.merge(r.hashMap('changes', d.bracket('changes').orderBy(a -> a.bracket('old_val').bracket('id')))))");
            Object obtained = runOrCatch(tbl.replace(y -> y.without("x")).optArg("return_changes", true).pluck("changes", "first_error").do_(d -> d.merge(r.hashMap("changes", d.bracket("changes").orderBy(a -> a.bracket("old_val").bracket("id"))))),
                                          new OptArgs()
                                          ,conn);
            try {
                assertEquals(expected_, obtained);
            logger.info("Finished running line #58");
            } catch (Throwable ae) {
                logger.error("Whoops, got exception on line #58:" + ae.toString());
                if(obtained instanceof Throwable) {
                    ae.addSuppressed((Throwable) obtained);
                }
                throw ae;
            }
        }

        {
            // mutation/atomic_get_set.yaml line #62
            /* ({'first_error':"Inserted object must have primary key `id`:\n{\n\t\"x\":\t1\n}", 'changes':[{'new_val':{'id':0},'old_val':{'id':0}, 'error':"Inserted object must have primary key `id`:\n{\n\t\"x\":\t1\n}"}, {'new_val':{'id':1},'old_val':{'id':1},'error':"Inserted object must have primary key `id`:\n{\n\t\"x\":\t1\n}"}]}) */
            Map expected_ = r.hashMap("first_error", "Inserted object must have primary key `id`:\n{\n\t\"x\":\t1\n}").with("changes", r.array(r.hashMap("new_val", r.hashMap("id", 0L)).with("old_val", r.hashMap("id", 0L)).with("error", "Inserted object must have primary key `id`:\n{\n\t\"x\":\t1\n}"), r.hashMap("new_val", r.hashMap("id", 1L)).with("old_val", r.hashMap("id", 1L)).with("error", "Inserted object must have primary key `id`:\n{\n\t\"x\":\t1\n}")));
            /* tbl.replace({'x':1}, return_changes='always').pluck('changes', 'first_error').do(lambda d:d.merge({'changes':d['changes'].order_by(lambda a:a['old_val']['id'])})) */
            logger.info("About to run line #62: tbl.replace(r.hashMap('x', 1L)).optArg('return_changes', 'always').pluck('changes', 'first_error').do_(d -> d.merge(r.hashMap('changes', d.bracket('changes').orderBy(a -> a.bracket('old_val').bracket('id')))))");
            Object obtained = runOrCatch(tbl.replace(r.hashMap("x", 1L)).optArg("return_changes", "always").pluck("changes", "first_error").do_(d -> d.merge(r.hashMap("changes", d.bracket("changes").orderBy(a -> a.bracket("old_val").bracket("id"))))),
                                          new OptArgs()
                                          ,conn);
            try {
                assertEquals(expected_, obtained);
            logger.info("Finished running line #62");
            } catch (Throwable ae) {
                logger.error("Whoops, got exception on line #62:" + ae.toString());
                if(obtained instanceof Throwable) {
                    ae.addSuppressed((Throwable) obtained);
                }
                throw ae;
            }
        }

        {
            // mutation/atomic_get_set.yaml line #86
            /* ({'changes':[{'old_val':{'id':0},'new_val':null}]}) */
            Map expected_ = r.hashMap("changes", r.array(r.hashMap("old_val", r.hashMap("id", 0L)).with("new_val", null)));
            /* tbl.get(0).delete(return_changes=True).pluck('changes', 'first_error') */
            logger.info("About to run line #86: tbl.get(0L).delete().optArg('return_changes', true).pluck('changes', 'first_error')");
            Object obtained = runOrCatch(tbl.get(0L).delete().optArg("return_changes", true).pluck("changes", "first_error"),
                                          new OptArgs()
                                          ,conn);
            try {
                assertEquals(expected_, obtained);
            logger.info("Finished running line #86");
            } catch (Throwable ae) {
                logger.error("Whoops, got exception on line #86:" + ae.toString());
                if(obtained instanceof Throwable) {
                    ae.addSuppressed((Throwable) obtained);
                }
                throw ae;
            }
        }

        {
            // mutation/atomic_get_set.yaml line #90
            /* ({'deleted':1,'errors':0,'inserted':0,'replaced':0,'skipped':0,'unchanged':0,'changes':[{'new_val':null, 'old_val':{'id':1}}]}) */
            Map expected_ = r.hashMap("deleted", 1L).with("errors", 0L).with("inserted", 0L).with("replaced", 0L).with("skipped", 0L).with("unchanged", 0L).with("changes", r.array(r.hashMap("new_val", null).with("old_val", r.hashMap("id", 1L))));
            /* tbl.delete(return_changes=True) */
            logger.info("About to run line #90: tbl.delete().optArg('return_changes', true)");
            Object obtained = runOrCatch(tbl.delete().optArg("return_changes", true),
                                          new OptArgs()
                                          ,conn);
            try {
                assertEquals(expected_, obtained);
            logger.info("Finished running line #90");
            } catch (Throwable ae) {
                logger.error("Whoops, got exception on line #90:" + ae.toString());
                if(obtained instanceof Throwable) {
                    ae.addSuppressed((Throwable) obtained);
                }
                throw ae;
            }
        }
    }
}


text:
body { height:22px; }
body ul { height:20px; }
body ul li { height:10px; }
body ul li div span, body ul li link {
  margin:10px;
  color:red;
}
body ul div, body ul p { border:1px; }
body ul div.hello, body ul p.hello { color:green; }
body ul div :what, body ul p :what { color:blue; }
body ul a b { color:blue; }

redpajama_set_name: RedPajamaGithub


text:
/**
 * Returns the IE version. Tested for IE11 and earlier.
 */
function isIE () {
    var match = navigator.userAgent.match(/(?:MSIE |Trident\/.*; rv:)(\d+)/);
    return match ? parseInt(match[1]) : undefined;
}

String.prototype.endsWith = function (s) {
    return this.length >= s.length && this.substr(this.length - s.length) == s;
};

String.prototype.contains = function (s) {
    return this.indexOf(s) > -1;
};

/**
 * Function count the occurrences of substring in a string;
 * @param {String} subString    Required. The string to search for;
 */
String.prototype.occurrences = function(subString){

    subString+="";
    if(subString.length<=0) return this.length+1;

    var n=0, pos=0;

    while(true){
        pos=this.indexOf(subString,pos);
        if(pos>=0){ n++; pos+=subString.length; } else break;
    }
    return(n);
};

/**
 * Converts plain text to HTML
 * @param text the plain text to convert
 * @returns the HTML version of the text
 */
function plain2html(text) {
    text = (text || "");
    return text
        .replace(/&/g, "&")
        .replace(/</g, "<")
        .replace(/>/g, ">")
        .replace(/\t/g, "    ")
        .replace(/ /g, " ")
        .replace(/\r\n|\r|\n/g, "<br />");
}

/**
 * formats the series identifier.
 * If the number is undefined, the blank string is returned
 * @param msg the series identifier
 */
function formatSeriesIdentifier(msg) {
    if (msg && msg.seriesIdentifier && msg.seriesIdentifier.number) {
        var id = msg.seriesIdentifier.fullId;
        if (msg.type == 'TEMPORARY_NOTICE') {
            id += '(T)';
        } else if (msg.type == 'PRELIMINARY_NOTICE') {
            id += '(P)';
        }
        id += ': ';
        return id;
    }
    return '';
}


text:
module Less2Sass
  module Less
    module Tree
      # Represents the full selector of a given {RulesetNode}.
      #
      # No equivalent node is present in Sass, it's the `rule`
      # member of {::Sass::Tree::PropNode}, instead.
      class SelectorNode < Node
        # @return [Array<Tree::ElementNode>]
        attr_accessor :elements
        attr_accessor :extendList
        attr_accessor :condition
        # @return [Hash]
        attr_accessor :currentFileInfo
        # @return [Boolean]
        attr_accessor :evaldCondition

        # see Node#to_sass
        def to_sass
          raise UnknownError if @elements.nil?
          return @elements.to_sass unless @elements.is_a?(Array)
          @elements.inject([]) { |selector, element| selector << element.to_sass }
        end
      end
    end
  end
end


text:
#region Copyright
//
#endregion
using System.Collections.Generic;

using NZBDash.DataAccessLayer.Models.Settings;

namespace NZBDash.DataAccessLayer.Interfaces
{
    public interface ISettingsRepository
    {
        /// <summary>
        /// Inserts the specified entity.
        /// </summary>
        /// <param name="entity">The entity.</param>
        long Insert(GlobalSettings entity);

        /// <summary>
        /// Gets all.
        /// </summary>
        /// <returns></returns>
        IEnumerable<GlobalSettings> GetAll();

        /// <summary>
        /// Gets the specified identifier.
        /// </summary>
        /// <param name="settingsName">Name of the settings.</param>
        /// <returns></returns>
        GlobalSettings Get(string settingsName);

        /// <summary>
        /// Deletes the specified entity.
        /// </summary>
        /// <param name="entity">The entity.</param>
        /// <returns></returns>
        bool Delete(GlobalSettings entity);

        /// <summary>
        /// Updates the specified entity.
        /// </summary>
        /// <param name="entity">The entity.</param>
        /// <returns></returns>
        bool Update(GlobalSettings entity);
    }
}


text:
package com.ilivoo.common.test;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.SocketChannel;
import java.util.Iterator;
import java.util.Set;

import com.ilivoo.common.socket.buffer.TBuffer;
import com.ilivoo.common.socket.serializing.Serializer;

public class Test {
	public static void main(String[] args) throws Exception {
		Serializer.registerClassForId((short) -1000, CM_Message.class);
		Serializer.registerClassForId((short) -1001, SM_Message.class);
		Serializer.registerClassForId((short)-1002, SM_Session_Close.class);
		Serializer.registerClassForId((short)-1003, SM_Session_Connect.class);
		Serializer.registerClassForId((short)-1004, SM_Managed_Message.class);
		Serializer.registerClassForId((short) -1005, CM_Create_Player.class);
		Serializer.registerClassForId((short) -1006, SM_Create_Player.class);
		Serializer.registerClassForId((short) -1007, CM_Modify_Player.class);
		Serializer.registerClassForId((short) -1008, SM_Modify_Player.class);
		Selector selector = Selector.open();
		SocketChannel channel = selector.provider().openSocketChannel();
		channel.connect(new InetSocketAddress("localhost", 1111));
		channel.configureBlocking(false);
		channel.register(selector, SelectionKey.OP_READ);
		TBuffer tb = TBuffer.allocate(1024);
		int oldPosition = tb.position();
		int newPosition = oldPosition + 4;
		tb.position(newPosition);
		tb.putInt(1);
		Serializer.writeClassAndObject(tb, new CM_Modify_Player());
		int nowPosition = tb.position();
		int length = tb.position() - newPosition;
		tb.position(oldPosition);
		tb.putInt(length);
		tb.position(nowPosition);

		tb.flip();
		System.out.println(tb.limit());
		System.out.println(channel.isConnected());
		try {
			channel.write(tb.buf());
		} catch (IOException e) {
			e.printStackTrace();
		}
		while (true) {
			System.out.println("hello");
			int sel = selector.select();
			if (sel != 0) {
				Set<SelectionKey> key = selector.selectedKeys();
				Iterator<SelectionKey> iter = key.iterator();
				while (iter.hasNext()) {
					SelectionKey sk = iter.next();
					iter.remove();
					if (!sk.isValid()) {
						continue;
					}
					switch (sk.readyOps()) {
					case SelectionKey.OP_READ:
						read(sk);
						break;
					case SelectionKey.OP_WRITE:
						write(sk);
						break;
					case SelectionKey.OP_READ | SelectionKey.OP_WRITE:
						read(sk);
						if (sk.isValid())
							write(sk);
						break;
					}
				}
			}
		}
	}

	public static void read(SelectionKey key) {
		System.out.println("read");
		SocketChannel socketChannel = (SocketChannel) key.channel();
		TBuffer tb = TBuffer.allocate(1024);
		try {
			socketChannel.read(tb.buf());
			tb.flip();
			System.out.println(tb.getInt());
			System.out.println(tb.getInt());
			Object obj = Serializer.readClassAndObject(tb);
			System.out.println(obj.getClass().getName());

//			System.out.println(tb.getInt());
//			System.out.println(tb.getInt());
//			obj = Serializer.readClassAndObject(tb);
//			System.out.println(obj.getClass().getName());
			if(obj instanceof SM_Message){
				SM_Message sm = (SM_Message) obj;
				System.out.println(sm.getA());
			}
			if(obj instanceof SM_Managed_Message){
				SM_Managed_Message sm = (SM_Managed_Message) obj;
				System.out.println(sm.getCode());
			}

		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public static void write(SelectionKey key) {
		SocketChannel socketChannel = (SocketChannel) key.channel();
	}
}


text:
package org.wso2.developerstudio.eclipse.humantask.model.ht.impl;

import javax.xml.namespace.QName;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import org.wso2.developerstudio.eclipse.humantask.model.ht.HTPackage;
import org.wso2.developerstudio.eclipse.humantask.model.ht.TRendering;

/**
 *
 * An implementation of the model object 'TRendering'.
 *
 *

 * The following features are implemented:
 *

 *
{@link org.wso2.developerstudio.eclipse.humantask.model.ht.impl.TRenderingImpl#getType Type}

 *

 *

 *
 * @generated
 */
public class TRenderingImpl extends TExtensibleElementsImpl implements TRendering {
	/**
	 * The default value of the '{@link #getType() Type}' attribute.
	 *
	 *
	 * @see #getType()
	 * @generated
	 * @ordered
	 */
	protected static final QName TYPE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getType() Type}' attribute.
	 *
	 *
	 * @see #getType()
	 * @generated
	 * @ordered
	 */
	protected QName type = TYPE_EDEFAULT;

	/**
	 *
	 *
	 * @generated
	 */
	protected TRenderingImpl() {
		super();
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return HTPackage.Literals.TRENDERING;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public QName getType() {
		return type;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public void setType(QName newType) {
		QName oldType = type;
		type = newType;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, HTPackage.TRENDERING__TYPE, oldType, type));
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case HTPackage.TRENDERING__TYPE:
				return getType();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case HTPackage.TRENDERING__TYPE:
				setType((QName)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case HTPackage.TRENDERING__TYPE:
				setType(TYPE_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case HTPackage.TRENDERING__TYPE:
				return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type);
		}
		return super.eIsSet(featureID);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (type: ");
		result.append(type);
		result.append(')');
		return result.toString();
	}

} //TRenderingImpl


text:
package org.apache.camel.component.netty;

import java.net.ConnectException;
import java.net.InetSocketAddress;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;

import io.netty.bootstrap.Bootstrap;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelOption;
import io.netty.channel.EventLoop;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.epoll.EpollSocketChannel;
import io.netty.channel.socket.nio.NioSocketChannel;
import org.apache.camel.CamelContext;
import org.apache.camel.support.service.ServiceSupport;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * A {@link NettyServerBootstrapFactory} which is used by a single consumer (not shared).
 */
public class ClientModeTCPNettyServerBootstrapFactory extends ServiceSupport implements NettyServerBootstrapFactory {

    protected static final Logger LOG = LoggerFactory.getLogger(ClientModeTCPNettyServerBootstrapFactory.class);

    private CamelContext camelContext;
    private ThreadFactory threadFactory;
    private NettyServerBootstrapConfiguration configuration;
    private ChannelInitializer<Channel> pipelineFactory;
    private Bootstrap clientBootstrap;
    private Channel channel;
    private EventLoopGroup workerGroup;

    public ClientModeTCPNettyServerBootstrapFactory() {
    }

    @Override
    public void init(
            CamelContext camelContext, NettyServerBootstrapConfiguration configuration,
            ChannelInitializer<Channel> pipelineFactory) {
        this.camelContext = camelContext;
        this.configuration = configuration;
        this.pipelineFactory = pipelineFactory;
    }

    @Override
    public void init(
            ThreadFactory threadFactory, NettyServerBootstrapConfiguration configuration,
            ChannelInitializer<Channel> pipelineFactory) {
        this.threadFactory = threadFactory;
        this.configuration = configuration;
        this.pipelineFactory = pipelineFactory;
    }

    @Override
    public void addChannel(Channel channel) {
        // we don't need to track the channel in client mode
    }

    @Override
    public void removeChannel(Channel channel) {
        // we don't need to track the channel in client mode
    }

    @Override
    public void addConsumer(NettyConsumer consumer) {
        // does not allow sharing
    }

    @Override
    public void removeConsumer(NettyConsumer consumer) {
        // does not allow sharing
    }

    @Override
    protected void doStart() throws Exception {
        if (camelContext == null && threadFactory == null) {
            throw new IllegalArgumentException("Either CamelContext or ThreadFactory must be set on " + this);
        }
        startServerBootstrap();
    }

    @Override
    protected void doStop() throws Exception {
        stopServerBootstrap();
    }

    protected void startServerBootstrap() throws Exception {
        // prefer using explicit configured thread pools

        EventLoopGroup wg = configuration.getWorkerGroup();

        if (wg == null) {
            // create new pool which we should shutdown when stopping as its not shared
            workerGroup = new NettyWorkerPoolBuilder()
                    .withNativeTransport(configuration.isNativeTransport())
                    .withWorkerCount(configuration.getWorkerCount())
                    .withName("NettyServerTCPWorker")
                    .build();
            wg = workerGroup;
        }

        clientBootstrap = new Bootstrap();
        if (configuration.isNativeTransport()) {
            clientBootstrap.channel(EpollSocketChannel.class);
        } else {
            clientBootstrap.channel(NioSocketChannel.class);
        }
        clientBootstrap.group(wg);
        clientBootstrap.option(ChannelOption.SO_KEEPALIVE, configuration.isKeepAlive());
        clientBootstrap.option(ChannelOption.TCP_NODELAY, configuration.isTcpNoDelay());
        clientBootstrap.option(ChannelOption.SO_REUSEADDR, configuration.isReuseAddress());
        clientBootstrap.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, configuration.getConnectTimeout());

        LOG.debug("Created ClientBootstrap {}", clientBootstrap);
        clientBootstrap.handler(pipelineFactory);
        ChannelFuture channelFuture
                = clientBootstrap.connect(new InetSocketAddress(configuration.getHost(), configuration.getPort()));
        if (LOG.isDebugEnabled()) {
            LOG.debug("Created new TCP client bootstrap connecting to {}:{} with options: {}",
                    new Object[] { configuration.getHost(), configuration.getPort(), clientBootstrap });
        }
        LOG.info("ClientModeServerBootstrap binding to {}:{}", configuration.getHost(), configuration.getPort());
        channel = openChannel(channelFuture);
    }

    protected void stopServerBootstrap() {
        // close all channels
        LOG.info("ClientModeServerBootstrap unbinding from {}:{}", configuration.getHost(), configuration.getPort());

        if (workerGroup != null) {
            workerGroup.shutdownGracefully();
            workerGroup = null;
        }
    }

    protected void doReconnectIfNeeded() throws Exception {
        if (channel == null || !channel.isActive()) {
            LOG.debug("ClientModeServerBootstrap re-connect to {}:{}", configuration.getHost(), configuration.getPort());
            ChannelFuture connectFuture
                    = clientBootstrap.connect(new InetSocketAddress(configuration.getHost(), configuration.getPort()));
            channel = openChannel(connectFuture);
        }
    }

    protected Channel openChannel(final ChannelFuture channelFuture) throws Exception {
        // blocking for channel to be done
        if (LOG.isTraceEnabled()) {
            LOG.trace("Waiting for operation to complete {} for {} millis", channelFuture, configuration.getConnectTimeout());
        }

        // wait for the channel to be open (see io.netty.channel.ChannelFuture javadoc for example/recommendation)
        channelFuture.awaitUninterruptibly();

        if (!channelFuture.isDone() || !channelFuture.isSuccess()) {
            //check if reconnect is enabled and schedule a reconnect, if from handler then don't schedule a reconnect
            if (configuration.isReconnect()) {
                scheduleReconnect(channelFuture);
                return null;
            } else {
                ConnectException cause = new ConnectException("Cannot connect to " + configuration.getAddress());
                if (channelFuture.cause() != null) {
                    cause.initCause(channelFuture.cause());
                }
                throw cause;
            }
        }
        Channel answer = channelFuture.channel();

        if (LOG.isDebugEnabled()) {
            LOG.debug("Creating connector to address: {}", configuration.getAddress());
        }

        // schedule a reconnect to happen when the channel closes
        if (configuration.isReconnect()) {
            answer.closeFuture().addListener(new ChannelFutureListener() {
                @Override
                public void operationComplete(ChannelFuture future) throws Exception {
                    scheduleReconnect(channelFuture);
                }
            });
        }

        return answer;
    }

    private void scheduleReconnect(final ChannelFuture channelFuture) {
        final EventLoop loop = channelFuture.channel().eventLoop();
        loop.schedule(new Runnable() {
            @Override
            public void run() {
                try {
                    LOG.trace("Re-connecting to {} if needed", configuration.getAddress());
                    doReconnectIfNeeded();
                } catch (Exception e) {
                    LOG.warn("Error during re-connect to " + configuration.getAddress() + ". Will attempt again in "
                             + configuration.getReconnectInterval() + " millis. This exception is ignored.",
                            e);
                }
            }
        }, configuration.getReconnectInterval(), TimeUnit.MILLISECONDS);
    }

}


text:
namespace Tests
{
	using MongoDB.Bson;

	public static class ObjectIdHelpers
	{
		public static ObjectId? SafeParseObjectId(this string id)
		{
			ObjectId parsed;
			if (ObjectId.TryParse(id, out parsed))
			{
				return parsed;
			}
			return null;
		}
	}
}


text:
package org.blitzem.model;

import static org.jclouds.compute.options.TemplateOptions.Builder.runScript;

import java.io.File;
import java.io.IOException;

import org.blitzem.console.BlitzemConsole;
import org.jclouds.compute.options.TemplateOptions;
import org.jclouds.scriptbuilder.domain.CreateFile;
import org.jclouds.scriptbuilder.domain.Statement;

import com.google.common.base.Charsets;
import com.google.common.io.Files;

/**
 * A provisioning step to copy a file from the local filesystem onto the newly
 * created server node.
 *
 * @author Richard North <rich.north@gmail.com>
 *
 */
public class FileCopy extends Provisioning {

	private String from;
	private String to;

	/**
	 * {@inheritDoc}
	 */
	@Override
	public Statement asStatement() {
		File localFile = new File(new File(BlitzemConsole.command.getSource()).getParentFile(), from);
		Iterable<String> lines;
		try {
			lines = Files.readLines(localFile, Charsets.UTF_8);
		} catch (IOException e) {
			throw new RuntimeException("Could not read source file for FileCopy: " + localFile, e);
		}
		return new CreateFile(to, lines);
	}

	/**
	 * @param from the from to set
	 */
	public void setFrom(String from) {
		this.from = from;
	}

	/**
	 * @param to the to to set
	 */
	public void setTo(String to) {
		this.to = to;
	}

}


text:
[Data Algorithms Book](http://shop.oreilly.com/product/0636920033950.do)
======================
* Author: Mahmoud Parsian (mahmoud.parsian@yahoo.com)
* Title: [Data Algorithms: Recipes for Scaling up with Hadoop and Spark](http://shop.oreilly.com/product/0636920033950.do)
* This GitHub repository will host all source code and scripts for [Data Algorithms Book](http://shop.oreilly.com/product/0636920033950.do).
* Publisher: [O'Reilly Media](http://shop.oreilly.com/product/0636920033950.do)
* Published date: July 2015

Git Repository
==============
The book's codebase can also be downloaded from the git repository at:
````
git clone https://github.com/mahmoudparsian/data-algorithms-book.git
````

[2nd Edition! Coming Out @ the End of 2021](./misc/data-algorithms-2nd-ed-cover.jpg)
===========================================

[Upgraded to Spark-3.1.2](http://spark.apache.org/releases/spark-release-3-1-2.html)
=========================

[Production Version is Available NOW!](http://shop.oreilly.com/product/0636920033950.do)
======================================

[![Data Algorithms Book](./misc/da_book3.jpeg)](http://shop.oreilly.com/product/0636920033950.do)

[Java 8's LAMBDA Expressions to Spark...](./misc/jdk8_and_lambda.md)
================================================

[Scala Spark Solutions](./src/main/scala/org/dataalgorithms)
============================================================

[How To Build using Apache's Ant](./misc/ant/README.md)
===============================

[How To Build using Apache's Maven](./misc/maven/README.md)
===================================

[Machine Learning Algorithms using Spark](./src/main/java/org/dataalgorithms/machinelearning)
=========================================

[Spark for Cancer Outlier Profile Analysis](http://hadoopsummit.uservoice.com/forums/344955-data-science-analytics-and-spark/suggestions/11664381-spark-solution-for-cancer-outlier-profile-analysis)
====================================================

[Webinars and Presentions on Data Algorithms](./misc/webinars.md)
=================================================================

[Introduction to MapReduce](https://github.com/mahmoudparsian/data-algorithms-book/tree/master/src/main/java/org/dataalgorithms/chapB09/charcount)
===========================

[Bonus Chapters](./misc/bonus-chapters.md)
================

[Author Book Signing](./misc/book-signing.md)
=====================

<!---
your comment goes here
and here

Work in Progress...
===================
Please note that this is a work in progress...
![Data Algorithms Book Work In Progress](./misc/work_in_progress2.jpeg)
-->

[How To Run Spark/Hadoop Programs](./misc/run_spark/README.md)
==================================

[Submit a Spark Job from Java Code](./misc/how-to-submit-spark-job-from-java-code.md)
===========================================

How To Run Python Programs
==========================
To run python programs just call them with `spark-submit` together with the arguments to the program.

[My favorite quotes...](./misc/favorite_quotes/README.md)
=========================================================

Questions/Comments
==================
* [View Mahmoud Parsian's profile on LinkedIn](http://www.linkedin.com/in/mahmoudparsian)
* Please send me an email: <mahmoud.parsian@yahoo.com>
* [Twitter: @mahmoudparsian](http://twitter.com/mahmoudparsian)

Thank you!
````
best regards,
Mahmoud Parsian
````

[![Data Algorithms Book](./misc/large-image.jpg)](http://shop.oreilly.com/product/0636920033950.do)


text:
package hydrograph.ui.propertywindow.widgets.listeners.grid;

import hydrograph.ui.propertywindow.propertydialog.PropertyDialogButtonBar;
import hydrograph.ui.propertywindow.widgets.listeners.ListenerHelper;
import hydrograph.ui.propertywindow.widgets.listeners.MouseActionListener;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.Widget;

public class MouseExitSchemaGridListener extends MouseActionListener{
	@Override
	public int getListenerType() {
		return SWT.MouseExit;
	}
	@Override
	public void mouseAction(PropertyDialogButtonBar propertyDialogButtonBar,
			ListenerHelper helpers, Event event, Widget... widgets) {
	       	Label label=(Label )event.widget;
			label.getShell().dispose();

	}
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Leveillula taurica f. tropaeoli

### Remarks
null


text:
<?php
return [
    /*
    |--------------------------------------------------------------------------
    | Authentication Language Lines
    |--------------------------------------------------------------------------
    |
    | The following language lines are used during authentication for various
    | messages that we need to display to the user. You are free to modify
    | these language lines according to your application's requirements.
    |
    */
    'failed' => 'Tieto údaje nesedia s našimi záznamami.',
    'throttle' => 'Priveľa pokusov o prihlásenie. Skúste znova o :seconds sekúnd.',

    /**
     * Login & Register
     */
    'sign_up' => 'Registrácia',
    'log_in' => 'Prihlásenie',
    'log_in_with' => 'Prihlásiť sa cez :socialDriver',
    'sign_up_with' => 'Registrovať sa cez :socialDriver',
    'logout' => 'Odhlásenie',

    'name' => 'Meno',
    'username' => 'Používateľské meno',
    'email' => 'Email',
    'password' => 'Heslo',
    'password_confirm' => 'Potvrdiť heslo',
    'password_hint' => 'Musí mať viac ako 5 znakov',
    'forgot_password' => 'Zabudli ste heslo?',
    'remember_me' => 'Zapamätať si ma',
    'ldap_email_hint' => 'Zadajte prosím email, ktorý sa má použiť pre tento účet.',
    'create_account' => 'Vytvoriť účet',
    'social_login' => 'Sociálne prihlásenie',
    'social_registration' => 'Sociálna registrácia',
    'social_registration_text' => 'Registrovať sa a prihlásiť sa použitím inej služby.',

    'register_thanks' => 'Ďakujeme zaregistráciu!',
    'register_confirm' => 'Skontrolujte prosím svoj email a kliknite na potvrdzujúce tlačidlo pre prístup k :appName.',
    'registrations_disabled' => 'Registrácie sú momentálne zablokované',
    'registration_email_domain_invalid' => 'Táto emailová doména nemá prístup k tejto aplikácii',
    'register_success' => 'Ďakujeme za registráciu! Teraz ste registrovaný a prihlásený.',

    /**
     * Password Reset
     */
    'reset_password' => 'Reset hesla',
    'reset_password_send_instructions' => 'Zadajte svoj email nižšie a bude Vám odoslaný email s odkazom pre reset hesla.',
    'reset_password_send_button' => 'Poslať odkaz na reset hesla',
    'reset_password_sent_success' => 'Odkaz na reset hesla bol poslaný na :email.',
    'reset_password_success' => 'Vaše heslo bolo úspešne resetované.',

    'email_reset_subject' => 'Reset Vášho :appName hesla',
    'email_reset_text' => 'Tento email Ste dostali pretože sme dostali požiadavku na reset hesla pre Váš účet.',
    'email_reset_not_requested' => 'Ak ste nepožiadali o reset hesla, nemusíte nič robiť.',

    /**
     * Email Confirmation
     */
    'email_confirm_subject' => 'Potvrdiť email na :appName',
    'email_confirm_greeting' => 'Ďakujeme za pridanie sa k :appName!',
    'email_confirm_text' => 'Prosím potvrďte Vašu emailovú adresu kliknutím na tlačidlo nižšie:',
    'email_confirm_action' => 'Potvrdiť email',
    'email_confirm_send_error' => 'Je požadované overenie emailu, ale systém nemohol odoslať email. Kontaktujte administrátora by ste sa uistili, že email je nastavený správne.',
    'email_confirm_success' => 'Váš email bol overený!',
    'email_confirm_resent' => 'Potvrdzujúci email bol poslaný znovu, skontrolujte prosím svoju emailovú schránku.',

    'email_not_confirmed' => 'Emailová adresa nebola overená',
    'email_not_confirmed_text' => 'Vaša emailová adresa nebola zatiaľ overená.',
    'email_not_confirmed_click_link' => 'Prosím, kliknite na odkaz v emaili, ktorý bol poslaný krátko po Vašej registrácii.',
    'email_not_confirmed_resend' => 'Ak nemôžete násť email, môžete znova odoslať overovací email odoslaním doleuvedeného formulára.',
    'email_not_confirmed_resend_button' => 'Znova odoslať overovací email',
];


text:
package com.ja.smarkdown.model;

import java.util.List;

import com.ja.smarkdown.model.config.Location;

public interface LocationHandler {

	List<String> listDocuments();

	ResourceInfo loadDocument(final String resource);

	void add(final Location location);

}


text:
package ca.uhn.fhir.jpa.provider.r4;

import static org.junit.jupiter.api.Assertions.assertEquals;

import java.io.IOException;

import org.apache.commons.io.IOUtils;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Test;

import ca.uhn.fhir.util.TestUtil;

public class CorsR4Test extends BaseResourceProviderR4Test {

	private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(CorsR4Test.class);

	@Test
	public void saveLocalOrigin() throws IOException {
		HttpGet get = new HttpGet(ourServerBase + "/Patient?name=test");
		get.addHeader("Origin", "file://");
		CloseableHttpResponse resp = ourHttpClient.execute(get);

		ourLog.info(resp.toString());

		IOUtils.closeQuietly(resp.getEntity().getContent());
		assertEquals(200, resp.getStatusLine().getStatusCode());
	}

}


text:
/*
 * Do not modify this file. This file is generated from the cognito-sync-2014-06-30.normal.json service model.
 */
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;

using Amazon.Runtime;
using Amazon.Runtime.Internal;

namespace Amazon.CognitoSync.Model
{
    /// <summary>
    /// Returned for a successful ListIdentityPoolUsage request.
    /// </summary>
    public partial class ListIdentityPoolUsageResponse : AmazonWebServiceResponse
    {
        private int? _count;
        private List<IdentityPoolUsage> _identityPoolUsages = new List<IdentityPoolUsage>();
        private int? _maxResults;
        private string _nextToken;

        /// <summary>
        /// Gets and sets the property Count. Total number of identities for the identity pool.
        /// </summary>
        public int Count
        {
            get { return this._count.GetValueOrDefault(); }
            set { this._count = value; }
        }

        // Check to see if Count property is set
        internal bool IsSetCount()
        {
            return this._count.HasValue;
        }

        /// <summary>
        /// Gets and sets the property IdentityPoolUsages. Usage information for the identity
        /// pools.
        /// </summary>
        public List<IdentityPoolUsage> IdentityPoolUsages
        {
            get { return this._identityPoolUsages; }
            set { this._identityPoolUsages = value; }
        }

        // Check to see if IdentityPoolUsages property is set
        internal bool IsSetIdentityPoolUsages()
        {
            return this._identityPoolUsages != null && this._identityPoolUsages.Count > 0;
        }

        /// <summary>
        /// Gets and sets the property MaxResults. The maximum number of results to be returned.
        /// </summary>
        public int MaxResults
        {
            get { return this._maxResults.GetValueOrDefault(); }
            set { this._maxResults = value; }
        }

        // Check to see if MaxResults property is set
        internal bool IsSetMaxResults()
        {
            return this._maxResults.HasValue;
        }

        /// <summary>
        /// Gets and sets the property NextToken. A pagination token for obtaining the next page
        /// of results.
        /// </summary>
        public string NextToken
        {
            get { return this._nextToken; }
            set { this._nextToken = value; }
        }

        // Check to see if NextToken property is set
        internal bool IsSetNextToken()
        {
            return this._nextToken != null;
        }

    }
}


text:
#include <aws/codeguru-reviewer/model/Type.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>

using namespace Aws::Utils;

namespace Aws
{
  namespace CodeGuruReviewer
  {
    namespace Model
    {
      namespace TypeMapper
      {

        static const int PullRequest_HASH = HashingUtils::HashString("PullRequest");
        static const int RepositoryAnalysis_HASH = HashingUtils::HashString("RepositoryAnalysis");

        Type GetTypeForName(const Aws::String& name)
        {
          int hashCode = HashingUtils::HashString(name.c_str());
          if (hashCode == PullRequest_HASH)
          {
            return Type::PullRequest;
          }
          else if (hashCode == RepositoryAnalysis_HASH)
          {
            return Type::RepositoryAnalysis;
          }
          EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
          if(overflowContainer)
          {
            overflowContainer->StoreOverflow(hashCode, name);
            return static_cast<Type>(hashCode);
          }

          return Type::NOT_SET;
        }

        Aws::String GetNameForType(Type enumValue)
        {
          switch(enumValue)
          {
          case Type::PullRequest:
            return "PullRequest";
          case Type::RepositoryAnalysis:
            return "RepositoryAnalysis";
          default:
            EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
            if(overflowContainer)
            {
              return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
            }

            return {};
          }
        }

      } // namespace TypeMapper
    } // namespace Model
  } // namespace CodeGuruReviewer
} // namespace Aws


text:
'use strict';

angular.module('confRegistrationWebApp')
  .service('U', function U() {

    this.joiner = function (input, separator) {
      if (angular.isArray(input)) {
        return input.join(separator);
      }
      return input;
    };

    this.getKeysWhere = function (object, value) {
      return _.keys(_.pick(object, function (val) {
        return val === value;
      }));
    };

    this.isEmpty = function (value) {
      return !(value || value === false);
    };

    this.getValue = function (string, value) {
      if (this.isEmpty(string)) {
        if (!this.isEmpty(value)) {
          return value;
        }
        return '';
      }
      return string;
    };

    this.stringifyArray = function (array, separator, string) {
      if (this.isEmpty(string)) {
        string = '';
      }

      if (array.length <= 0) {
        return '';
      }

      // assumes first element type identical to others
      if (!angular.isArray(array[0])) {
        return array.join(separator) + '\n';
      }

      for (var i = 0; i < array.length; i++) {
        string += this.stringifyArray(array[i], separator, string);
      }

      return string;
    };

    this.getDate = function (dateTime) {
      var date = this.getValue(dateTime);
      if (!this.isEmpty(dateTime)) {
        date = new Date(dateTime);
      }
      return date;
    };

    this.sortArrayByIndex = function (array, index) {
      array.sort(function (a, b) {
        return ((a[index] < b[index]) ? -1 : ((a[index] > b[index]) ? 1 : 0));
      });
    };

    this.submitForm = function (path, params, method) {
      method = method || 'post';

      var form = document.createElement('form');

      form.setAttribute('method', method);
      form.setAttribute('action', path);
      form.setAttribute('enctype', 'multipart/form-data');

      for (var key in params) {
        if (params.hasOwnProperty(key)) {
          var hiddenField = document.createElement('input');

          hiddenField.setAttribute('type', 'hidden');
          hiddenField.setAttribute('name', key);
          hiddenField.setAttribute('value', params[key]);

          form.appendChild(hiddenField);
        }
      }

      document.body.appendChild(form);

      form.submit();
    };
  }
)
;