text:
window.width = function() {
	return document.body.clientWidth;
};

window.height = function() {
	return document.body.clientHeight;
};

// http://stackoverflow.com/questions/523266/how-can-i-get-a-specific-parameter-from-location-search
var getParameter = function(name) {
    name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
    var regexS = "[\\?&]"+name+"=([^&#]*)";
    var regex = new RegExp( regexS );
    var results = regex.exec( window.location.href );
    if( results == null )
        return "";
    else
        return results[1];
};

var getParameters = function() {
    if (window.location.href.indexOf("?")==-1) return {};
    var param_strs = window.location.href.substr(window.location.href.indexOf("?")+1).split("&");
    var params = {};
    param_strs.forEach(function(str) {
        splits = str.split("=");
        if (splits.length==2) {
            params[splits[0]] = splits[1];
        }
    });
    return params;
};

var getReports = function(ids_str, callback, errback) {
    // Batches report requests
    if (ids_str==null) {
        errback("No IDs specified");
    }

    var i = 0;
    var batch_size = 20;
    ids = ids_str.split(",");

    json_ids = [];
    regular_ids = [];
    for (var i = 0; i < ids.length; i++) {
        var id = ids[i];
        if (id.indexOf(".json")!=-1) {
            json_ids.push(id);
        } else {
            regular_ids.push(id);
        }
    }

    var results = [];
    var jsondone = false, batchdone = false;
    var batch_callback = function(json) {
        results = results.concat(json);
        i++;
        if (regular_ids.length == 0) {
            batchdone = true;
            if (jsondone && batchdone) callback(results);
        } else {
            next_request_ids = regular_ids.splice(0, batch_size);
            console.info("Retrieving batch "+i+":", next_request_ids);
            getAllReports(next_request_ids.join(), batch_callback, errback);
        }
    }

    var json_fecthing_id = null;
    var json_batch_callback = function(json) {
        console.log(json);
        if (json.length==1) json[0].id = json_fecthing_id;
        results = results.concat(json);
        if (json_ids.length == 0) {
            jsondone = true;
            if (jsondone && batchdone) callback(results);
        } else {
            json_fecthing_id = json_ids.splice(0, 1);
            d3.json("assets/medium.json", json_batch_callback);
            console.info("Retrieving JSON file " + id);
        }
    }

    batch_callback([]);
    json_batch_callback([]);
}

var getAllReports = function(ids, callback, errback) {
    var report_url = "reports/" + ids;

    var xhr = new XMLHttpRequest();

    xhr.open("GET", report_url, true);

    xhr.onreadystatechange = function() {
        if (xhr.readyState==4) {
            if (xhr.status = 200) {
                var json = JSON.parse(xhr.responseText);
                json.forEach(function(trace) { sanitizeReports(trace.reports); });
                callback(json);
            } else {
                errback(xhr.status, xhr);
            }
        }
    };

    xhr.send(null);
};

function getRelated(ids, callback, errback) {
    var overlapping_url = "overlapping/" + ids;

    var xhr = new XMLHttpRequest();

    xhr.open("GET", overlapping_url, true);

    xhr.onreadystatechange = function() {
        if (xhr.readyState==4) {
            if (xhr.status = 200) {
            	try {
	                var json = JSON.parse(xhr.responseText);
	                callback(json);
            	} catch (e) {
            		errback(e);
            	}
            } else {
            	errback(xhr);
            }
        }
    };

    xhr.send(null);
};

function getTags(ids, callback, errback) {
    var tags_url = "tags/" + ids;

    var xhr = new XMLHttpRequest();

    xhr.open("GET", tags_url, true);

    xhr.onreadystatechange = function() {
        if (xhr.readyState==4) {
            if (xhr.status = 200) {
            	try {
	                var json = JSON.parse(xhr.responseText);
	                callback(json);
            	} catch (e) {
            		errback(e);
            	}
            } else {
            	errback(xhr);
            }
        }
    };

    xhr.send(null);
}

function getGCReports(ids, callback, errback) {
	var gcReportsReceivedCallback = function(data) {
		var GCReportsByProcess = {}
		for (var i = 0; i < data.length; i++) {
			var reports = data[i].reports;
			for (var j = 0; j < reports.length; j++) {
				var report = reports[j];
				if (report["Operation"] && report["Operation"][0]=="GC") {
					var processID = report["ProcessID"][0];
					if (!GCReportsByProcess[processID])
						GCReportsByProcess[processID] = [report];
					else
						GCReportsByProcess[processID].push(report);
				}
			}
		}
		callback(GCReportsByProcess);
	};
	var tagsReceivedCallback = function(tagdata) {
		var GCTasks = [];
		for (var taskid in tagdata) {
			var tags = tagdata[taskid];
			if (tags.indexOf("GC")!=-1) {
				GCTasks.push(taskid);
			}
		}
		if (GCTasks.length > 0) {
			getReports(GCTasks.join(","), gcReportsReceivedCallback, errback);
		} else {
			callback({});
		}
	};
	var relatedIDsReceivedCallback = function(ids) {
		console.log("Searching for GC data in ids: " + ids.join(','));
		getTags(ids.join(','), tagsReceivedCallback, errback);
	};
	getRelated(ids, relatedIDsReceivedCallback, errback);
}

var sanitizeReports = function(reports) {
    var i = 0;
    while (i < reports.length) {
        var report = reports[i];
        if (!report.hasOwnProperty("X-Trace") || !report.hasOwnProperty("Edge")
                || !report["X-Trace"].length==1 || !report["Edge"].hasOwnProperty("length")) {
            reports.splice(i, 1);
            console.warn("Got a bad report:", report);
        } else {
            i++;
        }
    }
    return reports;
}

var createGraphFromReports = function(reports, params) {
    console.log("Creating graph from reports");

    // Filter hideagent elements
    if (params["hideagent"]) {
        console.info("Hiding agent", params["hideagent"], "in", reports.length, "reports");
        reports = filter_agent_reports(reports, params["hideagent"]);
    }

    // Filter 'merge' elements
    console.info("Removing 'merge' operations in", reports.length, "reports");
    reports = filter_merge_reports(reports);

    // Filter yarnchild reports
    if (params["mapreduceonly"]) {
        console.info("Filtering mapreduce reports in", reports.length, "reports");
        reports = filter_yarnchild_reports(reports);
    }

    // Create nodes
    console.info("Creating graph nodes");
    var nodes = {};
    for (var i = 0; i < reports.length; i++) {
        var report = reports[i];
        if (!report.hasOwnProperty("X-Trace")) {
            console.error("Bad report found with no ID:", report);
        }
        var id = report["X-Trace"][0].substr(18);
        nodes[id] = new Node(id);
        nodes[id].report = report;
    }

    // Second link the nodes together
    console.info("Linking graph nodes");
    for (var nodeid in nodes) {
        var node = nodes[nodeid];
        node.report["Edge"].forEach(function(parentid) {
            if (nodes[parentid]) {
                nodes[parentid].addChild(node);
                node.addParent(nodes[parentid]);
            }
        })
    }

    // Create the graph and add the nodes
    var graph = new Graph();
    for (var id in nodes) {
        graph.addNode(nodes[id]);
    }

    console.log("Done creating graph from reports");
    return graph;
}

var createJSONFromVisibleGraph = function(graph) {
    var nodes = graph.getVisibleNodes();
    var reports = [];

    for (var i = 0; i < nodes.length; i++) {
        var node = nodes[i];
        var parents = node.getVisibleParents();
        var report = $.extend({}, node.report);
        report["Edge"] = [];
        for (var j = 0; j < parents.length; j++) {
            report["Edge"].push(parents[j].id);
        }
        reports.push(report);
    }

    return {"reports": reports};
}

//Javascript impl of java's string hashcode:
//http://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/
String.prototype.hashCode = function(){
 var hash = 0, i, char;
 if (this.length == 0) return hash;
 for (i = 0; i < this.length; i++) {
     char = this.charCodeAt(i);
     hash = ((hash<<5)-hash)+char;
     hash = hash & hash; // Convert to 32bit integer
 }
 return hash;
};

function hash_report(report) {
 hash = 0;
 if (report["Agent"]) hash += ("Agent:"+report["Agent"][0]).hashCode();
 if (report["Label"]) hash += ("Label:"+report["Label"][0]).hashCode();
 if (report["Class"]) hash += ("Class:"+report["Class"][0]).hashCode();
 return hash & hash;
}

var filter_yarnchild_reports = function(reports) {
    // First, get the process IDs for the yarnchild nodes
    var yarnchild_process_ids = {};
    for (var i = 0; i < reports.length; i++) {
        var report = reports[i];
        if (report.hasOwnProperty("Agent") && (report["Agent"][0]=="YarnChild" || report["Agent"][0]=="Hadoop Job")) {
            yarnchild_process_ids[report["ProcessID"][0]] = true;
        }
    }

    // A function to decide whether a report stays or goes
    var filter = function(report) {
        return yarnchild_process_ids[report["ProcessID"][0]] ? false : true;
    }

    return filter_reports(reports, filter);
}

var filter_merge_reports = function(reports) {
    var filter = function(report) {
        return report["Operation"] && report["Operation"][0]=="merge";
    }

    return filter_reports(reports, filter);
}

var filter_agent_reports = function(reports, agent) {
    var filter = function(report) {
        return report["Agent"] && report["Agent"][0]==agent;
    };

    return filter_reports(reports, filter);
}

