text:
/*
 * Sorted sets
 *
 * Run
 * ---
 *
 * node sorted_set.js
 *
 * Expected output
 * ---------------
 *
 * --- BEGIN ---
 * zadd: tags:category=startups (3)
 * zadd: tags:category=startups (3)
 * zadd: tags:category=marketing (3)
 * zcard: tags:category=startups 6
 * zcount: tags:category=startups 5
 * zincrby: tags:category=marketing Growth (414)
 * zinterstore: tags:category=startups tags:category=marketing = 2
 * zrange: tags:category=common Growth,Customers
 * zrevrange: tags:category=common Customers,Growth
 * zadd: tags 3
 * zadd: tags 3
 * zadd: tags 3
 * zadd: tags 3
 * zrange: tags (Awareness,Customer Knowledge,Customers,Founders,Funding,Go To Market,Growth,Hiring,Market Knowledge,Product/Market Fix,Strategy,Traction)
 * zlexcount: tags [A to [I 8
 * zrangebylex: tags from [A to [I Awareness,Customer Knowledge,Customers,Founders,Funding,Go To Market,Growth,Hiring
 * zrevrangebylex: tags from [I to [A Hiring,Growth,Go To Market,Funding,Founders,Customers,Customer Knowledge,Awareness
 * zrangebyscore: tags:category=startups from 1 to 50 Traction,1,Growth,25,Funding,31
 * zrevrangebyscore: tags:category=startups from 500 to 50 Product/Market Fit,321,Customers,67,Market Knowledge,56
 * zrank: tags:category=startups Customers 4
 * zrevrank: tags:category=startups Customers 1
 * zscore: tags:category=startups Customers 67
 * zunionstore: tags:category=union
 * zrange: tags:category=union Traction,Funding,Market Knowledge,Awareness,Product/Market Fit,Growth,Customers
 * zscan: tags:category=union *o* 0,Traction,1,Market Knowledge,56,Product/Market Fit,321,Growth,439,Customers,742
 * zrem: tags:category=union Product/Market Fit (1)
 * zrange: tags:category=union Traction,1,Funding,31,Market Knowledge,56,Awareness,233,Growth,439,Customers,742
 * zremrangebylex: tags [A to [H (7)
 * zrange: tags Hiring,1,Market Knowledge,1,Product/Market Fix,1,Strategy,1,Traction,1
 * zremrangebyrank: tags:category=union 0 to 0 (1)
 * zrange: tags:category=union Funding,31,Market Knowledge,56,Awareness,233,Growth,439,Customers,742
 * zremrangebyscore: tags:category=union 400 to 900 (2)
 * zrange: tags:category=union Funding,31,Market Knowledge,56,Awareness,233
 * --- END ---
 *
 * Commands used in this file
 * --------------------------
 *
 * [x] ZADD: Save one or more new members to a sorted set, or update a member's
 *     score if it already exists in the sorted set
 * [x] ZCARD: Get the number of members in a sorted set
 * [x] ZCOUNT: Get the number of members with a score between the min and max
 *     value specified
 * [x] ZINCRBY: Increment the score of a member
 * [x] ZINTERSTORE: Save the intersection between two or more sets in a new set
 * [x] ZLEXCOUNT: Get the number of members between a lexicographical range
 * [x] ZRANGE: Get members within an indexed range sorted low to high
 * [x] ZREVRANGE: Get members within an indexed range sorted high to low
 * [x] ZRANGEBYLEX: Get members within a lexicographical range sorted low to high
 * [x] ZREVRANGEBYLEX: Get members within a lexicographical range sorted high to low
 * [x] ZRANGEBYSCORE: Get members who's scores are within the specified ranged
 *     sorted low to high
 * [x] ZREVRANGEBYSCORE: Get members who's scores are within the specified ranged
 *     sorted high to low
 * [x] ZRANK: Get the index of a member
 * [x] ZREVRANK: Get the index of a member when the sorted set is sorted high to low
 * [x] ZREM: Remove one or more members from a sorted set
 * [x] ZREMRANGEBYLEX: Delete members within a lexicographical range
 * [x] ZREMRANGEBYRANK: Delete members within the specified indexes
 * [x] ZREMRANGEBYSCORE: Delete members who's scores are within the specified
 *     range
 * [x] ZSCORE: Get the score of a member
 * [x] ZUNIONSTORE: Save the union of one or more sorted sets in a new
 *     sorted set
 * [x] ZSCAN: Iterate over the members of the sorted set
 */

var redis = require('redis');

// Connect to a DynomiteDB cluster
// var db = redis.createClient(8102, 'localhost');

// Connect to a local dynomitedb-redis instance
// var db = redis.createClient(22122, 'localhost');

// Connect to a single server Redis instance
var db = redis.createClient(6379, 'localhost');
var startupTagsKey = 'tags:category=startups';
var marketingTagsKey = 'tags:category=marketing';
var commonTagsKeys = 'tags:category=common';
var unionTagsKey = 'tags:category=union';
var allTags = 'tags';

db.on('error', function(err) {
    console.log(err);
    process.exit(1);
});

/*
 * Wait until we're connected to the Dynomite server before we issue commands
 */
db.on('connect', function() {
    // Let's add some keys
    console.log('--- BEGIN ---');
    createStartupTags(startupTagsKey,
        31, 'Funding',
        25, 'Growth',
        67, 'Customers',
        true);
});

function createStartupTags(key, scoreA, memA, scoreB, memB, scoreC, memC, re) {
    db.zadd(key, scoreA, memA, scoreB, memB, scoreC, memC, function(err, reply) {
        if (err) console.log(err);

        if (reply) {
            console.log('zadd: ' + key + ' (' + reply + ')');
            if (re) {
                addMoreStartTags();
            } else {
                callNext();
            }
        } else {
            console.log('members already exist zadd: ' + key + ' (' + reply + ')');
            if (re) {
                addMoreStartTags();
            } else {
                callNext();
            }
        }

        function addMoreStartTags() {
            createStartupTags(startupTagsKey,
                321, 'Product/Market Fit',
                1, 'Traction',
                56, 'Market Knowledge',
                false);
        }

        function callNext() {
            createMarketingTags(marketingTagsKey,
                409, 'Growth',
                675, 'Customers',
                233, 'Awareness');
        }
    });
}

function createMarketingTags(key, scoreA, memA, scoreB, memB, scoreC, memC) {
    db.zadd(key, scoreA, memA, scoreB, memB, scoreC, memC, function(err, reply) {
        if (err) console.log(err);

        if (reply) {
            console.log('zadd: ' + key + ' (' + reply + ')');
            callNext();
        } else {
            console.log('members already exist zadd: ' + key + ' (' + reply + ')');
            callNext();
        }

        function callNext() {
            countStartupTags(startupTagsKey);
        }
    });
}

function countStartupTags(key) {
    db.zcard(key, function(err, reply) {
        if (err) console.log(err);

        if (reply) {
            console.log('zcard: ' + key + ' ' + reply);
            countStartupTagsWithinScoreRange(startupTagsKey, 1, 100);
        } else {
            console.log('Unable to zcard: ' + key);
        }
    });
}

function countStartupTagsWithinScoreRange(key, min, max) {
    db.zcount(key, min, max, function(err, reply) {
        if (err) console.log(err);

        if (reply) {
            console.log('zcount: ' + key + ' ' + reply);
            incrMarketingGrowth(marketingTagsKey, 5, 'Growth');
        } else {
            console.log('Unable to zcount: ' + key + ' (' + reply + ')');
            db.quit();
        }
    });
}

function incrMarketingGrowth(key, increment, member) {
    db.zincrby(key, increment, member, function(err, reply) {
        if (err) console.log(err);

        if (reply) {
            console.log('zincrby: ' + key + ' ' + member + ' (' + reply + ')');
            createCommonTagsZSet(commonTagsKeys, 2, startupTagsKey, marketingTagsKey);
        } else {
            console.log('Unable to zincrby:  (' + reply + ')');
            db.quit();
        }
    });
}

function createCommonTagsZSet(destination, numKeys, zsetA, zsetB) {
    db.zinterstore(destination, numKeys, zsetA, zsetB, function(err, reply) {
        if (err) console.log(err);

        if (reply) {
            console.log('zinterstore: ' + zsetA + ' ' + zsetB + ' = ' + reply);
            viewAllCommonTags(commonTagsKeys);
        } else {
            console.log('Unable to zinterstore:  (' + reply + ')');
            db.quit();
        }
    });
}

function viewAllCommonTags(key) {
    db.zrange(key, 0, -1, function(err, reply) {
        if (err) console.log(err);

        if (reply) {
            console.log('zrange: ' + key + ' ' + reply);
            viewAllCommonTagsRev(commonTagsKeys);
        } else {
            console.log('Unable to zrange:  (' + reply + ')');
            db.quit();
        }
    });
}

function viewAllCommonTagsRev(key) {
    db.zrevrange(key, 0, -1, function(err, reply) {
        if (err) console.log(err);

        if (reply) {
            console.log('zrevrange: ' + key + ' ' + reply);
            createTagsZSet(allTags, 1, 'Funding', 1, 'Growth', 1, 'Customers', 1);
        } else {
            console.log('Unable to zrevrange:  (' + reply + ')');
            db.quit();
        }
    });
}

function createTagsZSet(key, scoreA, memA, scoreB, memB, scoreC, memC, iteration) {
    db.zadd(key, scoreA, memA, scoreB, memB, scoreC, memC, function(err, reply) {
        if (err) console.log(err);

        if (reply) {
            console.log('zadd: ' + key + ' ' + reply);

            if (iteration >= 1 && iteration <= 3) {
                addMoreTags(iteration);
            } else {
                viewAllTagsZSet(allTags);
            }
        } else {
            console.log('Unable to zadd: ' + key);
            if (iteration >= 1 && iteration <= 3) {
                addMoreTags(iteration);
            } else {
                db.quit();
            }
        }

        function addMoreTags(iteration) {
            if (iteration === 1) {
                createTagsZSet(allTags,
                    1, 'Go To Market',
                    1, 'Strategy',
                    1, 'Customer Knowledge',
                    2);
            } else if (iteration === 2) {
                createTagsZSet(allTags,
                    1, 'Product/Market Fix',
                    1, 'Traction',
                    1, 'Market Knowledge',
                    3);
            } else if (iteration === 3) {
                createTagsZSet(allTags,
                    1, 'Awareness',
                    1, 'Founders',
                    1, 'Hiring',
                    4);
            }
        }
    });
}

function viewAllTagsZSet(key) {
    db.zrange(key, 0, -1, function(err, reply) {
        if (err) console.log(err);

        if (reply) {
            console.log('zrange: ' + key + ' (' + reply + ')');
            countAllTagsAtoI(allTags, '[A', '[I');
        } else {
            console.log('Unable to zrange:  (' + reply + ')');
            db.quit();
        }
    });
}

function countAllTagsAtoI(key, min, max) {
    db.zlexcount(key, min, max, function(err, reply) {
        if (err) console.log(err);

        if (reply) {
            console.log('zlexcount: ' + key + ' ' + min + ' to ' + max + ' ' + reply);
            getAllTagsAtoI(allTags, '[A', '[I');
        } else {
            console.log('Unable to zlexcount: ' + key);
            db.quit();
        }
    });
}

function getAllTagsAtoI(key, min, max) {
    db.zrangebylex(key, min, max, function(err, reply) {
        if (err) console.log(err);

        if (reply) {
            console.log('zrangebylex: ' + key + ' from ' + min + ' to ' + max + ' ' + reply);
            getAllTagsItoA(allTags, '[I', '[A');
        } else {
            console.log('Unable to zrangebylex: ' + key);
            db.quit();
        }
    });
}

function getAllTagsItoA(key, max, min) {
    db.zrevrangebylex(key, max, min, function(err, reply) {
        if (err) console.log(err);

        if (reply) {
            console.log('zrevrangebylex: ' + key + ' from ' + max + ' to ' + min + ' ' + reply);
            getStartupTags1to50(startupTagsKey, 1, 50, 'WITHSCORES');
        } else {
            console.log('Unable to zrevrangebylex: ' + key);
            db.quit();
        }
    });
}

function getStartupTags1to50(key, min, max, withscores) {
    db.zrangebyscore(key, min, max, withscores, function(err, reply) {
        if (err) console.log(err);

        if (reply) {
            console.log('zrangebyscore: ' + key + ' from ' + min + ' to ' + max + ' ' + reply);
            getStartupTags500to50(startupTagsKey, 500, 50, 'WITHSCORES');
        } else {
            console.log('Unable to zrangebyscore: ' + key);
            db.quit();
        }
    });
}

function getStartupTags500to50(key, max, min, withscores) {
    db.zrevrangebyscore(key, max, min, withscores, function(err, reply) {
        if (err) console.log(err);

        if (reply) {
            console.log('zrevrangebyscore: ' + key + ' from ' + max + ' to ' + min + ' ' + reply);
            getMemberRank(startupTagsKey, 'Customers');
        } else {
            console.log('Unable to zrevrangebyscore: ' + key);
            db.quit();
        }
    });
}