var filter_reports = function(reports, f) {
    // Figure out which reports have to be removed
    var retained = {};
    var removed = {};
    var reportmap = {};
    for (var i = 0; i < reports.length; i++) {
        var report = reports[i];
        var id = report["X-Trace"][0].substr(18);
        reportmap[id] = report;
        if (f(report)) {
            removed[id]=report;
        } else {
            retained[id]=report;
        }
    }

    var remapped = {};
    var num_calculated = 0;
    var remap_parents = function(id) {
        if (remapped[id]) {
            return;
        } else {
            var report = reportmap[id];
            var parents = report["Edge"];
            var newparents = {};
            for (var i = 0; i < parents.length; i++) {
                if (removed[parents[i]]) {
                    remap_parents(parents[i]);
                    reportmap[parents[i]]["Edge"].forEach(function(grandparent) {
                        newparents[grandparent] = true;
                    })
                } else {
                    newparents[parents[i]] = true;
                }
            }
            report["Edge"] = Object.keys(newparents);
            remapped[id] = true;
        }
    }

    return Object.keys(retained).map(function(id) {
        remap_parents(id);
        return retained[id];
    })
}

var kernelgraph_for_trace = function(trace) {
    return KernelGraph.fromJSON(trace);
}

var yarnchild_kernelgraph_for_trace = function(trace) {
    trace.reports = filter_yarnchild_reports(trace.reports);
    trace.reports = filter_merge_reports(trace.reports);
    return kernelgraph_for_trace(trace);
}

var report_id = function(report) {
	return report["X-Trace"][0].substr(18);
}

var critical_path = function(reports, finalreport) {
	if (finalreport==null)
		finalreport = reports[reports.length-1];

	var reportmap = {};
	for (var i = 0; i < reports.length; i++) {
		reportmap[report_id(reports[i])] = reports[i];
	}
	console.log(reportmap);

	var cpath = [];
	var next = finalreport;
	while (next && next["Edge"]) {
		cpath.push(next);
		var parents = next["Edge"];
		next = reportmap[parents[0]];
		for (var i = 1; next==null && i < parents.length; i++) {
			next = reportmap[parents[i]];
		}
		for (var i = 1; i < parents.length; i++) {
			var candidate = reportmap[parents[i]];
			if (reportmap[parents[i]] && Number(candidate["Timestamp"][0]) > Number(next["Timestamp"][0]))
				next = candidate;
		}
	}

	for (var i = 0; i < cpath.length; i++) {
		cpath[i].criticalpath = ["true"];
	}

	return cpath;
}


text:
require_relative 'spec_helper'

module Selenium
  module WebDriver
    describe TargetLocator do
      after do
        ensure_single_window
      end

      let(:new_window) { driver.window_handles.find { |handle| handle != driver.window_handle } }

      # https://github.com/mozilla/geckodriver/issues/52
      not_compliant_on browser: :marionette do
        # https://github.com/SeleniumHQ/selenium/issues/1795
        not_compliant_on driver: :remote, browser: [:edge, :marionette] do
          it 'should find the active element' do
            driver.navigate.to url_for('xhtmlTest.html')
            expect(driver.switch_to.active_element).to be_an_instance_of(WebDriver::Element)
          end
        end
      end

      it 'should switch to a frame directly' do
        driver.navigate.to url_for('iframes.html')
        driver.switch_to.frame('iframe1')

        expect(driver.find_element(name: 'login')).to be_kind_of(WebDriver::Element)
      end

      it 'should switch to a frame by Element' do
        driver.navigate.to url_for('iframes.html')

        iframe = driver.find_element(tag_name: 'iframe')
        driver.switch_to.frame(iframe)

        expect(driver.find_element(name: 'login')).to be_kind_of(WebDriver::Element)
      end

      not_compliant_on browser: [:safari, :phantomjs] do
        it 'should switch to parent frame' do
          # For some reason Marionette loses control of itself here unless reset. Unable to isolate
          compliant_on driver: :marionette do
            reset_driver!
          end

          driver.navigate.to url_for('iframes.html')

          iframe = driver.find_element(tag_name: 'iframe')
          driver.switch_to.frame(iframe)

          expect(driver.find_element(name: 'login')).to be_kind_of(WebDriver::Element)

          driver.switch_to.parent_frame
          expect(driver.find_element(id: 'iframe_page_heading')).to be_kind_of(WebDriver::Element)
        end
      end

      # Safari Note - Ensure Popup Blocker turned off to prevent failures
      not_compliant_on browser: :iphone do
        it 'should switch to a window and back when given a block' do
          driver.navigate.to url_for('xhtmlTest.html')

          driver.find_element(link: 'Open new window').click
          wait.until { driver.window_handles.size == 2 }
          expect(driver.title).to eq('XHTML Test Page')

          driver.switch_to.window(new_window) do
            wait.until { driver.title == 'We Arrive Here' }
          end

          wait.until { driver.title == 'XHTML Test Page' }
        end

        it 'should handle exceptions inside the block' do
          driver.navigate.to url_for('xhtmlTest.html')

          driver.find_element(link: 'Open new window').click
          wait.until { driver.window_handles.size == 2 }
          expect(driver.title).to eq('XHTML Test Page')

          expect do
            driver.switch_to.window(new_window) { raise 'foo' }
          end.to raise_error(RuntimeError, 'foo')

          expect(driver.title).to eq('XHTML Test Page')
        end

        it 'should switch to a window without a block' do
          driver.navigate.to url_for('xhtmlTest.html')

          driver.find_element(link: 'Open new window').click
          wait.until { driver.window_handles.size == 2 }
          expect(driver.title).to eq('XHTML Test Page')

          driver.switch_to.window(new_window)
          expect(driver.title).to eq('We Arrive Here')
        end

        it 'should use the original window if the block closes the popup' do
          driver.navigate.to url_for('xhtmlTest.html')

          driver.find_element(link: 'Open new window').click
          wait.until { driver.window_handles.size == 2 }
          expect(driver.title).to eq('XHTML Test Page')

          driver.switch_to.window(new_window) do
            wait.until { driver.title == 'We Arrive Here' }
            driver.close
          end

          expect(driver.current_url).to include('xhtmlTest.html')
          expect(driver.title).to eq('XHTML Test Page')
        end

        # Marionette BUG - https://bugzilla.mozilla.org/show_bug.cgi?id=1280517
        not_compliant_on browser: [:marionette, :ie] do
          context 'with more than two windows' do
            it 'should close current window when more than two windows exist' do
              driver.navigate.to url_for('xhtmlTest.html')
              wait_for_element(link: 'Create a new anonymous window')
              driver.find_element(link: 'Create a new anonymous window').click
              wait.until { driver.window_handles.size == 2 }
              driver.find_element(link: 'Open new window').click
              wait.until { driver.window_handles.size == 3 }

              driver.switch_to.window(driver.window_handle) { driver.close }
              expect(driver.window_handles.size).to eq 2
            end

            it 'should close another window when more than two windows exist' do
              driver.navigate.to url_for('xhtmlTest.html')
              wait_for_element(link: 'Create a new anonymous window')
              driver.find_element(link: 'Create a new anonymous window').click
              wait.until { driver.window_handles.size == 2 }
              driver.find_element(link: 'Open new window').click
              wait.until { driver.window_handles.size == 3 }

              window_to_close = driver.window_handles.last

              driver.switch_to.window(window_to_close) { driver.close }
              expect(driver.window_handles.size).to eq 2
            end

            it 'should iterate over open windows when current window is not closed' do
              driver.navigate.to url_for('xhtmlTest.html')
              wait_for_element(link: 'Create a new anonymous window')
              driver.find_element(link: 'Create a new anonymous window').click
              wait.until { driver.window_handles.size == 2 }
              driver.find_element(link: 'Open new window').click
              wait.until { driver.window_handles.size == 3 }

              matching_window = driver.window_handles.find do |wh|
                driver.switch_to.window(wh) { driver.title == 'We Arrive Here' }
              end

              driver.switch_to.window(matching_window)
              expect(driver.title).to eq('We Arrive Here')
            end

            it 'should iterate over open windows when current window is closed' do
              driver.navigate.to url_for('xhtmlTest.html')
              wait_for_element(link: 'Create a new anonymous window')
              driver.find_element(link: 'Create a new anonymous window').click
              wait.until { driver.window_handles.size == 2 }
              driver.find_element(link: 'Open new window').click
              wait.until { driver.window_handles.size == 3 }

              driver.close

              matching_window = driver.window_handles.find do |wh|
                driver.switch_to.window(wh) { driver.title == 'We Arrive Here' }
              end

              driver.switch_to.window(matching_window)
              expect(driver.title).to eq('We Arrive Here')
            end
          end
        end

        it 'should switch to a window and execute a block when current window is closed' do
          driver.navigate.to url_for('xhtmlTest.html')
          driver.find_element(link: 'Open new window').click
          wait.until { driver.window_handles.size == 2 }

          driver.switch_to.window(new_window)
          wait.until { driver.title == 'We Arrive Here' }

          driver.close

          driver.switch_to.window(driver.window_handles.first) do
            wait.until { driver.title == 'XHTML Test Page' }
          end

          expect(driver.title).to eq('XHTML Test Page')
        end
      end

      not_compliant_on browser: [:android, :iphone, :safari] do
        it 'should switch to default content' do
          driver.navigate.to url_for('iframes.html')

          driver.switch_to.frame 0
          driver.switch_to.default_content

          driver.find_element(id: 'iframe_page_heading')
        end
      end

      # Edge BUG - https://connect.microsoft.com/IE/feedback/details/1850030
      not_compliant_on browser: [:iphone, :safari, :phantomjs] do
        describe 'alerts' do
          it 'allows the user to accept an alert' do
            driver.navigate.to url_for('alerts.html')
            driver.find_element(id: 'alert').click

            alert = wait_for_alert
            alert.accept
            wait_for_no_alert

            expect(driver.title).to eq('Testing Alerts')
          end

          not_compliant_on browser: :chrome, platform: :macosx do
            it 'allows the user to dismiss an alert' do
              driver.navigate.to url_for('alerts.html')
              driver.find_element(id: 'alert').click

              alert = wait_for_alert
              alert.dismiss
              wait_for_no_alert

              expect(driver.title).to eq('Testing Alerts')
            end
          end

          # Marionette BUG - https://bugzilla.mozilla.org/show_bug.cgi?id=1255906
          # Edge Under Consideration - https://dev.windows.com/en-us/microsoft-edge/platform/status/webdriver/details/
          not_compliant_on browser: [:marionette, :edge] do
            it 'allows the user to set the value of a prompt' do
              driver.navigate.to url_for('alerts.html')
              driver.find_element(id: 'prompt').click

              alert = wait_for_alert
              alert.send_keys 'cheese'
              alert.accept

              text = driver.find_element(id: 'text').text
              expect(text).to eq('cheese')
            end
          end

          it 'allows the user to get the text of an alert' do
            driver.navigate.to url_for('alerts.html')
            driver.find_element(id: 'alert').click

            alert = wait_for_alert
            text = alert.text
            alert.accept

            expect(text).to eq('cheese')
          end

          it 'raises when calling #text on a closed alert' do
            driver.navigate.to url_for('alerts.html')
            wait_for_element(id: 'alert')

            driver.find_element(id: 'alert').click

            alert = wait_for_alert
            alert.accept

            wait_for_no_alert
            expect { alert.text }.to raise_error(Selenium::WebDriver::Error::NoSuchAlertError)
          end

          not_compliant_on browser: :ie do
            it 'raises NoAlertOpenError if no alert is present' do
              expect { driver.switch_to.alert }.to raise_error(Selenium::WebDriver::Error::NoSuchAlertError, /alert|modal/i)
            end
          end

          # Marionette BUG - https://bugzilla.mozilla.org/show_bug.cgi?id=1279211
          not_compliant_on browser: :marionette do
            it 'raises an UnhandledAlertError if an alert has not been dealt with' do
              driver.navigate.to url_for('alerts.html')
              driver.find_element(id: 'alert').click
              wait_for_alert

              expect { driver.title }.to raise_error(Selenium::WebDriver::Error::UnhandledAlertError)

              not_compliant_on browser: [:firefox, :ie] do
                driver.switch_to.alert.accept
              end

              compliant_on browser: :firefox do
                reset_driver!
              end
            end
          end
        end
      end

      compliant_on browser: :ie do
        # Windows 10 changed the auth alert
        not_compliant_on browser: :ie do
          describe 'basic auth alerts' do
            after { reset_driver! }

            it 'allows the user to send valid credentials to an alert' do
              driver.navigate.to url_for('basicAuth')
              driver.switch_to.alert.authenticate('test', 'test')

              expect(driver.find_element(tag_name: 'h1').text).to eq('authorized')
            end

            it 'does not raise an error when invalid credentials are used' do
              driver.navigate.to url_for('basicAuth')
              driver.switch_to.alert.authenticate('invalid', 'invalid')

              wait = Selenium::WebDriver::Wait.new(timeout: 5, ignore: Selenium::WebDriver::Error::NoSuchAlertError)
              wait.until { driver.switch_to.alert }

              expect { driver.switch_to.alert.dismiss }.to_not raise_error
            end
          end
        end
      end
    end
  end # WebDriver
end # Selenium

redpajama_set_name: RedPajamaGithub


text:
/**@file tmedia_imageattr.h
 * @brief 'image-attr' parser as per RFC 6236
 *
 * @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
 *
 */
#ifndef TINYMEDIA_imageattr_H
#define TINYMEDIA_imageattr_H

#include "tinymedia_config.h"

#include "tmedia_common.h"

TMEDIA_BEGIN_DECLS

#define TMEDIA_imageattr_ARRAY_MAX_SIZE	16

typedef int32_t xyvalue_t;
typedef double qvalue_t;
typedef double spvalue_t;

typedef struct tmedia_imageattr_srange_xs
{
	unsigned is_range:1;
	union{
		struct{
			spvalue_t start;
			spvalue_t end;
		}range;
		struct{
			spvalue_t values[TMEDIA_imageattr_ARRAY_MAX_SIZE + 1];
			tsk_size_t count;
		}array;
	};
}
tmedia_imageattr_srange_xt;

typedef struct tmedia_imageattr_xyrange_xs
{
	unsigned is_range:1;
	union{
		struct{
			xyvalue_t start;
			xyvalue_t step;
			xyvalue_t end;
		}range;
		struct{
			xyvalue_t values[TMEDIA_imageattr_ARRAY_MAX_SIZE + 1];
			tsk_size_t count;
		}array;
	};
}
tmedia_imageattr_xyrange_xt;

typedef struct tmedia_imageattr_set_xs
{
	tmedia_imageattr_xyrange_xt xrange;
	tmedia_imageattr_xyrange_xt yrange;
	tmedia_imageattr_srange_xt srange;
	struct{
		unsigned is_present:1;
		spvalue_t start;
		spvalue_t end;
	}prange;
	qvalue_t qvalue;
}
tmedia_imageattr_set_xt;

typedef struct tmedia_imageattr_xs
{
	struct{
		tmedia_imageattr_set_xt sets[TMEDIA_imageattr_ARRAY_MAX_SIZE + 1];
		tsk_size_t count;
	}send;
	struct{
		tmedia_imageattr_set_xt sets[TMEDIA_imageattr_ARRAY_MAX_SIZE + 1];
		tsk_size_t count;
	}recv;
}
tmedia_imageattr_xt;

TINYMEDIA_API int tmedia_imageattr_parse(tmedia_imageattr_xt* self, const void* in_data, tsk_size_t in_size);

TMEDIA_END_DECLS

#endif /* TINYMEDIA_imageattr_H */