function getMemberRank(key, member) {
    db.zrank(key, member, function(err, reply) {
        if (err) console.log(err);

        if (reply) {
            console.log('zrank: ' + key + ' ' + member + ' ' + reply);
            getMemberRevRank(startupTagsKey, 'Customers');
        } else {
            console.log('Unable to zrank: ' + key);
            db.quit();
        }
    });
}

function getMemberRevRank(key, member) {
    db.zrevrank(key, member, function(err, reply) {
        if (err) console.log(err);

        if (reply) {
            console.log('zrevrank: ' + key + ' ' + member + ' ' + reply);
            getCustomersScore(startupTagsKey, 'Customers');
        } else {
            console.log('Unable to zrevrank: ' + key + ' (' + reply + ')');
            db.quit();
        }
    });
}

function getCustomersScore(key, member) {
    db.zscore(key, member, function(err, reply) {
        if (err) console.log(err);

        if (reply) {
            console.log('zscore: ' + key + ' ' + member + ' ' + reply);
            combineStartupsMarketing(unionTagsKey, 2, startupTagsKey, marketingTagsKey);
        } else {
            console.log('Unable to zscore: ' + key + ' (' + reply + ')');
            db.quit();
        }
    });
}

function combineStartupsMarketing(key, numKeys, keyA, keyB) {
    db.zunionstore(key, numKeys, keyA, keyB, function(err, reply) {
        if (err) console.log(err);

        if (reply) {
            console.log('zunionstore: ' + key);
            viewUnionTags(unionTagsKey);
        } else {
            console.log('Unable to zunionstore: ' + key + ' (' + reply + ')');
            db.quit();
        }
    });
}

function viewUnionTags(key) {
    db.zrange(key, 0, -1, function(err, reply) {
        if (err) console.log(err);

        if (reply) {
            console.log('zrange: ' + key + ' ' + reply);
            scanUnionTags(unionTagsKey, 0, '*o*');
        } else {
            console.log('Unable to zrange: ' + key + ' (' + reply + ')');
            db.quit();
        }
    });
}

function scanUnionTags(key, cursor, pattern) {
    db.zscan(key, cursor, 'MATCH', pattern, function(err, reply) {
        if (err) console.log(err);

        if (reply) {
            console.log('zscan: ' + key + ' ' + pattern + ' ' + reply);
            removePMFit(unionTagsKey, 'Product/Market Fit');
        } else {
            console.log('Unable to zscan: ' + key + ' (' + reply + ')');
            db.quit();
        }
    });
}

function removePMFit(key, member) {
    db.zrem(key, member, function(err, reply) {
        if (err) console.log(err);

        if (reply) {
            console.log('zrem: ' + key + ' ' + member + ' (' + reply + ')');
            viewUnionTagsAfterRemove(unionTagsKey);
        } else {
            console.log('Unable to zrem: ' + key + ' (' + reply + ')');
            db.quit();
        }
    });
}

function viewUnionTagsAfterRemove(key) {
    db.zrange(key, 0, -1, 'WITHSCORES', function(err, reply) {
        if (err) console.log(err);

        if (reply) {
            console.log('zrange: ' + key + ' ' + reply);
            removeAtoHUnionTags(allTags, '[A', '[H');
        } else {
            console.log('Unable to zrange: ' + key + ' (' + reply + ')');
            db.quit();
        }
    });
}

function removeAtoHUnionTags(key, min, max) {
        db.zremrangebylex(key, min, max, function(err, reply) {
        if (err) console.log(err);

        if (reply) {
            console.log('zremrangebylex: ' + key + ' ' + min + ' to ' + max + ' (' + reply + ')');
            viewAllTagsAfterRemoveAtoH(allTags);
        } else {
            console.log('Unable to zremrangebylex: ' + key + ' (' + reply + ')');
            db.quit();
        }
    });
}

function viewAllTagsAfterRemoveAtoH(key) {
    db.zrange(key, 0, -1, 'WITHSCORES', function(err, reply) {
        if (err) console.log(err);

        if (reply) {
            console.log('zrange: ' + key + ' ' + reply);
            removeFirstMemberUnionTags(unionTagsKey, 0, 0);
        } else {
            console.log('Unable to zrange: ' + key + ' (' + reply + ')');
            db.quit();
        }
    });
}

function removeFirstMemberUnionTags(key, start, stop) {
    db.zremrangebyrank(key, start, stop, function(err, reply) {
        if (err) console.log(err);

        if (reply) {
            console.log('zremrangebyrank: ' + key + ' ' + start + ' to ' + stop + ' (' + reply + ')');
            viewUnionTagsAfterRemoveFirst(unionTagsKey);
        } else {
            console.log('Unable to zremrangebyrank: ' + key + ' (' + reply + ')');
            db.quit();
        }
    });
}

function viewUnionTagsAfterRemoveFirst(key) {
    db.zrange(key, 0, -1, 'WITHSCORES', function(err, reply) {
        if (err) console.log(err);

        if (reply) {
            console.log('zrange: ' + key + ' ' + reply);
            removeScore400to900MemberUnionTags(unionTagsKey, 400, 900);
        } else {
            console.log('Unable to zrange: ' + key + ' (' + reply + ')');
            db.quit();
        }
    });
}

function removeScore400to900MemberUnionTags(key, min, max) {
    db.zremrangebyscore(key, min, max, function(err, reply) {
        if (err) console.log(err);

        if (reply) {
            console.log('zremrangebyscore: ' + key + ' ' + min + ' to ' + max + ' (' + reply + ')');
            viewUnionTagsAfterRemove400to900(unionTagsKey);
        } else {
            console.log('Unable to zremrangebyscore: ' + key + ' (' + reply + ')');
            db.quit();
        }
    });
}

function viewUnionTagsAfterRemove400to900(key) {
    db.zrange(key, 0, -1, 'WITHSCORES', function(err, reply) {
        if (err) console.log(err);

        if (reply) {
            console.log('zrange: ' + key + ' ' + reply);
            console.log('--- END ---');
            db.quit();
        } else {
            console.log('Unable to zrange: ' + key + ' (' + reply + ')');
            db.quit();
        }
    });
}

redpajama_set_name: RedPajamaGithub


text:
TODO: Select a specific device image for being connected over Ethernet, USB, or WiFi.  Have it detect whether or not the Ethernet cable should be plugged in by determining if the device has an IP address.  WiFi antenna should always be displayed for T7-Pro. Use image w/ shadows removed like T4 image.

Device Overview

			General

				Serial Number:
				{{serialNumber}}

				Model:
				{{productType}}

				Name:

					{{DEVICE_NAME_DEFAULT}}
					<button id="change-name-link" class="icon-pencil btn btn-link" title="Edit Device Name"></button>
					{{!--
<button id="change-name-link" class="btn">Change Name</button>
--}}