text:
[![Build Status](https://travis-ci.org/atom/scandal.png)](https://travis-ci.org/atom/scandal)

scandal provides two utilities:

* Scanning a directory for paths matching a set of glob inclusions or exclusions. For example, you want to find a list of paths to search that match a certain pattern, but are not ignored by the `.gitignore`.

* Searching a list of paths for a regex. For example, you have a list of paths, you want to find all instances of `/text/gi`.

Unsurprisingly, these two things can be combined to scan and search a directory.

## Goals

It is written to be simple, flexible and efficient. Scandal does the minimum.

We want to provide modules to combine in any way you'd like. Want to scan in one process and search in another? You can do that.

To be clear, scandal is not a CLI. It can be used from the terminal, but in practice it's only used for benchmarking.

## Objects

scandal provides two main modules: `PathScanner` and `PathSearcher`.

### PathScanner

Usage is simple:

```coffeescript
{PathScanner} = require 'scandal'
scanner = new PathScanner('/Users/me/myDopeProject', options)

scanner.on 'path-found', (path) ->
  console.log(path)

scanner.on 'finished-scanning', ->
  console.log('All done!')

scanner.scan()
```

`PathScanner` keeps no state. You must consume paths via the 'path-found' event.

#### options

* _excludeVcsIgnores_ - bool; default false; true to exclude paths defined in a .gitignore. Uses [git-utils](http://atom.github.io/node-git/) to check ignred files.
* _inclusions_ - list of patterns to include. Uses [minimatch](https://github.com/isaacs/minimatch) with a couple additions: `['dirname']` and `['dirname/']` will match all paths in direcotry `dirname`
* _exclusions_ - list of patterns to exclude. Same matcher as `inclusions`.
* _includeHidden_ - bool; default false; true includes hidden files.

### PathSearcher

```coffeescript
{PathSearcher} = require 'scandal'
searcher = new PathSearcher()

# You can subscribe to a `results-found` event
searcher.on 'results-found', (result) ->
  # result will contain all the matches for a single path
  console.log("Single Path's Results", result)

# Search a list of paths
searcher.searchPaths /text/gi, ['/Some/path', ...], (results) ->
  console.log('Done Searching', results)

# Search a single path
searcher.searchPath /text/gi, '/Some/path', (result) ->
  console.log('Done Searching', result)
```

Results from line 10 (1 based) are in the following format.

```json
{
  "path": "/Some/path",
  "matches": {
    "matchText": "Text",
    "lineText": "Text in this file!",
    "lineTextOffset": 0,
    "range": [[9, 0], [9, 4]]
  }
}
```

Like the `PathScanner` the searcher keeps no state. You need to consume results via the done callbacks or event.

File reading is fast and memory efficient. It reads in 10k chunks and writes over each previous chunk. Small object creation is kept to a minimum during the read to make light use of the GC.

### PathFilter

A third object, `PathFilter` is available, but intended for use by the `PathScanner`.

## Using the scanner and searcher together

If you dont want to think about combining the `PathScanner` and `PathSearcher` in your own way, a `search` is function provided.

```coffeescript
{search, PathScanner, PathSearcher} = require 'scandal'

path = '/path/to/search'
scanner = new PathScanner(path, excludeVcsIgnores: true)
searcher = new PathSearcher()

searcher.on 'results-found' (result) ->
  # do something rad with the result!

name = "Search #{path}"
console.time name
console.log name
search /text/ig, scanner, searcher, ->
  console.timeEnd name
```


text:
export class Response {
    constructor(options: ResponseOptions) {
        this.body = options.body as string;
    }

    body: string;

    json(): any {
        return JSON.parse(this.body);
    }
}

export class ResponseOptions {
    body: string | Object;
}


text:
This example shows how clients can specify compression options when performing
RPCs, and how to install support for compressors on the server.  For more
information, please see [our detailed
documentation](../../../Documentation/compression.md).

```
go run server/main.go
```

```
go run client/main.go
```


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PA.TileList.Quantified
{
    public static class QuantifiedExtensions
    {
        public static double GetScaleFactor(this IQuantifiedTile list, double sizeX, double sizeY)
        {
            double ratioX = sizeX / (list.Area.SizeX * list.ElementStepX);
            double ratioY = sizeY / (list.Area.SizeY * list.ElementStepY);

            return  Math.Round(Math.Min(ratioX, ratioY), 4);
        }

        public static IQuantifiedTile<T> Scale<T>(this IQuantifiedTile<T> list, double scaleFactor)
              where T : ICoordinate
        {
            return new QuantifiedTile<T>(list, list.ElementSizeX * scaleFactor, list.ElementSizeY * scaleFactor, list.ElementStepX * scaleFactor, list.ElementStepY * scaleFactor, list.RefOffsetX * scaleFactor, list.RefOffsetY * scaleFactor);
        }

        /// <summary>
        /// Get coordinate at specified location.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="list"></param>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <returns></returns>
        public static ICoordinate GetCoordinateAt<T>(this IQuantifiedTile<T> list, double x, double y, int p = 4)
             where T : ICoordinate
        {
            return list.GetArea().FirstOrDefault(c =>
                list.Corners(c, 1, (xc, yc) =>
                    Math.Abs(xc - x) < list.ElementStepX && Math.Abs(yc - y) < list.ElementStepY) == p);
        }

        public static IEnumerable<ICoordinate> GetCoordinatesIn<T>(this IQuantifiedTile<T> list, double x1, double y1, double x2, double y2, bool strict = false)
            where T : ICoordinate
        {
            double minX =  Math.Min(x1,x2);
            double minY =  Math.Min(y1,y2);
            double maxX =  Math.Max(x1,x2);
            double maxY =  Math.Max(y1,y2);

            double resX = Math.Min((maxX - minX) / list.ElementSizeX, 1);
            double resY = Math.Min((maxY - minY) / list.ElementSizeY, 1);

            double res =  Math.Min(resX,resY);

            return list.GetArea().Where(c =>
                list.Corners(c, res, (xc, yc) =>
                    xc >= minX && xc <= maxX && yc >= minY && yc <= maxY) >= (strict ? 4 : 1));
        }

        public static IEnumerable<T> Crop<T>(this IQuantifiedTile<T> list, double x1, double y1, double x2, double y2, bool strict = false)
           where T : ICoordinate
        {
            double minX = Math.Min(x1, x2);
            double minY = Math.Min(y1, y2);
            double maxX = Math.Max(x1, x2);
            double maxY = Math.Max(y1, y2);

            return list.Where(c =>
                list.Corners(c, 1, (xc, yc) =>
                    xc >= minX && xc <= maxX && yc >= minY && yc <= maxY) >= (strict ? 4 : 1));
        }

        public static T FirstOrDefault<T>(this IQuantifiedTile<T> list, double x, double y)
             where T : ICoordinate
        {
            return list.FirstOrDefault(e =>
                list.Corners(e, 1, (xc, yc) =>
                    Math.Abs(xc - x) < list.ElementStepX && Math.Abs(yc - y) < list.ElementStepY) == 4);

        }

        internal static int Corners<T>(this IQuantifiedTile<T> tile, ICoordinate c, double resolution, Func<double, double, bool> predicate)
            where T : ICoordinate
        {
            int points = 0;
            int steps = (int)Math.Round(1 / resolution + 1, 0);

            double[] testY = new double[steps];
            double[] testY2 = new double[steps];

            for (int i = 0; i < steps; i++)
            {
                double testX = ((c.X - tile.Reference.X) - 0.5f + i * resolution) * tile.ElementStepX + tile.RefOffsetX;

                if (i == 0)
                {
                    for (int j = 0; j < steps; j++)
                    {
                        testY[j] = ((c.Y - tile.Reference.Y) - 0.5f + j * resolution) * tile.ElementStepY + tile.RefOffsetY;
                        testY2[j] = Math.Pow(testY[j], 2);
                        points += predicate(testX, testY[j]) ? 1 : 0;
                    }
                }
                else
                {
                    for (int j = 0; j < steps; j++)
                    {
                        points += predicate(testX, testY[j]) ? 1 : 0;
                    }
                }
            }

            return points;
        }
    }
}


text:
namespace Calamari.Commands.Support
{
    public class OptionContext
    {
        readonly OptionValueCollection c;
        readonly OptionSet set;

        public OptionContext(OptionSet set)
        {
            this.set = set;
            c = new OptionValueCollection(this);
        }

        public Option Option { get; set; }

        public string OptionName { get; set; }

        public int OptionIndex { get; set; }

        public OptionSet OptionSet
        {
            get { return set; }
        }

        public OptionValueCollection OptionValues
        {
            get { return c; }
        }
    }
}


text:
<!DOCTYPE html>

	<link rel="shortcut icon" href="/favicon.ico">
	<link rel="icon" sizes="16x16 32x32 64x64" href="/favicon.ico">
	<link rel="icon" type="image/png" sizes="196x196" href="/favicon-192.png">
	<link rel="icon" type="image/png" sizes="160x160" href="/favicon-160.png">
	<link rel="icon" type="image/png" sizes="96x96" href="/favicon-96.png">
	<link rel="icon" type="image/png" sizes="64x64" href="/favicon-64.png">
	<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32.png">
	<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16.png">
	<link rel="apple-touch-icon" href="/favicon-57.png">
	<link rel="apple-touch-icon" sizes="114x114" href="/favicon-114.png">
	<link rel="apple-touch-icon" sizes="72x72" href="/favicon-72.png">
	<link rel="apple-touch-icon" sizes="144x144" href="/favicon-144.png">
	<link rel="apple-touch-icon" sizes="60x60" href="/favicon-60.png">
	<link rel="apple-touch-icon" sizes="120x120" href="/favicon-120.png">
	<link rel="apple-touch-icon" sizes="76x76" href="/favicon-76.png">
	<link rel="apple-touch-icon" sizes="152x152" href="/favicon-152.png">
	<link rel="apple-touch-icon" sizes="180x180" href="/favicon-180.png">
	<meta name="msapplication-TileColor" content="#FFFFFF">
	<meta name="msapplication-TileImage" content="/favicon-144.png">
	<meta name="msapplication-config" content="/browserconfig.xml">

    <title>Nathan Harrington</title>

    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

<link rel="canonical" href="">
        <meta name="author" content="Nathan Harrington" />

        <meta property="og:site_name" content="Nathan Harrington" />
        <meta property="og:type" content="website"/>
        <meta property="og:title" content="Nathan Harrington"/>
        <meta property="og:url" content=""/>
        <meta property="og:description" content="Nathan Harrington"/>

        <link rel="stylesheet" href="/theme/css/bootstrap.min.css" type="text/css"/>
    <link href="/theme/css/font-awesome.min.css" rel="stylesheet">

    <link href="/theme/css/pygments/native.css" rel="stylesheet">
    <link rel="stylesheet" href="/theme/css/style.css" type="text/css"/>

            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
                Toggle navigation

            </button>

Nathan Harrington

                             About

                             Standing Invitation

Blog

Archives

IBM History

            Highlights from 8 years at IBM:

35 articles demonstrating new technologies

13 patents from RFID to cloud management

14 IBM Thanks peer recognition awards

IBM Thinkplace Innovator Award

38 IBM Bravo/Ovation awards

IBM Bravo award for technical achievement

19 Invention achievement awards, 5 patent plateau awards

Selection to the …

Patents at IBM

View the full list of patents developed while at IBM

Social-networking open source visualization aids

Social-networking data analysis can help you understand content,
connections, and opportunities for your personal and business
associations. This article presents tools and code to extract key
components of your social network using the Twitter API to chart,
geolocate, and visualize your social-networking data. Local cached text.
IBM developerWorks Podcast with …

How to ungrab Firefox hotkeys from Flash players

Flash players and other embedded applications in Firefox require their
own hooks for keyboard and mouse input. For years, Flash has grabbed
Firefox keypresses, which stops people from using the keybo ard for
navigation, creating new tabs, or even exiting the Flash focus. Learn
how to creat e a Perl …

Expand your user-authentication options with mouse dynamics

Use Perl, cnee, and
custom algorithms to measure how specific users move the mouse and click
buttons. In this article, we discuss how mouse-click hold times, or a
combination of keyboard and mouse activity can enable new levels of
access-requirements obfuscation. Learn how to apply the open source
tools cnee …

Reduce your PC's power consumption through smart activity monitors

Monitor application usage, system attributes, and user activity to more
effectively use the power-management systems of your laptop or desktop
computer. This article provides tools and code to build on existing
power-saving measures by monitoring your application-usage patterns. Use
the techniques presented here to change your power settings based on …

Shut down idle computers on your network automatically

Recent pushes for "green" technology focus mostly on talk, with little
action for the typical home- or small-office environment. Many users
leave their systems online continuously through laziness or ignorance,
resulting in a significant source of power consumption, as well as an
additional vector for malware propagation. The tools and …

Rotate images in online mapping applications in Firefox

Most online mapping applications assume that the desired
view is always north at the top of the image. This article presents
tools and code that show how to replace the map image with an inverted
copy, where south is at the top. Using a Firefox extension and the
Imager Perl …

Create a continuous keystroke-dynamics monitor with Perl and xev

Keystroke dynamics is a relatively new field that enables identification
of individuals through statistical analysis of their typing patterns.
Previously published articles on developerWorks have shown how to
integrate the concept of keystroke dynamics into your applications, as
well as a real-world example of modifying Gnome Display Manager (GDM) to …

Creating altitude attribute-enhanced image overlay maps in Google Earth

Recent applications have greatly increased the ease of development and
ubiquity of 2-D maps. Tools like Microsoft® Live Search Maps and Google
Maps offer a wealth of tools for enhancing these single-plane maps, but
often ignore altitude as the third dimension of information. This
article presents tools and code to …

«

1

2

3

4

5

6

7

8

9

10

11

»

Social

 github

 linkedin

 google-plus

© 2021 Nathan Harrington
            · Powered by pelican-bootstrap3,
            Pelican,
            Bootstrap

 Back to top


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Oranikle.Studio.Controls
{
    public partial class CtrlDropDownListForm : CtrlDropDownForm
    {
        protected enum EnumLinkIsSelected
        {
            None,
            AddNew,
            Search
        }

        private delegate void EmptyDelegate();

        private struct GetListParams
        {

            public bool allowPicked;
            public object currentValue;
            public int item;

            public GetListParams(int item, object currentValue, bool allowPicked)
            {
                this.item = item;
                this.currentValue = currentValue;
                this.allowPicked = allowPicked;
            }

        }

        private const int HeightWithoutRows = 70;
        private const int MaxShownRows = 8;
        private const int MinShownRows = 1;
        private const int RowHeight = 22;
        private ObjectCollection objectList = new ObjectCollection();

        protected CtrlDropDownListForm.EnumLinkIsSelected linkIsSelected;

        public CtrlDropDownListForm()
        {
            if (!DesignMode)
                Visible = false;

            InitializeComponent();
            Util.RegisterAndTranslateContainer(this);
            ColorSchemeConstants.ApplyBlackAndWhiteTheme(ctrlListingTable);
            if (!DesignMode)
                ctrlListingTable.DataError += new DataGridViewDataErrorEventHandler(ctrlListingTable_DataError);
            objectList = new ObjectCollection();

        }

        #region Properties
        public ObjectCollection Items
        {
            get
            {
                if (!DesignMode)
                {
                    if (objectList == null)
                        objectList = new ObjectCollection();
                    return objectList;
                }
                return null;
            }
            set
            {
                objectList = value;
            }
        }

        public int SelectedIndex
        {
            get;
            set;
        }

        public bool ShowAddLink
        {
            get
            {
                return pnlTop.Visible;
            }
            set
            {
                pnlTop.Visible = value;
            }
        }

        public bool ShowEditControl
        {
            get
            {
                return pnlMiddel.Visible;
            }
            set
            {
                pnlMiddel.Visible = value;
            }
        }

        public bool ShowDeleteButton
        {
            get
            {
                return btnDelete.Visible;
            }
            set
            {
                btnDelete.Visible = value;
            }
        }

        public StyledButton Button1
        {
            get
            {
                return btnEdit;
            }
            set
            {
                btnEdit = value;
            }
        }

        public StyledButton Button2
        {
            get
            {
                return btnDelete;
            }
            set
            {
                btnDelete = value;
            }
        }

        public bool ShowGridHeader
        {
            get
            {
                //if (!DesignMode)
                return ctrlListingTable.ColumnHeadersVisible;
            }
            set
            {
                //if (!DesignMode)
                ctrlListingTable.ColumnHeadersVisible = value;
            }
        }

        public string HeaderTitle
        {
            get
            {
                if (ctrlListingTable.Columns[0] != null)
                { return ctrlListingTable.Columns[0].HeaderText; }
                return string.Empty;
            }
            set
            {
                if (ctrlListingTable.Columns[0] != null)
                { ctrlListingTable.Columns[0].HeaderText = value; }
            }
        }

        public bool IsSelectionList
        {
            get { return colSelect.Visible; }
            set {

                colSelect.Visible = value;
                if (value)
                {
                    lnkAddNew.Text = "< Unselect All .. >";
                    ShowAddLink = true;
                }
                else
                {
                    lnkAddNew.Text = "< Add New .. >";
                }
            }
        }
        public ObjectCollection selectedItems;
        public ObjectCollection SelectedItems
        {
            get {
                List<object> list = new List<object>();
                for (int i = 0; i < ctrlListingTable.Rows.Count; i++)
                {
                    DataGridViewCheckBoxCell selectedCell = (DataGridViewCheckBoxCell)ctrlListingTable.Rows[i].Cells["colSelect"];
                      if (bool.Parse(selectedCell.EditedFormattedValue.ToString()))
                      {
                          list.Add(ctrlListingTable.Rows[i].Tag);
                      }
                }
                if (selectedItems == null)
                    selectedItems = new ObjectCollection();
                selectedItems.Clear();
                selectedItems.AddRange(list.ToArray());
                return selectedItems;
            }
            set
            {
                selectedItems = value;
            }
        }

        public bool LinkIsSelected
        {
            get
            {
                return linkIsSelected != CtrlDropDownListForm.EnumLinkIsSelected.None;
            }
        }

        public DataGridView ListingTable
        {
            get
            {
                return ctrlListingTable;
            }
        }
        #endregion

        private void CtrlDropDownListForm_Load(object sender, EventArgs e)
        {

        }
        #region Events and Functions
        protected void _EntityForm_FormClosed(object sender, FormClosedEventArgs e)
        {
            base.InitializeFromHost();
        }

        private void CtrlDropDownListForm_Disposed(object sender, EventArgs e)
        {
        }

        private void CtrlDropDownListForm_SavedWithNewObject(object sender, int newObjectId)
        {
            if (IsDisposed)
                return;
            if ((Host == null) || Host.IsDisposed || (Host.Subform != this))
                return;
            Host.Value = newObjectId;
        }

        private void ctrlListingTable_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
        {
        }

        protected void ctrlListingTable_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                HandleClickCell(e.RowIndex, e.ColumnIndex);
                return;
            }
            //e.RowIndex;
        }

        private void ctrlListingTable_DataError(object sender, DataGridViewDataErrorEventArgs e)
        {
        }

        protected void DoEditSelectedRow()
        {
        }

        protected object DoGetDefaultValue()
        {
            return null;
        }

        protected object DoGetIdFromCacheObject(object o)
        {
            //return ((LocationQuantity)o).LocationId;
            return o;
        }

        protected object DoGetIdFromText(string p)
        {
            if (Host.Value != null)
                UpdateFromText("");
            if (Host.Value == null) return null;
            return  p;
        }

        protected string DoGetTextFromCacheObject(object o)
        {
            if (o == null) return string.Empty;
            return o.ToString();
        }

        public void DoHandleAddNew()
        {
            //if (pnlTop.Visible)
            {
                Host.OnAddNew_Clicked();
            }
        }

        protected void DoInitListingColumns()
        {
            ctrlListingTable.CellFormatting += new DataGridViewCellFormattingEventHandler(ctrlListingTable_CellFormatting);
        }

        protected void DoUpdateAddNewLinkUI(bool selected)
        {
            if (selected)
            {
                lnkAddNew.Font = new Font(lnkAddNew.Font, FontStyle.Bold);
                return;
            }
            lnkAddNew.Font = new Font(lnkAddNew.Font, FontStyle.Regular);
        }

        private void GetList(object param)
        {
            try
            {

            }
            catch
            {

            }
        }

        private int GetTotalShownRows()
        {
            return (ListingTable.Height - ListingTable.ColumnHeadersHeight) / ListingTable.RowTemplate.Height;
        }

        protected void HandleClickCell(int rowIndex, int columnIndex)
        {
            if ((ListingTable.SelectedRows.Count <= 0) || (rowIndex < 0) || (columnIndex < 0))
                return;
            if (SetSelectionCell())
            {
                return;
            }
            if (Host != null)
                Host.Value = DoGetIdFromCacheObject(ListingTable.SelectedRows[0].Tag);
            if (Host != null)
            {
                Host.Focus();
                SendKeys.Send("\t");
            }
        }

        public void HandlerAddNew()
        {
            if (IsDisposed || !IsHandleCreated)
                return;
            Host.ParentForm.Activate();
            Host.Dismissed = true;
            UpdateVisibility();
            base.BeginInvoke(new CtrlDropDownListForm.EmptyDelegate(DoHandleAddNew));
        }

        public void HandlerSelectCurrent()
        {
            if (Host == null)
                return;
            if (linkIsSelected == CtrlDropDownListForm.EnumLinkIsSelected.AddNew)
            {
                HandlerAddNew();
                return;
            }
            if ((Host != null) && (ListingTable != null) && (ListingTable.SelectedRows.Count > 0))
            {

                if (!IsSelectionList)
                {
                    Host.Value = DoGetIdFromCacheObject(ListingTable.SelectedRows[0].Tag);
                    Host.Text = DoGetTextFromCacheObject(ListingTable.SelectedRows[0].Tag);
                }
                return;
            }
            if (Host != null)
            {
                Host.Value = DoGetIdFromText(Host.Text);
                return;
            }
            Host.Value = DoGetDefaultValue();
        }

        public void HandlerSelectDown()
        {
            switch (linkIsSelected)
            {
                case CtrlDropDownListForm.EnumLinkIsSelected.AddNew:
                    if (ListingTable.Rows.Count == 0)
                    {
                        linkIsSelected = CtrlDropDownListForm.EnumLinkIsSelected.AddNew;
                    }
                    else
                    {
                        int i1 = 0;
                        SetSelectedRow(i1);
                        linkIsSelected = CtrlDropDownListForm.EnumLinkIsSelected.None;
                    }
                    break;

                case CtrlDropDownListForm.EnumLinkIsSelected.None:
                    int i2 = 0;
                    if (ListingTable.SelectedRows.Count > 0)
                        i2 = ListingTable.SelectedRows[0].Index + 1;
                    if (!SetSelectedRow(i2))
                        linkIsSelected = CtrlDropDownListForm.EnumLinkIsSelected.AddNew;
                    break;
            }
            UpdateLinkUI();
        }

        public void HandlerSelectNull()
        {
            if (Host == null)
                return;
            Host.Text = "";
            Host.Value = ((CtrlDropdownHostList)Host).NullValue;
            //Host.ParentForm.Activate();
        }

        public void HandlerSelectPageDown()
        {
            int i1 = GetTotalShownRows() - 1;
            for (int i2 = 0; i2 < i1; i2++)
            {
                HandlerSelectDown();
            }
        }

        public void HandlerSelectPageUp()
        {
            int i1 = GetTotalShownRows() - 1;
            for (int i2 = 0; i2 < i1; i2++)
            {
                HandlerSelectUp();
            }
        }

        public void HandlerSelectUp()
        {
            switch (linkIsSelected)
            {
                case CtrlDropDownListForm.EnumLinkIsSelected.AddNew:
                    if (ListingTable.Rows.Count == 0)
                    {
                        linkIsSelected = CtrlDropDownListForm.EnumLinkIsSelected.AddNew;
                    }
                    else
                    {
                        int i1 = ListingTable.Rows.Count - 1;
                        SetSelectedRow(i1);
                        linkIsSelected = CtrlDropDownListForm.EnumLinkIsSelected.None;
                    }
                    break;

                case CtrlDropDownListForm.EnumLinkIsSelected.None:
                    int i2 = ListingTable.Rows.Count - 1;
                    if (ListingTable.SelectedRows.Count > 0)
                        i2 = ListingTable.SelectedRows[0].Index - 1;
                    if (!SetSelectedRow(i2))
                        linkIsSelected = CtrlDropDownListForm.EnumLinkIsSelected.AddNew;
                    break;
            }
            UpdateLinkUI();
        }

        public bool HasFocus()
        {
            return Form.ActiveForm == this;
        }

        void btnEdit_Click(object sender, EventArgs e)
        {
            if (pnlMiddel.Visible)
            {
                if (IsDisposed || !IsHandleCreated)
                    return;
                Host.ParentForm.Activate();
                Host.Dismissed = true;
                UpdateVisibility();
                Host.OnEdit_Clicked();
                Host.OnValueChanged();
            }
        }
        void btnDelete_Click(object sender, EventArgs e)
        {
            if (pnlMiddel.Visible && btnDelete.Visible)
            {
                if (IsDisposed || !IsHandleCreated)
                    return;
                Host.ParentForm.Activate();
                Host.Dismissed = true;
                UpdateVisibility();
                Host.OnDelete_Clicked();
                Host.OnValueChanged();
            }
        }

        protected void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            linkIsSelected = EnumLinkIsSelected.AddNew;
            HandlerAddNew();
        }

        public void OnMouseWheelPublic(MouseEventArgs e)
        {
            base.OnMouseWheel(e);
        }

        private void ReAdjustHeight()
        {
            int i = objectList == null ? 0 : objectList.Count;
            if (i < 1)
                i = 1;
            if (i > 10)
                i = 10;
            Height = 90 + (i * 22);

        }

        public void ResetDataSource()
        {
            //locationQuantityListBindingSource.DataSource = objectList;
            SetText();
            ctrlListingTable.Columns["colSelect"].ReadOnly = false;
            if (!DesignMode && (IsSelectionList && ctrlListingTable.Rows.Count == 0) || !IsSelectionList)
            {
                ctrlListingTable.Rows.Clear();
                if (objectList == null) return;
                int index = 0;
                foreach (object obj in objectList)
                {
                    ctrlListingTable.Rows.Add();
                    DataGridViewRow row = ctrlListingTable.Rows[ctrlListingTable.Rows.Count - 1];
                    row.Cells[1].Value = obj;
                    row.Tag = obj;
                    if (!IsSelectionList)
                    {
                        if (Host != null && Host.Value == null && this.SelectedIndex == index)
                            Host.Value = obj;
                    }
                    index++;
                }
            }
        }
        public void ResetDataSource(bool isForcefullly)
        {
            //locationQuantityListBindingSource.DataSource = objectList;
            SetText();
            ctrlListingTable.Columns["colSelect"].ReadOnly = false;
            if (!DesignMode && isForcefullly)
            {
                ctrlListingTable.Rows.Clear();
                if (objectList == null) return;
                int index = 0;
                foreach (object obj in objectList)
                {
                    ctrlListingTable.Rows.Add();
                    DataGridViewRow row = ctrlListingTable.Rows[ctrlListingTable.Rows.Count - 1];
                    row.Cells[1].Value = obj;
                    row.Tag = obj;
                    if (!IsSelectionList)
                    {
                        if (Host != null && Host.Value == null && this.SelectedIndex == index)
                            Host.Value = obj;
                    }
                    index++;
                }
            }
        }

        protected bool SetSelectedRow(int rowIndex)
        {
            if ((rowIndex < 0) || (rowIndex >= ListingTable.Rows.Count))
            {
                foreach (DataGridViewRow dataGridViewRow in ListingTable.SelectedRows)
                {
                    dataGridViewRow.Selected = false;
                }
                return false;
            }
            ListingTable.Rows[rowIndex].Selected = true;
            if (ListingTable.Rows[rowIndex].Cells["colSelect"].Visible == true)
                ListingTable.CurrentCell = ListingTable.Rows[rowIndex].Cells["colSelect"];
            ListingTable.FirstDisplayedScrollingRowIndex = rowIndex;
            if (Host != null && !IsSelectionList)
            {
                Host.Value = DoGetIdFromCacheObject(ListingTable.Rows[rowIndex].Tag);
                Host.SelectAllText();
            }
            return true;
        }

        private void splitContainer1_Panel2_Click(object sender, EventArgs e)
        {
            HandlerSelectNull();
            if (Host != null)
            {
                Host.Focus();
                SendKeys.Send("\t");
            }
        }

        private void splitContainer2_Panel1_Click(object sender, EventArgs e)
        {
            HandlerSelectNull();
            if (Host != null)
            {
                Host.Focus();
                SendKeys.Send("\t");
            }
        }

        protected void UpdateLinkUI()
        {
            DoUpdateAddNewLinkUI(linkIsSelected == CtrlDropDownListForm.EnumLinkIsSelected.AddNew);
        }

        //private void UpdateLocationQuantityItem(objectList newList)
        //{
        //    if ((Host == null) || IsDisposed || !IsHandleCreated)
        //        return;
        //    locations = newList;
        //    ResetDataSource();
        //    base.UpdateFromText(Host.Text);
        //    ReAdjustHeight();
        //}

        protected override int DoGetMinimumWidth()
        {
            return 100;
        }

        public override bool GetExpectedVisibility()
        {
            if (DesignMode)
                return false;
            if (base.GetExpectedVisibility())
                return true;
            return false;
        }

        protected override void InitializeFromHost()
        {
            if ((Host == null) || (ListingTable == null))
                return;
            bool flag = ((CtrlDropdownHostList)Host).AllowPicked;
            ListingTable.ClearSelection();
            object nullable = ((CtrlDropdownHostList)Host).Value;

            ListingTable.DefaultCellStyle.Font = Host.TextFont;

            ResetDataSource();
            ListingTable.ClearSelection();
            linkIsSelected = CtrlDropDownListForm.EnumLinkIsSelected.None;
            UpdateLinkUI();
            ReAdjustHeight();
            object obj1 = Host.Value;
            if (obj1 == null) return;
            foreach (DataGridViewRow dataGridViewRow1 in ListingTable.Rows)
            {
                if (DoGetIdFromCacheObject(dataGridViewRow1.Tag).Equals(obj1))
                {
                    dataGridViewRow1.Selected = true;
                    try
                    {
                        ListingTable.FirstDisplayedScrollingRowIndex = dataGridViewRow1.Index;
                    }
                    catch (InvalidOperationException)
                    {
                    }
                    return;
                }
            }
        }

        protected override void OnDeactivate(EventArgs e)
        {
            base.OnDeactivate(e);
            //if (!IsSelectionList)
            UpdateVisibility();
            SetText();
        }

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            TopMost = true;
            DoInitListingColumns();
            Disposed += new EventHandler(CtrlDropDownListForm_Disposed);

        }

        protected override void OnMouseWheel(MouseEventArgs e)
        {
            base.OnMouseWheel(e);
            int i1 = e.Delta * SystemInformation.MouseWheelScrollLines / 240;
            if (i1 < 0)
            {
                i1 *= -1;
                for (int i2 = 0; i2 < i1; i2++)
                {
                    HandlerSelectDown();
                }
                return;
            }
            if (i1 > 0)
            {
                for (int i3 = 0; i3 < i1; i3++)
                {
                    HandlerSelectUp();
                }
            }
        }

        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            if (keyData == Keys.Up)
            {
                HandlerSelectUp();
                return true;
            }
            if (keyData == Keys.Down)
            {
                HandlerSelectDown();
                return true;
            }
            if ((keyData == Keys.Tab) || (keyData == Keys.Enter))
            {
                HandlerSelectCurrent();
                if (linkIsSelected == CtrlDropDownListForm.EnumLinkIsSelected.AddNew)
                {
                    return true;
                }
                if (IsSelectionList)
                {
                    if (Host != null)
                        Host.Focus();
                    //if (keyData == Keys.Enter)
                    {

                        SendKeys.Send("\t");
                        return true;
                    }

                }
                return base.ProcessCmdKey(ref msg, keyData);
            }

            if (keyData == Keys.Space)
            {
                SetSelectionCell();
            }
            if (keyData == Keys.Prior)
            {
                HandlerSelectPageUp();
                return true;
            }
            if (keyData == Keys.PageDown)
            {
                HandlerSelectPageDown();
                return true;
            }
            return base.ProcessCmdKey(ref msg, keyData);
        }

        public bool SetSelectionCell()
        {
            if (IsSelectionList)
            {
                ctrlListingTable.CurrentRow.Cells["colSelect"].Value = ctrlListingTable.CurrentRow.Cells["colSelect"].Value == null ? true : (!(bool)ctrlListingTable.CurrentRow.Cells["colSelect"].Value);
                //SetText();
                return true;
            }
            return false;
        }

        public void SetText()
        {
            if (Host == null)
                return;
            if (IsSelectionList)
            {
                if (SelectedItems.Count == 0)
                    Host.Text = "All";
                else
                    Host.Text = "Selected";
            }
        }

        public override void UpdateFromText(string text)
        {
            if (String.IsNullOrEmpty(text))
            {
                ListingTable.ClearSelection();
                linkIsSelected = CtrlDropDownListForm.EnumLinkIsSelected.None;
                if (Host != null)
                    Host.Value = null;
                return;
            }
            if (linkIsSelected == EnumLinkIsSelected.AddNew)
            {
                ResetDataSource();
            }
            for (int i = 0; i < ListingTable.RowCount; i++)
            {
                string s = DoGetTextFromCacheObject(ListingTable.Rows[i].Tag);
                if (s.StartsWith(text, true, null))
                {
                    ListingTable.ClearSelection();
                    ListingTable.Rows[i].Selected = true;
                    if (ListingTable.Rows[i].Cells["colSelect"].Visible == true)
                        ListingTable.CurrentCell = ListingTable.Rows[i].Cells["colSelect"];
                    try
                    {
                        ListingTable.FirstDisplayedScrollingRowIndex = i;
                    }
                    catch (InvalidOperationException)
                    {
                    }
                    linkIsSelected = CtrlDropDownListForm.EnumLinkIsSelected.None;
                    return;
                }
            }
            ListingTable.ClearSelection();
            linkIsSelected = CtrlDropDownListForm.EnumLinkIsSelected.None;
            if (Host != null)
            {
                Host.Value = null;
                //Host.Text = null;
            }
        }

        #endregion

        public void UncheckAll()
        {
            if (IsSelectionList)
            {
                foreach (DataGridViewRow row in ctrlListingTable.Rows)
                {
                    if (row.Cells.Count > 0 && row.Cells["colSelect"].Visible)
                    {
                        row.Cells["colSelect"].Value = false;
                    }
                }
                selectedItems = new ObjectCollection();
                SetText();
            }
        }

        internal void SetCheckedItem(int index)
        {
            if (IsSelectionList)
            {
                foreach (DataGridViewRow row in ctrlListingTable.Rows)
                {
                    if (index == row.Index)
                    {
                        if (row.Cells.Count > 0 && row.Cells["colSelect"].Visible)
                        {
                            row.Cells["colSelect"].Value = true;
                            if (!selectedItems.Contains(row.Tag))
                            {
                                selectedItems.Add(row.Tag);
                            }
                        }
                    }
                }
               //try it
                SetText();
            }
        }
    }
}


text:
/* For the 1st button "Create public Gist" */
#gists + div button[value='1'] {
	margin-left: auto !important;
	margin-right: 0;
}


text: Sets the full URL of the REST API as http[s]://localhost[:8080]


text:
Mautic.getStageActionPropertiesForm = function(actionType) {
    Mautic.activateLabelLoadingIndicator('stage_type');

    var query = "action=stage:getActionForm&actionType=" + actionType;
    mQuery.ajax({
        url: mauticAjaxUrl,
        type: "POST",
        data: query,
        dataType: "json",
        success: function (response) {
            if (typeof response.html != 'undefined') {
                mQuery('#stageActionProperties').html(response.html);
                Mautic.onPageLoad('#stageActionProperties', response);
            }
        },
        error: function (request, textStatus, errorThrown) {
            Mautic.processAjaxError(request, textStatus, errorThrown);
        },
        complete: function() {
            Mautic.removeLabelLoadingIndicator();
        }
    });
};


text:
/* core angular modules */
import { Injectable, NgZone } from '@angular/core';

/* core ionic 2 modules */
import { Storage } from '@ionic/storage';

/* third party external modules */
import { tokenNotExpired, AuthHttp } from 'angular2-jwt';
//import { Observable } from 'rxjs/Rx';

// avoid name not found warnings
declare var Auth0Lock: any;