<input type="text" id="new-name-input" placeholder="new name">

							<button id="change-name-button" class="btn">Change Name</button>
							<button id="cancel-change-name-button" class="btn">Cancel</button>

			Ethernet Mac Address:

				{{ETHERNET_MAC.val}}

		{{#if HARDWARE_INSTALLED.wifi }}

			WiFi Mac Address:

				{{WIFI_MAC.val}}

		{{/if}}

			200 uA Current Source Cal:

				{{CURRENT_SOURCE_200UA_CAL_VALUE.val}} uA

			10 uA Current Source Cal:

				{{CURRENT_SOURCE_10UA_CAL_VALUE.val}} uA

		{{!-- {{#unless calibrationStatus.overall}}
		{{#if calibrationStatus}}

			Calibration Status:

				{{calibrationStatus.shortMessage}}

		{{/if}}
		{{/unless}} --}}
		{{#if hwIssues}}

		{{#unless hwIssues.overallResult}}

			Hardware Status:

				{{hwIssues.shortMessage}}

		{{#each hwIssues.testResults}}
		{{#unless status}}

			{{name}}

- {{testMessage}}

		{{/unless}}
		{{/each}}

			Possible hardware issues have been detected, please click here for more details.

		{{/unless}}

		{{/if}}

			Versions

			Hardware Version:

					{{HARDWARE_VERSION.str}}

			Firmware Version:

					{{FIRMWARE_VERSION}}

			Bootloader Version:

					{{BOOTLOADER_VERSION}}

		{{#if HARDWARE_INSTALLED.wifi }}

			WiFi Firmware Version:

				{{WIFI_VERSION}}

		{{/if}}

			Recovery Firmware Version:

					{{recoveryFirmwareVersion.val}}

			Current Status

			Ethernet IP Address:

				{{#if ETHERNET_IP.isReal}}{{ETHERNET_IP.val}}{{else}}Not Connected{{/if}}

		{{#if HARDWARE_INSTALLED.wifi }}

			WiFi IP Address:

				{{#if WIFI_IP.isReal}}{{WIFI_IP.val}}{{else}}Not Connected{{/if}}

		{{/if}}

			Device Temperature:

				{{TEMPERATURE_DEVICE_K.val}}
			 K

			Hardware Installed

				SD Card {{#if HARDWARE_INSTALLED.sdCard }}Installed{{/if}} {{#unless HARDWARE_INSTALLED.sdCard}}Not Installed{{/unless}}

			{{#if isPro}}

				High Res ADC {{#if HARDWARE_INSTALLED.highResADC }}Installed{{/if}} {{#unless HARDWARE_INSTALLED.highResADC}}Not Installed{{/unless}}

				Real Time Clock {{#if HARDWARE_INSTALLED.rtc }}Installed{{/if}} {{#unless HARDWARE_INSTALLED.rtc}}Not Installed{{/unless}}

				WiFi {{#if HARDWARE_INSTALLED.wifi }}Installed{{/if}} {{#unless HARDWARE_INSTALLED.wifi}}Not Installed{{/unless}}

			{{/if}}

			Enabled Features

 Ethernet {{#if POWER_ETHERNET.val }}Powered{{/if}} {{#unless POWER_ETHERNET.val}}Not Powered{{/unless}}

			{{#if isPro}}

 WiFi {{#if POWER_WIFI.val }}Powered{{/if}} {{#unless POWER_WIFI.val}}Not Powered{{/unless}}

			{{/if}}

 Analog Input Module {{#if POWER_AIN.val }}Powered{{/if}} {{#unless POWER_AIN.val}}Not Powered{{/unless}}

 Watchdog {{#if WATCHDOG_ENABLE_DEFAULT.val }}Enabled{{/if}} {{#unless WATCHDOG_ENABLE_DEFAULT.val}}Disabled{{/unless}}

 Device LED {{#if POWER_LED.val }}Powered{{/if}} {{#unless POWER_LED.val}}Not Powered{{/unless}}

		{{#if HARDWARE_INSTALLED.sdCard }}

			SD Card Info

			Free Space:

				{{diskInfo.freeSpace.str}}

			Total Size:

				{{diskInfo.totalSize.str}}

			File System:

				{{diskInfo.fileSystem}}

		{{/if}}

			Current Time

			Device Time:

				{{RTC_TIME_S.t7TimeStr}}

			System Time:

				{{RTC_TIME_S.pcTimeStr}}

			SNTP Update Interval:

				{{SNTP_UPDATE_INTERVAL.str}}

		<button id="set_rtc_time" class="btn btn-mini">Set Device Time to System Time.</button>

		{{#unless HARDWARE_INSTALLED.rtc }}

			Device time is not kept by a battery-backed
 RTC. It will be reset on power-cycle!

		{{/unless}}

	{{#if enableBetaFeatures}}
	{{/if}}
	{{#if isPlatformWindows}}

Launch Applications

			<button class="btn btn-mini dropdown-toggle" data-toggle="dropdown" href="#" title="Open the LJLogM app after configuring the _open.cgf file.">

LJLogM

			</button>

				{{#if availableConnections.isUSB}}

USB

				{{/if}}
				{{#if availableConnections.isEth}}

Ethernet

				{{/if}}
				{{#if availableConnections.isWiFi}}

WiFi

				{{/if}}

			<button class="btn btn-mini dropdown-toggle" data-toggle="dropdown" href="#" title="Open the LJStreamM app after configuring the _open.cgf file.">

LJStreamM

			</button>

				{{#if availableConnections.isUSB}}

USB

				{{/if}}
				{{#if availableConnections.isEth}}

Ethernet

				{{/if}}
				{{#if availableConnections.isWiFi}}

WiFi
{{/if}}

	{{/if}}

{{deviceTypeName}} Support Resources

Important {{deviceTypeName}} Website Links

Product Page

Getting Started/Quickstart

Datasheet

Lua Scripting

Support

Firmware Changelog

Other {{deviceTypeName}} Applications

LJLogM- data logging

LJStreamM- high speed data logging

T7 microSD Card Utility- file downloader

Example Code

C/C++

LabVIEW

Python

DAQFactory

Java

.NET(C#,VB)

Node.js

More

Lua Script Examples

Lua Scripting

Programming Resources

LJM Modbus Map

LJM Library Docs

Note 1: Clicking on these links will open up your computer's default web browser and take you to the labjack.com website.

	Note 2: When running a secondary application (LJLogM/LJStreamM) you may need to close the application in order for it to be used in Kipling again.

	{{#if enableBetaFeatures}}
	{{#if isPlatformWindows}}

Beta Features

Windows Application Shortcuts

LJLogM- data logging

LJStreamM- high speed data logging

If these applications aren't properly opening a device edit the appropriate _open.cfg file (links below) to instruct them to open the correct device.

Configuration Files for Logging Applications

LJLogM_open.cfg

LJLogM.cfg

LJStreamM_open.cfg

LJStreamM.cfg

	{{/if}}
	{{/if}}

TODO: Add button/config-tool that lets user configure LJLogM/LJStreamM to open the currently connected device.  Consider just opening the file in a user's default text editor and telling them what the file path is.  The tool can automatically search the user's Let the user configure Kipling to remember where each application's default directory is.  You can do this by running a bash command: http://stackoverflow.com/questions/8066679/how-to-do-a-simple-file-search-in-cmd, On Windows: "dir /b/s LJLogM.cfg".	Add a quick-disconnect/re-connect button to the module-header section.  Add an Open-Application button for LJLogM/LJStreamM/T7uSDCardUtility.

{{!--
{{printContext}}
--}}


text:
using content::RenderView;
using content::RenderThread;
using content::V8ValueConverter;
using WebKit::WebFrame;
using WebKit::WebView;

namespace {
RenderView* GetRenderView(v8::Handle<v8::Context> ctx) {
  WebFrame* frame = WebFrame::frameForContext(ctx);
  if (!frame)
    return NULL;

  WebView* view = frame->view();
  if (!view)
    return NULL;  // can happen during closing.

  RenderView* render_view = RenderView::FromWebView(view);
  return render_view;
}

}

RenderView* GetCurrentRenderView() {
  v8::Local<v8::Context> ctx = v8::Context::GetCurrent();
  return GetRenderView(ctx);
}

RenderView* GetEnteredRenderView() {
  v8::Local<v8::Context> ctx = v8::Context::GetEntered();
  return GetRenderView(ctx);
}

base::StringPiece GetStringResource(int resource_id) {
  return ResourceBundle::GetSharedInstance().GetRawDataResource(resource_id);
}

namespace remote {

v8::Handle<v8::Value> AllocateId(int routing_id) {
  v8::HandleScope scope;

  int result = 0;
  RenderThread::Get()->Send(new ShellViewHostMsg_AllocateId(
      routing_id,
      &result));
  return scope.Close(v8::Integer::New(result));
}

v8::Handle<v8::Value> AllocateObject(int routing_id,
                                     int object_id,
                                     const std::string& type,
                                     v8::Handle<v8::Value> options) {
  v8::HandleScope handle_scope;

  scoped_ptr<V8ValueConverter> converter(V8ValueConverter::create());
  converter->SetStripNullFromObjects(true);

  scoped_ptr<base::Value> value_option(
      converter->FromV8Value(options, v8::Context::GetCurrent()));
  if (!value_option.get() ||
      !value_option->IsType(base::Value::TYPE_DICTIONARY))
    return v8::ThrowException(v8::Exception::Error(v8::String::New(
        "Unable to convert 'option' passed to AllocateObject")));

  DVLOG(1) << "remote::AllocateObject(routing_id=" << routing_id << ", object_id=" << object_id << ")";

  RenderThread::Get()->Send(new ShellViewHostMsg_Allocate_Object(
      routing_id,
      object_id,
      type,
      *static_cast<base::DictionaryValue*>(value_option.get())));
  return v8::Undefined();
}

v8::Handle<v8::Value> DeallocateObject(int routing_id,
                                       int object_id) {
  RenderThread::Get()->Send(new ShellViewHostMsg_Deallocate_Object(
      routing_id, object_id));
  return v8::Undefined();
}

v8::Handle<v8::Value> CallObjectMethod(int routing_id,
                                       int object_id,
                                       const std::string& type,
                                       const std::string& method,
                                       v8::Handle<v8::Value> args) {
  scoped_ptr<V8ValueConverter> converter(V8ValueConverter::create());

  scoped_ptr<base::Value> value_args(
      converter->FromV8Value(args, v8::Context::GetCurrent()));
  if (!value_args.get() ||
      !value_args->IsType(base::Value::TYPE_LIST))
    return v8::ThrowException(v8::Exception::Error(v8::String::New(
        "Unable to convert 'args' passed to CallObjectMethod")));

  RenderThread::Get()->Send(new ShellViewHostMsg_Call_Object_Method(
      routing_id,
      object_id,
      type,
      method,
      *static_cast<base::ListValue*>(value_args.get())));
  return v8::Undefined();
}

v8::Handle<v8::Value> CallObjectMethodSync(int routing_id,
                                           int object_id,
                                           const std::string& type,
                                           const std::string& method,
                                           v8::Handle<v8::Value> args) {
  scoped_ptr<V8ValueConverter> converter(V8ValueConverter::create());

  scoped_ptr<base::Value> value_args(
      converter->FromV8Value(args, v8::Context::GetCurrent()));
  if (!value_args.get() ||
      !value_args->IsType(base::Value::TYPE_LIST))
    return v8::ThrowException(v8::Exception::Error(v8::String::New(
        "Unable to convert 'args' passed to CallObjectMethodSync")));

  base::ListValue result;
  RenderThread::Get()->Send(new ShellViewHostMsg_Call_Object_Method_Sync(
      routing_id,
      object_id,
      type,
      method,
      *static_cast<base::ListValue*>(value_args.get()),
      &result));
  return converter->ToV8Value(&result, v8::Context::GetCurrent());
}

}  // namespace remote


text:
FROM alpine
MAINTAINER Tairy <tairyguo@gmail.com>

ENV TIMEZONE Asia/Shanghai

RUN echo "http://mirrors.aliyun.com/alpine/v3.4/main" > /etc/apk/repositories \
  && echo "http://mirrors.aliyun.com/alpine/v3.4/community" >> /etc/apk/repositories

RUN apk update && \
  apk upgrade && \
  apk add --update tzdata && \
  cp /usr/share/zoneinfo/${TIMEZONE} /etc/localtime && \
  echo "${TIMEZONE}" > /etc/timezone

RUN apk --update add wget \
  curl \
  git \
  grep \
  gmp-dev \
  libmcrypt-dev \
  freetype-dev \
  libxpm-dev \
  libwebp-dev \
  libjpeg-turbo-dev \
  libjpeg \
  bzip2-dev \
  openssl-dev \
  krb5-dev \
  libxml2-dev \
  build-base \
  tar \
  make \
  autoconf

RUN apk --update add re2c bison curl-dev

RUN rm /var/cache/apk/*
ADD php-src /php-src
ADD script/install-php.sh /
ADD config/php.ini /
RUN chmod +x ./install-php.sh
RUN ./install-php.sh
RUN rm -rf /php-src
RUN mkdir -p /working
WORKDIR /working

# RUN pecl install mongodb-1.1.8

EXPOSE 80 443
CMD ["nginx", "-g", "daemon off;"]


text:
def barrier(*args):
    return None

def getitem(x, key):
    """Like :func:`operator.getitem`, but allows setting key using partial
    ``partial(chunk.getitem, key=key)
    """
    return x[key]

def foldby_combine2(combine, acc, x):
    return combine(acc, x[1])

def groupby_tasks_group_hash(x, hash, grouper):
    return hash(grouper(x)), x

def var_chunk(seq):
    squares, total, n = 0.0, 0.0, 0
    for x in seq:
        squares += x ** 2
        total += x
        n += 1
    return squares, total, n

def var_aggregate(x, ddof):
    squares, totals, counts = list(zip(*x))
    x2, x, n = float(sum(squares)), float(sum(totals)), sum(counts)
    result = (x2 / n) - (x / n) ** 2
    return result * n / (n - ddof)


text:
@javax.xml.bind.annotation.XmlSchema(namespace = "http://ws.cdyne.com/WeatherWS/", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package ws.wsf.cdyne.com;


text:
import javax.inject.Inject

import play.api.http._
import play.api.mvc._
import play.api.routing.Router

/**
  * Handles all requests.
  *
  * https://www.playframework.com/documentation/2.5.x/ScalaHttpRequestHandlers#extending-the-default-request-handler
  */
class RequestHandler @Inject()(router: Router,
                               errorHandler: HttpErrorHandler,
                               configuration: HttpConfiguration,
                               filters: HttpFilters)
    extends DefaultHttpRequestHandler(router,
                                      errorHandler,
                                      configuration,
                                      filters) {

  override def handlerForRequest(request: RequestHeader): (RequestHeader, Handler) = {
    super.handlerForRequest {
      // ensures that REST API does not need a trailing "/"
      if (isREST(request)) {
        addTrailingSlash(request)
      } else {
        request
      }
    }
  }

  private def isREST(request: RequestHeader) = {
    request.uri match {
      case uri: String if uri.contains("post") => true
      case _ => false
    }
  }

  private def addTrailingSlash(origReq: RequestHeader): RequestHeader = {
    if (!origReq.path.endsWith("/")) {
      val path = origReq.path + "/"
      if (origReq.rawQueryString.isEmpty) {
        origReq.copy(path = path, uri = path)
      } else {
        origReq.copy(path = path, uri = path + s"?${origReq.rawQueryString}")
      }
    } else {
      origReq
    }
  }
}


text:
function [ mission_text ] = submission_ending()
%SUBMISSION_ENDING Summary of this function goes here
%   Detailed explanation goes here

mission_text = '\t</submission>\n';
end


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.dispositivoscdweb.configuracoes;

import br.com.dispositivoscdweb.processos.RegistraDispositivo;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;

/**
 *
 * @author Willian
 */
public class DispositivosCDWEB {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws InterruptedException {
        if(args.length>0){
            Configuracoes.INSTANCE.setName(args[0]);
        }

        ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(5);
        ScheduledFuture scheduledFuture = scheduledExecutorService.scheduleWithFixedDelay(new RegistraDispositivo(), 5,5, TimeUnit.SECONDS);

//        Thread.sleep(10000);
    }

}


text:
module("Keyboard");

(function () {

test("Document keypress event binding", function () {
    /* Initialization */
    $('#t').append('<img id="test-img" src="data/elephant.jpg" />');

    stop();

    var keyPressed = false;

    $(document).bind('keydown keypress', function () {
        keyPressed = true;
    });

    $('#test-img').imgAreaSelect({
        onInit: function (img, selection) {
            $(document).keydown();
            $(document).keypress();

            ok(keyPressed, 'Check if the original document keypress/keydown ' +
                'event handler is called after plugin initialization');

            $('#test-img').imgAreaSelect({ remove: true });
            testCleanup();

            start();
        }
    });
});

})();


text:
namespace KnowledgeSpreadSystem.Web.Areas.Administration.Controllers
{
    using System;
    using System.Collections;
    using System.Web.Mvc;

    using AutoMapper.QueryableExtensions;

    using Kendo.Mvc.UI;

    using KnowledgeSpreadSystem.Data;
    using KnowledgeSpreadSystem.Models;
    using KnowledgeSpreadSystem.Web.Areas.Administration.Controllers.Base;
    using KnowledgeSpreadSystem.Web.Areas.Administration.ViewModels.Insight;
    using KnowledgeSpreadSystem.Web.Infrastructure.Extensions;

    public class InsightsController : AdministrationKendoGridController
    {
        // GET: Administration/Insights
        public InsightsController(IKSSData data)
            : base(data)
        {
        }

        [HttpPost]
        public JsonResult Delete([DataSourceRequest] DataSourceRequest request, InsightViewModel model)
        {
            base.Delete<Insight>(model.Id, true);

            return this.GridOperation(model, request);
        }

        [HttpPost]
        public ActionResult Create([DataSourceRequest] DataSourceRequest request, InsightViewModel model)
        {
            model.AuthorId = this.CurrentUser.Id;
            var dbModel = base.Create<Insight>(model);

            model.Id = dbModel != null ? dbModel.Id.ToString() : null;

            return this.GridOperation(model, request);
        }

        [HttpPost]
        public JsonResult Update([DataSourceRequest] DataSourceRequest request, InsightViewModel model)
        {
            base.Update<Insight, InsightViewModel>(model, Guid.Parse(model.Id));

            return this.GridOperation(model, request);
        }

        protected override IEnumerable GetData()
        {
            return this.Data.Insigths
                .All()
                .Project()
                .To<InsightViewModel>()
                .ForEach(
                         x =>
                         {
                             x.Target = x.ModuleId.HasValue
                                            ? this.Data.CourseModules.Find(x.ModuleId.Value).Name + "(module)"
                                            : this.Data.Courses.Find(x.CourseId.Value).Name + "(course)";
                             return x;
                         });
        }
    }
}


text:
package com.github.dockerjava.netty.exec;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.github.dockerjava.api.command.CommitCmd;
import com.github.dockerjava.core.DockerClientConfig;
import com.github.dockerjava.netty.MediaType;
import com.github.dockerjava.netty.WebTarget;

public class CommitCmdExec extends AbstrSyncDockerCmdExec<CommitCmd, String> implements CommitCmd.Exec {

    private static final Logger LOGGER = LoggerFactory.getLogger(CommitCmdExec.class);

    public CommitCmdExec(WebTarget baseResource, DockerClientConfig dockerClientConfig) {
        super(baseResource, dockerClientConfig);
    }

    @Override
    protected String execute(CommitCmd command) {
        WebTarget webTarget = getBaseResource().path("/commit").queryParam("container", command.getContainerId())
                .queryParam("repo", command.getRepository()).queryParam("tag", command.getTag())
                .queryParam("m", command.getMessage()).queryParam("author", command.getAuthor());

        webTarget = booleanQueryParam(webTarget, "pause", command.hasPauseEnabled());

        LOGGER.trace("POST: {}", webTarget);
        ObjectNode objectNode = webTarget.request().accept(MediaType.APPLICATION_JSON)
                .post(command, new TypeReference<ObjectNode>() {
                });

        return objectNode.get("Id").asText();
    }

}


text:
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
 * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *
 *= require_tree .
 *= require_self
 */

 /*
 *= require froala_editor.min.css
 *= require froala_style.min.css
 *= require font-awesome
 */
h2 {
  /*border-style: solid;*/
  border-bottom: thick solid lightblue;
  border-bottom-width: 2px;
  margin-top:2px;
  /*box-shadow: 10px 5px 5px #888888;*/
}

html {
  font-family: 'Reem Kufi', sans-serif;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

/* This is for box-sizing normalization: */
*, *:before, *:after {
  -webkit-box-sizing: inherit;
  -moz-box-sizing: inherit;
  box-sizing: inherit;
  }

body {
  max-width: 1500px;
  background-image: url(/images/wiki.png);
  background-repeat: no-repeat;
  background-position:100% 150%;
  background-attachment: fixed;
}

/* */
label{
  display: block;
}

input{
  margin-bottom: 20px;
  display: block;
}

.no-bullets {
  list-style: none;
}

.container {
  /*margin: auto;*/
  width: 85%;
  padding: 0px 20px 20px 20px;
  border-style: solid;
  border-color: lightgrey;
  float: right;
  border-top: none;
  background-color: white;
}

/* Style the list */
ul.tab {
    list-style-type: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid #ccc;
    background-color: #f1f1f1;
}

/* Float the list items side by side */
ul.tab li {float: left;}

/* Style the links inside the list items */
ul.tab li a {
    display: inline-block;
    color: black;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
    transition: 0.3s;
    font-size: 17px;
}

/* Change background color of links on hover */
ul.tab li a:hover {background-color: #ddd;}

/* Create an active/current tablink class */
ul.tab li a:focus, .active {background-color: #ccc;}

/* Style the tab content */
.tabcontent {
    display: none;
    padding: 6px 12px;
    /*border: 1px solid #ccc;*/
    border-top: none;
    -webkit-animation:fadeEffect 1s;
    animation: fadeEffect 1s;
}
@-webkit-keyframes fadeEffect{
  from {opacity: 0;}
  to {opacity: 1;}
}
@keyframes fadeEffect {
  from {opacity: 0;}
  to {opacity: 1;}
}

.header-banner{
  padding: 20px;
  /* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#000000+0,000000+100&0.14+0,0+85 */
  background: -moz-linear-gradient(top, rgba(0,0,0,0.14) 0%, rgba(0,0,0,0) 85%, rgba(0,0,0,0) 100%); /* FF3.6-15 */
  background: -webkit-linear-gradient(top, rgba(0,0,0,0.14) 0%,rgba(0,0,0,0) 85%,rgba(0,0,0,0) 100%); /* Chrome10-25,Safari5.1-6 */
  background: linear-gradient(to bottom, rgba(0,0,0,0.14) 0%,rgba(0,0,0,0) 85%,rgba(0,0,0,0) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#24000000', endColorstr='#00000000',GradientType=0 ); /* IE6-9 */
}

.pipe-separate {
  padding-left: 1em;
  padding-right: 1em;
  border-right: 1px solid;
  float: left;
}

.pipe-separate:first-of-type {
  padding-left: 0;
}

.pipe-separate:last-of-type {
  padding-right: 0;
  border-right: none;
}

.nav-list{
  list-style-type: none;
  float: right;
  padding-right: 30px;
}

.buttonlink{
  background-color: white;
  border: none;
  padding: 0px 0px;
  color: blue;
  margin-bottom: 0px;
  text-decoration: underline;
}

/*.container {
  margin: 20px auto;
  width: 800px;
  padding: 20px;
  border: 1px solid black;
}*/

.float-left {
  float: left;
}

.submit-tag {
  float: right ;
  margin-left: 10px;
}

.user-page{
  padding: 30px;
}
.il{
  display: inline;
}

#side-bar {
  position: absolute;
  left: 20px;
  width: 15%;
  text-align: left;
}

.margin-left {
  margin-left: 5px;
}

#categories {
  padding-left: 20px;
}
.tabcontent{
  background-color: white;
}

.margin-top{
  margin-top: 10px;
}


text:
layout: page
title: Force Light Corporation Trade Fair
date: 2016-05-24
author: Jason Schroeder
tags: weekly links, java
status: published
summary: Suspendisse pulvinar eget eros in tincidunt.
banner: images/banner/office-01.jpg
booking:
  startDate: 12/25/2016
  endDate: 12/30/2016
  ctyhocn: MIADLHX
  groupCode: FLCTF
published: true
---
Sed nec arcu non eros accumsan tempus id ut quam. Nam tempor tincidunt laoreet. Vivamus efficitur enim vel lacus finibus fringilla. Pellentesque tristique lorem sed dictum lacinia. Integer in consectetur lacus. Praesent ac urna eu felis pellentesque placerat id commodo elit. Morbi gravida turpis urna, vel tincidunt diam mollis vel. In rhoncus odio eget sem maximus, in dictum turpis pharetra. Integer venenatis finibus consectetur. In nisl nulla, dapibus et ullamcorper varius, pulvinar non lacus. Integer mauris libero, mollis ac ante non, pulvinar lobortis lacus. Mauris in orci quis nulla venenatis lobortis sed eu neque. Mauris tristique ex a nisi posuere maximus. Nullam maximus, odio at venenatis malesuada, augue justo feugiat elit, ac pellentesque nibh tortor non nisi. Integer nec augue mattis, tempus leo quis, vehicula dui.

1 Donec nec felis eget tellus porttitor volutpat
1 Proin vestibulum ante viverra pulvinar suscipit.

Etiam id justo vel risus gravida molestie. Sed non mauris augue. Maecenas eleifend, tortor luctus interdum pharetra, odio libero porttitor lectus, vitae volutpat neque lectus at purus. Donec tristique interdum orci quis sodales. Donec luctus nibh vel maximus porttitor. Etiam vehicula nisl id rutrum mollis. Sed venenatis felis a commodo ultricies. Proin sed dui a ante elementum dictum. Proin ultrices orci sed vulputate accumsan. Duis ut leo sapien. Morbi porta egestas dictum. Cras posuere ipsum non arcu fringilla dictum. Phasellus posuere quam sit amet sem blandit, sed ultricies leo dignissim. Cras tristique iaculis pharetra.


text:
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">

<chapter>

    <copyright>
      <year>2012</year>
      <year>2016</year>
      <holder>Ericsson AB, All Rights Reserved</holder>
    </copyright>
    <legalnotice>
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.

  The Initial Developer of the Original Code is Ericsson AB.
    </legalnotice>

    <title>Introduction</title>
    <prepared>OTP team</prepared>
    <responsible></responsible>
    <docno></docno>
    <approved></approved>
    <checked></checked>
    <date></date>
    <rev></rev>
    <file>introduction.xml</file>

SSH is a protocol for secure remote logon and
    other secure network services over an insecure network.

    <title>Scope and Purpose</title>

SSH provides a single, full-duplex, and byte-oriented connection between
    client and server. The protocol also provides privacy, integrity,
    server authentication, and man-in-the-middle protection.

The <c>ssh</c> application is an implementation of the SSH Transport, Connection and Authentication
    Layer Protocols in Erlang. It provides the following:

    <list type="bulleted">
      <item>API functions to write customized SSH clients and servers applications</item>
      <item>The Erlang shell available over SSH</item>
      <item>An SFTP client (<seealso marker="ssh_sftp">ssh_sftp</seealso>)
      and server (<seealso marker="ssh_sftp">ssh_sftpd</seealso>)</item>
    </list>

    <title>Prerequisites</title>

It is assumed that the reader is familiar with the Erlang programming language,
    concepts of OTP, and has a basic understanding of public keys.

    <title>SSH Protocol Overview</title>

Conceptually, the SSH protocol can be partitioned into four
    layers:

    <image file="SSH_protocols.png">
      <icaption>SSH Protocol Architecture</icaption>
    </image>

      <title>Transport Protocol</title>

The SSH Transport Protocol is a secure, low-level transport.
      It provides strong encryption, cryptographic host
      authentication, and integrity protection. A minimum of
      Message Authentication Code (MAC) and encryption
      algorithms are supported. For details, see the
      <seealso marker="ssh">ssh(3)</seealso> manual page in <c>ssh</c>.

      <title>Authentication Protocol</title>

The SSH Authentication Protocol is a general-purpose user
      authentication protocol run over the SSH Transport Layer
      Protocol. The <c>ssh</c> application supports user authentication as follows:

      <list type="bulleted">
	<item>
	  Using public key technology. RSA and DSA, X509-certificates
	  are not supported.
	</item>
	<item>
	  Using keyboard-interactive authentication.
	  This is suitable for interactive authentication methods
	  that do not need any special software support on the client side.
	  Instead, all authentication data is entered from the keyboard.
	</item>
	<item>
	  Using a pure password-based authentication scheme.
	  Here, the plain text password is encrypted before sent
	  over the network.
	</item>
      </list>

Several configuration options for
      authentication handling are available in
      <seealso marker="ssh#connect-3">ssh:connect/[3,4]</seealso>
      and <seealso marker="ssh#daemon-2">ssh:daemon/[2,3]</seealso>.

      The public key handling can be customized by implementing
      the following behaviours from <c>ssh</c>:

      <list type="bulleted">
	<item>Module
      <seealso marker="ssh_client_key_api">ssh_client_key_api</seealso>.
	</item>
	<item>Module
      <seealso marker="ssh_server_key_api">ssh_server_key_api</seealso>.
	</item>
      </list>

      <title>Connection Protocol</title>

The SSH Connection Protocol provides application-support
      services over the transport pipe, for example, channel multiplexing,
      flow control, remote program execution, signal propagation, and
      connection forwarding. Functions for handling the SSH
      Connection Protocol can be found in the module <seealso
      marker="ssh_connection">ssh_connection</seealso> in <c>ssh</c>.

      <title>Channels</title>

All terminal sessions, forwarded connections, and so on, are
      channels. Multiple channels are multiplexed into a single
      connection. All channels are flow-controlled. This means that no
      data is sent to a channel peer until a message is received to
      indicate that window space is available.
      The initial window size specifies how many bytes of channel
      data that can be sent to the channel peer without adjusting the
      window. Typically, an SSH client opens a channel, sends data (commands),
      receives data (control information), and then closes the channel.
      The <seealso marker="ssh_channel">ssh_channel</seealso> behaviour
      handles generic parts of SSH channel management. This makes it easy
      to write your own SSH client/server processes that use flow-control
      and thus opens for more focus on the application logic.

Channels come in the following three flavors:

      <list type="bulleted">
	<item>Subsystem - Named services that can be run as
	part of an SSH server, such as SFTP <seealso
	marker="ssh_sftpd">(ssh_sftpd)</seealso>, that is built into the
	SSH daemon (server) by default, but it can be disabled. The Erlang <c>ssh</c>
	daemon can be configured to run any Erlang-
	implemented SSH subsystem.
	</item>
	<item>Shell - Interactive shell. By default the
	Erlang daemon runs the Erlang shell. The shell can be customized by
	providing your own read-eval-print loop. You can also provide your
	own Command-Line Interface (CLI) implementation,
	but that is much more work.
	</item>
	<item>Exec - One-time remote execution of commands. See function
	<seealso marker="ssh_connection#exec-4">ssh_connection:exec/4</seealso>
	for more information.</item>
      </list>

    <title>Where to Find More Information</title>

      For detailed information about the SSH protocol, refer to the
      following Request for Comments(RFCs):

    <list type="bulleted">
      <item><url href="http://www.ietf.org/rfc/rfc4250.txt">RFC 4250</url> -
      Protocol Assigned Numbers</item>
      <item><url href="http://www.ietf.org/rfc/rfc4251.txt">RFC 4251</url> -
      Protocol Architecture</item>
      <item><url href="http://www.ietf.org/rfc/rfc4252.txt">RFC 4252</url> -
      Authentication Protocol</item>
      <item><url href="http://www.ietf.org/rfc/rfc4253.txt">RFC 4253</url> -
      Transport Layer Protocol</item>
      <item><url href="http://www.ietf.org/rfc/rfc4254.txt">RFC 4254</url> -
      Connection Protocol</item>
      <item><url href="http://www.ietf.org/rfc/rfc4344.txt">RFC 4344</url> -
      Transport Layer Encryption Modes</item>
      <item><url href="http://www.ietf.org/rfc/rfc4716.txt">RFC 4716</url> -
      Public Key File Format</item>
    </list>

</chapter>


text:
@interface UACWAlarmHistoryItem : UACWModel

@property (nonatomic, copy) NSString *alarmName;
@property (nonatomic, strong) NSDate *timestamp;
@property (nonatomic) UACWAlarmHistoryItemType historyItemType;
@property (nonatomic, copy) NSString *historySummary;
@property (nonatomic, copy) NSString *historyData;

@end