@Injectable()
export class AuthService {

  // configure Auth0
  private lock = new Auth0Lock('5O0AJESQjxeOtKfoFasek5CX0zsbx5FB', 'somnathbm.auth0.com', {
    auth: {
      redirect: false
    },
    theme: {
      logo: 'https://s3.ap-south-1.amazonaws.com/cu-sensorhub/logo.svg'
    },
    languageDictionary: {
      emailInputPlaceholder: 'something@youremail.com',
      title: 'Sensor hub'
    }
  });
  //private JwtHelper: JwtHelper = new JwtHelper();
  private storage: Storage = new Storage('localstorage');
  public user: Object;
  private accessToken: string;
  private idToken: string;
  private zoneImpl: NgZone;
  private loader: any;

  constructor(private authHttp: AuthHttp, private zone: NgZone) {
    this.zoneImpl = zone;

    // check if there's a profile saved in local storage
    this.storage.get('profile').then(profile => {
      this.user = JSON.parse(profile);
    }).catch(error => {
      console.log(error);
    });

    this.storage.get('id_token').then(token => {
      this.idToken = token;
    });

    // listen when authentication event
    this.lock.on('authenticated', authResult => {
      if(authResult && authResult.accessToken && authResult.idToken) {
        this.storage.set('access_token', authResult.accessToken);
        this.storage.set('id_token', authResult.idToken);
        this.accessToken = authResult.accessToken;
        this.idToken = authResult.idToken;

        // fetch profile information
        this.lock.getUserInfo(this.accessToken, (error, profile) => {
          if(error) {
            // handle error
            alert(error);
            return;
          }
          profile.user_metadata = profile.user_metadata || {};
          this.storage.set('profile', JSON.stringify(profile));
          this.user = profile;
        });

        this.lock.hide();
        this.zoneImpl.run(() => this.user = authResult.profile);
      }
    });

  }

  // display lock widget and handle sign in or sign up
  public login() {
    this.lock.show();
  }

  // check authentication status
  public authenticated() {
    return tokenNotExpired('id_token', this.idToken);
  }

  // log out and clear the current users token
  logout() {
    this.storage.remove('profile');
    this.storage.remove('access_token');
    this.storage.remove('id_token');
    this.idToken = null;
    this.zoneImpl.run(() => this.user = null);
  }
}


text:
package s3 // import "aws.upspin.io/cloud/storage/s3"

import (
	"bytes"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/s3"
	"github.com/aws/aws-sdk-go/service/s3/s3manager"

	"upspin.io/cloud/storage"
	"upspin.io/errors"
)

// These constants define ACLs for writing data to Amazon Simple Storage
// Service. Definitions according to
// http://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
const (
	// ACLPublicRead means owner gets FULL_CONTROL.
	// The AllUsers group gets READ access.
	ACLPublicRead = "public-read"
	// ACLPrivate means owner gets FULL_CONTROL.
	// No one else has access rights.
	ACLPrivate = "private"
)

// Keys used for storing dial options.
const (
	regionName  = "s3Region"
	bucketName  = "s3BucketName"
	defaultACL  = "defaultACL"
	endpointURL = "endpoint"
)

// s3Impl is an implementation of Storage that connects to an Amazon Simple
// Storage (S3) backend.
type s3Impl struct {
	service         *s3.S3
	bucketName      string
	defaultWriteACL string
}

// New initializes a Storage implementation that stores data to Amazon Simple
// Storage Service.
func New(opts *storage.Opts) (storage.Storage, error) {
	const op errors.Op = "cloud/storage/amazons3.New"

	region, ok := opts.Opts[regionName]
	if !ok {
		return nil, errors.E(op, errors.Invalid, errors.Errorf("%q option is required", regionName))
	}
	config := aws.Config{
		Region: aws.String(region),
	}
	if endpoint, ok := opts.Opts[endpointURL]; ok {
		config.Endpoint = aws.String(endpoint)
	}
	bucket, ok := opts.Opts[bucketName]
	if !ok {
		return nil, errors.E(op, errors.Invalid, errors.Errorf("%q option is required", bucketName))
	}
	acl, ok := opts.Opts[defaultACL]
	if !ok {
		return nil, errors.E(op, errors.Invalid, errors.Errorf("%q option is required", defaultACL))
	}
	if acl != ACLPrivate && acl != ACLPublicRead {
		return nil, errors.E(op, errors.Invalid,
			errors.Errorf("valid ACL values for S3 are %s and %s", ACLPrivate, ACLPublicRead))
	}

	sess, err := session.NewSessionWithOptions(session.Options{
		Config:            config,
		SharedConfigState: session.SharedConfigEnable,
	})
	if err != nil {
		return nil, errors.E(op, errors.IO, errors.Errorf("unable to create Amazon session: %s", err))
	}

	return &s3Impl{
		service:         s3.New(sess),
		bucketName:      bucket,
		defaultWriteACL: acl,
	}, nil
}

func init() {
	storage.Register("S3", New)
}

// Guarantee we implement the Storage interface.
var _ storage.Storage = (*s3Impl)(nil)

// LinkBase implements Storage.
func (s *s3Impl) LinkBase() (base string, err error) {
	return s.service.Endpoint + "/" + s.bucketName + "/", nil
}

// Download implements Storage.
func (s *s3Impl) Download(ref string) ([]byte, error) {
	const op errors.Op = "cloud/storage/amazons3.Download"

	buf := aws.NewWriteAtBuffer([]byte{})
	d := s3manager.NewDownloaderWithClient(s.service)
	_, err := d.Download(buf, &s3.GetObjectInput{
		Bucket: aws.String(s.bucketName),
		Key:    aws.String(ref),
	})
	if err != nil {
		if awsErr, ok := err.(awserr.RequestFailure); ok && awsErr.StatusCode() == 404 {
			return nil, errors.E(op, errors.NotExist, err)
		}
		return nil, errors.E(op, errors.IO, errors.Errorf(
			"unable to download ref %q from bucket %q: %s", ref, s.bucketName, err))
	}
	return buf.Bytes(), nil
}

// Put implements Storage.
func (s *s3Impl) Put(ref string, contents []byte) error {
	const op errors.Op = "cloud/storage/amazons3.Put"

	ul := s3manager.NewUploaderWithClient(s.service)
	_, err := ul.Upload(&s3manager.UploadInput{
		ACL:    aws.String(s.defaultWriteACL),
		Bucket: aws.String(s.bucketName),
		Key:    aws.String(ref),
		Body:   bytes.NewBuffer(contents),
	})
	if err != nil {
		return errors.E(op, errors.IO, errors.Errorf(
			"unable to upload ref %q to bucket %q: %s", ref, s.bucketName, err))
	}
	return nil
}

// Delete implements Storage.
func (s *s3Impl) Delete(ref string) error {
	const op errors.Op = "cloud/storage/amazons3.Delete"

	_, err := s.service.DeleteObject(&s3.DeleteObjectInput{
		Bucket: aws.String(s.bucketName),
		Key:    aws.String(ref),
	})
	if err != nil {
		return errors.E(op, errors.IO, errors.Errorf(
			"unable to delete ref %q from bucket %q: %s", ref, s.bucketName, err))
	}
	return nil
}

// Close implements Storage.
func (s *s3Impl) Close() {
	// Not much to do, the S3 service doesn't require any cleanup.
	s.service = nil
	s.bucketName = ""
}


text:
module Heathen

  class Executioner
    attr_reader :logger, :last_exit_status, :last_messages, :last_command,
      :stdout, :stderr

    def initialize(log)
      @logger = log
    end

    def execute(*argv)
      options = argv.last.class == Hash ? argv.pop : {}

      started = Time.now.to_f

      command = argv.map(&:to_s)

      pid, status, @stdout, @stderr = _execute(*command, options)

      elapsed = Time.now.to_f - started

      if status != 0
        logger.error "[#{pid}] exited with status #{status.inspect}"
      end
      logger.info("[#{pid}] completed in %02.4f" % elapsed)

      logger.info "  stdout: '#@stdout'\n" unless @stdout.blank? unless options[:binary]
      logger.info "  stderr: '#@stderr'\n" unless @stderr.blank?

      @last_exit_status = status
      @last_messages = {stdout: @stdout, stderr: @stderr}
      @last_command = command.join(' ')

      return status
    end

    if RUBY_PLATFORM == 'java'
      # Executes the given argument vector with ProcessBuilder.
      # Returns the pid and exit status as Numeric, stdout and
      # stderr as Strings.
      #
      def _execute(*argv, options)

        builder = java.lang.ProcessBuilder.new
        builder.command(argv)

        if options[:dir]
          dir = java.io.File.new(options[:dir])
          builder.directory(dir)
        end

        process = builder.start()

        # Dirty hack, works on UNIX only.
        pid = if process.is_a?(Java::JavaLang::UNIXProcess)
          prop = process.get_class.get_declared_field('pid')
          prop.set_accessible true
          prop.get_int(process)
        end

        logger.info "[#{pid}] spawn '#{argv.join(' ')}'"

        stdout = process.get_input_stream.to_io
        stderr = process.get_error_stream.to_io

        if options[:binary]
          stdout.binmode
          stderr.binmode
        end

        wait_thr = Thread.new { process.wait_for; process.exit_value }

        out = Thread.new { stdout.read }.value
        err = Thread.new { stderr.read }.value

        [pid, wait_thr.value, out, err]
      end

    else
      require 'open3'

      # Executes the given argument vector with Open3.popen3.
      # Returns the pid and exit status as Numeric, stdout and
      # stderr as Strings.
      #
      def _execute(*argv, options)
        command = argv.shift

        Open3.popen3(ENV, [ command, "heathen: #{command}" ], *argv,
          :chdir => options[:dir] || Dir.getwd
        ) do |stdin, stdout, stderr, wait_thr|
          pid = wait_thr[:pid]
          logger.info "[#{pid}] spawn '#{command} #{argv.join(' ')}'"

          stdin.close

          if options[:binary]
            stdout.binmode
            stderr.binmode
          end

          out = Thread.new { stdout.read }.value
          err = Thread.new { stderr.read }.value

          [pid, wait_thr.value, out, err]
        end
      end
    end

    def quartering(heretics)
      @heretics = heretics
      parallel  = (@heretics.size > 4 ? 4 : @heretics.size)

      parallel.times.collect do
        guilty = @heretics.shift
        Thread.fork { slaughter guilty }
      end.map(&:join)
    end

    protected
      def slaughter guilty
        execute(*guilty)
        slaughter(@heretics.shift) unless @heretics.size.zero?
      end
  end
end


text:
* `ACME_CA_URI` - Directory URI for the CA ACME API endpoint (defaults to ``https://acme-v02.api.letsencrypt.org/directory``).

If you set this environment variable value to `https://acme-staging-v02.api.letsencrypt.org/directory` the container will obtain its certificates from Let's Encrypt test API endpoint that don't have the [5 certs/week/domain limit](https://letsencrypt.org/docs/rate-limits/) (but are not trusted by browsers).

For example

```bash
$ docker run --detach \
    --name nginx-proxy-letsencrypt \
    --volumes-from nginx-proxy \
    --volume /path/to/certs:/etc/nginx/certs:rw \
    --volume /var/run/docker.sock:/var/run/docker.sock:ro \
    --env "ACME_CA_URI=https://acme-staging-v02.api.letsencrypt.org/directory" \
    jrcs/letsencrypt-nginx-proxy-companion
```
You can also create test certificates per container (see [Test certificates](./Let's-Encrypt-and-ACME.md#test-certificates))

* `DEBUG` - Set it to `true` to enable debugging output one the container logs, which could help you troubleshoot configuration issues.

* `REUSE_ACCOUNT_KEYS` - Set it to `false` to disable the account keys and account registrations reutilization (see [ACME account keys](./Let's-Encrypt-and-ACME.md#disable-account-re-utilization)).

* `REUSE_PRIVATE_KEYS` - Set it to `true` to make `simp_le` reuse previously generated private key for each certificate instead of creating a new one on certificate renewal. Recommended if you intend to use [HPKP](https://developer.mozilla.org/en-US/docs/Web/HTTP/Public_Key_Pinning) (please not however that HPKP has been deprecated by Google's Chrome and that its use is therefore not recommended).

* `DHPARAM_BITS` - Change the size of the Diffie-Hellman key generated by the container from the default value of 2048 bits. For example `--env DHPARAM_BITS=1024` to support some older clients like Java 6 and 7.


text:
FROM frolvlad/alpine-oraclejdk8:slim
VOLUME /tmp
LABEL Vendor="EasyFrame" easyframe-serv="ef-zuul"
ADD target/easyframe-zuul-master-SNAPSHOT-exec.jar zuul.jar
RUN sh -c 'touch /zuul.jar'

ENV JAVA_OPTS="-server -Xmx512m -Xms512m -XX:NewRatio=1 -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 \
-XX:+UseCMSInitiatingOccupancyOnly -XX:+ParallelRefProcEnabled -XX:+AlwaysPreTouch -XX:ReservedCodeCacheSize=128M \
-XX:MaxTenuringThreshold=6 -XX:+ExplicitGCInvokesConcurrent -Duser.timezone=Asia/Shanghai"

ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /zuul.jar" ]