/* <CoffeeScript> functions = require('./functions').functions utils = require('./utils') {RandomPicker} = require('./RandomPicker') histogram = {} justHereForDocsAndDoctest = () -> </CoffeeScript> */ /** * @class analize.histogram * * This module has functionality that will allow you to create histograms and do bucketing. * * Features: * * * Three bucketing strategies: * 1. constant width (default) * 2. constant depth - for an example of using this mode, look at the source code for the `bucketPercentile()` function * 3. [v-optimal](http://en.wikipedia.org/wiki/V-optimal_histograms) * * Two operating modes modes: * 1. Automatic. Call histogram with data and all of your parameters and out pops a histogram. * 2. Piecemeal. Create buckets, put data into buckets, generate histograms from data and pre-calculated buckets. * Sometimes you are less interested in the histogram than you are in the bucketing. * * Let's walk through some examples of both modes. But first a general discussion about how these functions accept raw data. * * ## Getting data into the histogram functions ## * * We have two ways to define data. We can pass in an Array of Objects and specify the field to use. * * grades = [ * {name: 'Joe', average: 105}, * {name: 'Jeff', average: 104.9}, # ... * * ] * * {histogram} = require('../') * h = histogram.histogram(grades, 'average') * * console.log(h) * # [ { index: 0, startOn: null, endBelow: null, label: 'all', count: 2 } ] * * Or, we can just pass in a list of values * * grades = [105, 104.9, 99, 98.7, 85, 78, 54, 98, 78, 20] * h = histogram.histogram(grades) * console.log((row.label + ': ' + row.count for row in h)) * # [ '< 41.25: 1', '41.25-62.5: 1', '62.5-83.75: 2', '>= 83.75: 6' ] * * ## Automatic histogram creation ## * * The above examples for the two ways of getting data into the histogram functions also demonstrates the use of * automatic histogram creation. There are additional parameters to this function that allow you to control the * type of bucketing (constantWidth, constantDepth, etc.), min and max values, significance of the bucket boundaries, etc. * See the individual functions for details on these parameters. * * ## Piecemeal usage ## * * Sometimes you don't actually want a histogram. You want a way to create constantWidth, constantDepth, log, or v-optimal buckets * and you want a tool to know which bucket a particular value falls into. The cannonical example of this is for calculating * percentiles for standardized testing... or for grading on a curve. The documentation for the `percentileBuckets()` * function walks you through an example like this. */ /* <CoffeeScript> getBucketCountMinMax = (values) -> targetBucketCount = Math.floor(Math.sqrt(values.length)) + 1 if targetBucketCount < 3 targetBucketCount = 2 min = functions.min(values) # !TODO: Optimize this for a single loop max = functions.max(values) return {targetBucketCount, min, max} roundUpToSignificance = (value, significance) -> unless significance? return value multiple = 1 / significance return Math.ceil(value * multiple) / multiple roundDownToSignificance = (value, significance) -> unless significance? return value multiple = 1 / significance return Math.floor(value * multiple) / multiple setParameters = (rows, valueField, firstStartOn, lastEndBelow, bucketCount, significance) -> if valueField? values = (row[valueField] for row in rows) else values = rows values = functions.numbers(values) {targetBucketCount, min, max} = getBucketCountMinMax(values) unless bucketCount? bucketCount = targetBucketCount if firstStartOn? lowerBase = firstStartOn else lowerBase = roundDownToSignificance(min, significance) firstStartOn = null if lastEndBelow? upperBase = lastEndBelow else upperBase = roundUpToSignificance(max, significance) lastEndBelow = null return {values, bucketCount, firstStartOn, lowerBase, lastEndBelow, upperBase} histogram.bucketsLog = (rows, valueField, significance, firstStartOn, lastEndBelow, bucketCount) -> if significance? throw new Error("Significance not supported for bucketsLog.") {values, bucketCount, firstStartOn, lowerBase, lastEndBelow, upperBase} = setParameters(rows, valueField, firstStartOn, lastEndBelow, bucketCount, significance) if lowerBase < 0 throw new Error("bucketsLog do not support values below zero. Strip those out if you want to use this.") if lowerBase is 0 firstStartOn = 0 else firstStartOnExponent = Math.floor(Math.log10(lowerBase)) firstStartOn = Math.pow(10, firstStartOnExponent) lastEndBelowExponent = Math.floor(Math.log10(upperBase)) + 1 lastEndBelow = Math.pow(10, lastEndBelowExponent) index = 0 startOn = firstStartOn if startOn is 0 endBelow = 1 else endBelow = Math.pow(10, firstStartOnExponent + 1) buckets = [] # each row is {index, startOn, endBelow} meaning bucket startOn <= x < endBelow while endBelow <= lastEndBelow buckets.push({index, startOn, endBelow}) startOn = endBelow endBelow = endBelow * 10 index++ return buckets histogram.bucketsConstantWidth = (rows, valueField, significance, firstStartOn, lastEndBelow, bucketCount) -> {values, bucketCount, firstStartOn, lowerBase, lastEndBelow, upperBase} = setParameters(rows, valueField, firstStartOn, lastEndBelow, bucketCount, significance) buckets = [] # each row is {index, startOn, endBelow, label} meaning bucket startOn <= x < endBelow if bucketCount < 3 bucket = {index: 0, startOn: firstStartOn, endBelow: lastEndBelow, label: 'all'} buckets.push(bucket) return buckets bucketSize = roundDownToSignificance((upperBase - lowerBase) / bucketCount, significance) if bucketSize <= 0 throw new Error("Calculated bucketSizes <= 0 are not allowed. Try a smaller significance.") lastEdge = lowerBase + bucketSize # first bucket bucket = {index: 0, startOn: firstStartOn, endBelow: lastEdge} buckets.push(bucket) # all the buckets in the middle for i in [1..bucketCount - 2] edge = lastEdge + bucketSize buckets.push({index: i, startOn: lastEdge, endBelow: edge}) lastEdge = edge # last bucket if lastEdge? and lastEndBelow? and lastEdge >= lastEndBelow throw new Error("Somehow, the last bucket didn't work out. Try a smaller significance. lastEdge: #{lastEdge} lastEndBelow: #{lastEndBelow}") bucket = {index:bucketCount - 1, startOn: lastEdge, endBelow: lastEndBelow} buckets.push(bucket) return buckets histogram.bucketsConstantDepth = (rows, valueField, significance, firstStartOn, lastEndBelow, bucketCount) -> {values, bucketCount, firstStartOn, lowerBase, lastEndBelow, upperBase} = setParameters(rows, valueField, firstStartOn, lastEndBelow, bucketCount, significance) if bucketCount < 3 bucket = {index: 0, startOn: firstStartOn, endBelow: lastEndBelow} buckets.push(bucket) return buckets bucketSize = 100 / bucketCount buckets = [] # each row is {index, startOn, endBelow} meaning bucket startOn <= x < endBelow # first bucket currentBoundary = roundDownToSignificance(functions.percentileCreator(bucketSize)(values), significance) bucket = {index: 0, startOn: firstStartOn, endBelow: currentBoundary} buckets.push(bucket) # all the buckets in the middle for i in [1..bucketCount - 2] lastBoundary = currentBoundary currentBoundary = roundDownToSignificance(functions.percentileCreator(bucketSize * (i + 1))(values), significance) buckets.push({index: i, startOn: lastBoundary, endBelow: currentBoundary}) # last bucket if lastBoundary? and lastEndBelow? and lastBoundary >= lastEndBelow throw new Error("Somehow, the last bucket didn't work out. Try a different bucketCount.") bucket = {index:bucketCount - 1, startOn: currentBoundary, endBelow: lastEndBelow} buckets.push(bucket) return buckets histogram.bucketsPercentile = (rows, valueField) -> </CoffeeScript> */ /** * @method bucketsPercentile * @member analize.histogram * * This is a short cut to creating a set of buckets for "scoring" in percentiles (think standardized testing). * * Note: You can't score in the 100th percentile because you can't beat your own score. * If you have a higher score than anybody else, you didn't beat your own score. So, you aren't better than 100%. If there are * less than 100 total scores then you technically can't even be in the 99th percentile. This function is hard-coded * to only create 100 buckets. However, if you wanted to calculate fractional percentiles. Say you want to know who * is in the 99.9th percentile, then you could simulate that yourself by calling bucketsConstantDepth with 1000 as * the bucketCount parameter. * * Let's say you are a teacher and you only give out A's, B's, C's, and F's. Let's say you * want the top 10% to get an A. This should only be one student, no matter what he scores. The next 30% of students * to get a B. The next 50% of students to get a C and the last 10% to get an F (again, only 1 student). So with 10 students, * the final distribution of grades will be this: * * * A: 1 * * B: 3 * * C: 5 * * F: 1 * * Total: 10 * * Let's say you have these grades: * * grades = [ * {name: 'Joe', average: 105}, # 1 A 90th percentile and above * {name: 'Jeff', average: 104.9}, # 1 B 60th percentile and above * {name: 'John', average: 92}, # 2 * {name: 'Jess', average: 90}, # 3 * {name: 'Joseph', average: 87}, # 1 C 10th percentile and above * {name: 'Julie', average: 87}, # 2 * {name: 'Juan', average: 75}, # 3 * {name: 'Jill', average: 73}, # 4 * {name: 'Jon', average: 71}, # 5 * {name: 'Jorge', average: 32} # 1 F rest * ] * * Now, let's create the percentile buckets for this by calling bucketsPercentile. * * {histogram} = require('../') * buckets = histogram.bucketsPercentile(grades, 'average') * * Let's create a little helper function to convert the percentiles to grades. It includes a call to `histogram.bucket`. * * getGrade = (average, buckets) -> * percentile = histogram.bucket(average, buckets).percentileHigherIsBetter * if percentile >= 90 * return 'A' * else if percentile >= 60 * return 'B' * else if percentile >= 10 * return 'C' * else * return 'F' * * Now, if we loop over this and call getGrade, we can print out the final grade for each student. * * for student in grades * console.log(student.name, getGrade(student.average, buckets)) * * # Joe A * # Jeff B * # John B * # Jess B * # Joseph C * # Julie C * # Juan C * # Jill C * # Jon C * # Jorge F * * @static * @param {Object[]/Number[]} rows If no valueField is provided or the valueField parameter is null, then the first parameter is * assumed to be an Array of Numbers representing the values to bucket. Otherwise, it is assumed to be an Array of Objects * with a bunch of fields. * * @return {Object[]} * * Returns an Array of Objects (buckets) in the form of {index, startOn, endBelow, label, percentileHigherIsBetter, percentileLowerIsBetter} * * To convert a value into a percentile call `histogram.bucket(value, bucketsFromCallToBucketsPercentile)` and * then read the percentileHigherIsBetter or percentileLowerIsBetter of the bucket that is returned. */ /* <CoffeeScript> buckets = histogram.buckets(rows, valueField, histogram.bucketsConstantDepth, null, null, null, 100) percentile = 0 for b in buckets if b.matchingRangeIndexEnd? b.percentileHigherIsBetter = b.matchingRangeIndexStart b.percentileLowerIsBetter = 99 - b.matchingRangeIndexEnd percentile = b.matchingRangeIndexEnd delete b.matchingRangeIndexEnd delete b.matchingRangeIndexStart else b.percentileHigherIsBetter = percentile b.percentileLowerIsBetter = 99 - percentile percentile++ return buckets histogram.buckets = (rows, valueField, type = histogram.bucketsConstantWidth, significance, firstStartOn, lastEndBelow, bucketCount) -> </CoffeeScript> */ /** * @method buckets * @member analize.histogram * @static * @param {Object[]/Number[]} rows If no valueField is provided or the valueField parameter is null, then the first parameter is * assumed to be an Array of Numbers representing the values to bucket. Otherwise, it is assumed to be an Array of Objects * with a bunch of fields. * @param {String} [valueField] Specifies the field containing the values to calculate the histogram on * @param {function} [type = histogram.constantWidth] Specifies how to pick the edges of the buckets. Four schemes * are provided: histogram.bucketsConstantWidth, histogram.bucketsConstantDepth, histogram.bucketsLog, and histogram.bucketsVOptimal. * You could inject your own but this function simply calls that so you may as well just create the buckets yourself. * @param {Number} [significance] The multiple to which you want to round the bucket edges. 1 means whole numbers. * 0.1 means to round to tenths. 0.01 to hundreds. Etc. If you provide all of these last four parameters, ensure * that (lastEndBelow - firstStartOn) / bucketCount will naturally come out in the significance specified. So, * (100 - 0) / 100 = 1. This works well with a significance of 1, 0.1, 0.01, etc. But (13 - 0) / 10 = 1.3. This * would not work with a significance of 1. However, a signficance of 0.1 would work fine. * * @param {Number} [firstStartOn] This will be the startOn of the first bucket. Think of it as the min value. * @param {Number} [lastEndBelow] This will be the endBelow of the last bucket. Think of it as the max value. * @param {Number} [bucketCount] If provided, the histogram will have this many buckets. * @return {Object[]} * * Returns an Array of Objects (buckets) in the form of {index, startOn, endBelow, label} * * The buckets array that is returned will have these properties: * * * Each bucket (row) will have these fields {index, startOn, endBelow, label}. * * Duplicate buckets are merged. When they are merged two fields are added to the resulting merged bucket: * {matchingRangeIndexStart, matchingRangeIndexEnd} indicating the range that this bucket replaces. * * If firstStartOn is not provided, it will be null indicating -Infinity * * If lastEndBelow is not provided, it will be null indicating Infinity. */ /* <CoffeeScript> tempBuckets = type(rows, valueField, significance, firstStartOn, lastEndBelow, bucketCount) # return tempBuckets if tempBuckets.length < 2 buckets = tempBuckets else # merge duplicate buckets buckets = [] startOfMatching = tempBuckets[0] gotToEnd = false i = 1 while i < tempBuckets.length currentBucket = tempBuckets[i] if startOfMatching.startOn == currentBucket.startOn i++ currentBucket = tempBuckets[i] while currentBucket? and startOfMatching.startOn == currentBucket.startOn and startOfMatching.endBelow == currentBucket.endBelow i++ currentBucket = tempBuckets[i] if i >= tempBuckets.length - 1 currentBucket = tempBuckets[tempBuckets.length - 1] gotToEnd = true startOfMatching.matchingRangeIndexStart = startOfMatching.index startOfMatching.matchingRangeIndexEnd = currentBucket.index startOfMatching.endBelow = currentBucket.endBelow buckets.push(startOfMatching) i++ currentBucket = tempBuckets[i] else buckets.push(startOfMatching) startOfMatching = currentBucket i++ unless gotToEnd buckets.push(currentBucket) # reindex and add labels for bucket, index in buckets bucket.index = index # delete bucket.index if bucket.startOn? and bucket.endBelow? bucket.label = "#{bucket.startOn}-#{bucket.endBelow}" else if bucket.startOn? bucket.label = ">= #{bucket.startOn}" else if bucket.endBelow? bucket.label = "< #{bucket.endBelow}" else bucket.label = "all" return buckets histogram.bucket = (value, buckets) -> </CoffeeScript> */ /** * @method bucket * @member analize.histogram * @static * @param {Number} value The value to bucket * @param {Object[]} buckets Array of objects where each row is in the form {index, startOn, endBelow, label} * @return {Object} * * Returns the bucket that contains the given value unless the data fits in none of the buckets, in which case, it returns * `null`. * * Note: With default parameters, the buckets generated by this module will cover -Infinity to Infinity, (i.e. all * possible values). However, if you hand generate your own buckets or you use firstStartOn or lastEndBelow parameters, * when calling histogram.buckets, then it's possible for values to fall into no buckets. * You can effectively use this as a way to filter out outliers or unexpected * negative values. Also note that the firstStartOn (min) is inclusive, but the lastEndBelow (max) is exclusive. If * you set the lastEndBelow to 100, then no values of 100 will get bucketed. You can't score in the 100th percentile * because you can't beat your own score. This is simlar logic. */ /* <CoffeeScript> unless value? return null # middle buckets if buckets.length >= 3 for i in [1..buckets.length - 2] b = buckets[i] if b.startOn <= value < b.endBelow return b # convoluted logic so it works for buckets of length 1, 2, and 3+ b = buckets[0] if b.startOn? and b.endBelow? if b.startOn <= value < b.endBelow return b else if b.startOn? if b.startOn <= value return b else if b.endBelow? if value < b.endBelow return b else if !b.startOn? and !b.endBelow? return b # the only situation where you get to this point is when startOn is non-null and it might be the last bucket b = buckets[buckets.length - 1] if b.endBelow? if b.startOn <= value < b.endBelow return b else if b.startOn <= value return b return null histogram.histogramFromBuckets = (rows, valueField, buckets) -> </CoffeeScript> */ /** * @method histogramFromBuckets * @member analize.histogram * @static * @param {Object[]/Number[]} rows If no valueField is provided or the valueField parameter is null, then the first parameter is * assumed to be an Array of Numbers representing the values to bucket. Otherwise, it is assumed to be an Array of Objects * with a bunch of fields. * @param {String} valueField Specifies the field containing the values to calculate the histogram on * @param {Object[]} buckets Array of Objects as output from a get...Buckets() function. Each row {index, startOn, endBelow, label} * @return {Object[]} * * Returns a histogram from rows using the provided buckets. See histogram.histogram() for details on the returned Array. */ /* <CoffeeScript> if valueField? values = (row[valueField] for row in rows) else values = rows h = utils.clone(buckets) histogramRow.count = 0 for histogramRow in h for v in values bucket = histogram.bucket(v, buckets) if bucket? h[bucket.index].count++ return h histogram.histogram = (rows, valueField, type = histogram.constantWidth, significance, firstStartOn, lastEndBelow, bucketCount) -> </CoffeeScript> */ /** * @method histogram * @member analize.histogram * @static * @param {Object[]/Number[]} rows If no valueField is provided or the valueField parameter is null, then the first parameter is * assumed to be an Array of Numbers representing the values to bucket. Otherwise, it is assumed to be an Array of Objects * with a bunch of fields. * @param {String} [valueField] Specifies the field containing the values to calculate the histogram on * @param {function} [type = histogram.constantWidth] Specifies how to pick the edges of the buckets. Four schemes * are provided: histogram.bucketsConstantWidth, histogram.bucketsConstantDepth, histogram.bucketsLog, and histogram.bucketsVOptimal. * However, you can inject your own. * @param {Number} [significance] The multiple to which you want to round the bucket edges. 1 means whole numbers. * 0.1 means to round to tenths. 0.01 to hundreds. Etc. If you provide all of these last four parameters, ensure * that (lastEndBelow - firstStartOn) / bucketCount will naturally come out in the significance specified. So, * (100 - 0) / 100 = 1. This works well with a significance of 1, 0.1, 0.01, etc. But (13 - 0) / 10 = 1.3. This * would not work with a significance of 1. However, a signficance of 0.1 would work fine. * @param {Number} [firstStartOn] This will be the startOn of the first bucket. * @param {Number} [lastEndBelow] This will be the endBelow of the last bucket. Think of it as the max value. * @param {Number} [bucketCount] If provided, the histogram will have this many buckets. * @return {Object[]} * * Returns an Array of Objects (buckets) in the form of {index, startOn, endBelow, label, count} where count is the * number of values in each bucket. * * Note: With default parameters, the buckets will cover -Infinity to Infinity, (i.e. all * possible values). However, if firstStartOn or lastEndBelow are provided, then any values that you pass in that * fall outside of this range will be ignored. You can effectively use this as a way to filter out outliers or unexpected * negative values. Also note that the firstStartOn (min) is inclusive, but the lastEndBelow (max) is exclusive. If * you set the lastEndBelow to 100, then no values of 100 will get counted. You can't score in the 100th percentile * because you can't beat your own score. This is simlar logic. */ /* <CoffeeScript> buckets = histogram.buckets(rows, valueField, type, significance, firstStartOn, lastEndBelow, bucketCount) return histogram.histogramFromBuckets(rows, valueField, buckets) histogram.discriminated = (rows, valueField, discriminatorField, type = histogram.constantWidth, significance = 1) -> </CoffeeScript> */ /** * @method discriminated * @member analize.histogram * @static * @param {Object[]} rows Unlike the other histogram methods, this one requires the rows to be Objects becase we need * both a valueField and a discriminatorField. * @param {String} valueField Specifies the field containing the values to calculate the histogram on * @param {String} discriminatorField Specifies the field containing the discriminator to split the histogram series by * @param {function} [type = histogram.constantWidth] Specifies how to pick the edges of the buckets. Four schemes * are provided: histogram.bucketsConstantWidth, histogram.bucketsConstantDepth, histogram.bucketsLog, and histogram.bucketsVOptimal. * However, you can inject your own. * @return {Object} * * Will split the rows into series based upon unique discriminator values. It uses the smallest set to determine the number * of buckets, but it uses the entire set to determine the min, and max values. Then it calculates the histogram for each * series using the same buckets. * * Note the shape of this output is very different from the other histogram methods. It's designed to be easily graphed * with HighCharts. */ /* <CoffeeScript> discriminatedData = {} for row in rows value = row[valueField] discriminatorValue = row[discriminatorField] if minValue? minValue = Math.min(minValue, value) else minValue = value if maxValue? maxValue = Math.max(maxValue, value) else maxValue = value unless discriminatedData[discriminatorValue]? discriminatedData[discriminatorValue] = [] discriminatedData[discriminatorValue].push(row) minCount = null for discriminatorValue, data of discriminatedData if minCount? if data.length < minCount minCount = data.length smallestSetOfData = data else minCount = data.length smallestSetOfData = data bucketCount = Math.ceil(Math.sqrt(minCount)) # Rounding up instead of rounding down because bucketCount is calculated from the smallestSetOfData significance = 1 buckets = histogram.buckets(smallestSetOfData, valueField, type, significance, minValue, maxValue + significance, bucketCount) series = [] categories = (bucket.label for bucket in buckets) for discriminatorValue, data of discriminatedData h = histogram.histogramFromBuckets(data, valueField, buckets) data = (row.count for row in h) row = {name: discriminatorValue, data: data, histogram: h} series.push(row) # Calculate stats for each series lowerQuartileCalculator = functions.percentileCreator(25) upperQuartileCalculator = functions.percentileCreator(75) discriminatorValues = [] stats = [] boxPlotArrays = [] for discriminatorValue, data of discriminatedData values = (row[valueField] for row in data) min = functions.min(values) p25 = lowerQuartileCalculator(values) median = functions.median(values) p75 = upperQuartileCalculator(values) max = functions.max(values) row = {min, p25, median, p75, max, count: values.length} boxPlotArray = [min, p25, median, p75, max] stats.push(row) boxPlotArrays.push(boxPlotArray) discriminatorValues.push(discriminatorValue) # Monte Carlo simulation to determine correct classification rate qtyOverall = rows.length distributionOverall = [] histograms = [] pickers = [] for row, index in series distributionOverall.push({p: stats[index].count / qtyOverall, value: index}) histograms.push(row.histogram) pickers.push(new RandomPicker({histogram: row.histogram, returnValueField: 'index'})) pickerOverall = new RandomPicker({distribution: distributionOverall}) columnPickers = [] # Key is column index for column, columnIndex in histograms[0] total = 0 counts = [] for row, index in series count = histograms[index][columnIndex].count counts.push(count) total += count columnDistribution = [] for count, index in counts columnDistribution.push({p: count / total, value: index}) columnPickers.push(new RandomPicker({distribution: columnDistribution})) correct = 0 simulationIterations = 1000 for i in [1..simulationIterations] targetValue = pickerOverall.get() targetIndex = pickers[targetValue].get() actualValue = columnPickers[targetIndex].get() if targetValue is actualValue correct++ successfulClassificationRate = Math.floor(100 * correct / simulationIterations + 0.5) return {categories, series, discriminatorValues, stats, boxPlotArrays, successfulClassificationRate} histogram.clipping = (rows, valueField, noClipping = false) -> </CoffeeScript> */ /** * @method clipping * @member analize.histogram * @static * * Note: The calling pattern and functionality of this method is legacy and a bit different from the other members of * this histogram module. I just haven't yet had the opportunity to upgrade it to the new pattern. * * This histogram function is designed to work with data that is zero bound on the low end and might have outliers * on the high end. It's not very general purpose but it's ideal for distributions that have a long-fat-tail. * * @param {Object[]} rows * @param {String} valueField Specifies the field containing the values to calculate the histogram on * @param {Boolean} [noClipping = false] If set to true, then it will not create a non-linear band for the outliers. The * default behavior (noClipping = false) is to lump together outliers into a single bucket at the top. * @return {Object[]} * * Returns an object containing the following: * * * buckets - An Array containing {label, count, rows, clippedChartValue} * * bucketSize - The size of each bucket (except the top one) * * chartMax - The maximum to use for charting using clipped values * * clipped - A Boolean indicating if the result is clipped * * valueMax - The actual maximum value found. Will always be >= chartMax * * Given an array of rows like: * * {histogram} = require('../') * * rows = [ * {age: 7}, * {age: 25}, * {age: 23}, * {age: 27}, * {age: 34}, * {age: 55}, * {age: 42}, * {age: 13}, * {age: 11}, * {age: 23}, * {age: 31}, * {age: 32}, * {age: 29}, * {age: 16}, * {age: 31}, * {age: 22}, * {age: 25}, * ] * * histogram will calculate a histogram. There will be sqrt(n) + 1 buckets * * {buckets, chartMax} = histogram.clipping(rows, 'age') * for b in buckets * console.log(b.label, b.count) * # 0-12 2 * # 12-24 5 * # 24-36 8 * # 36-48 1 * # 48-60 1 * * console.log(chartMax) * # 60 * * This histogram calculator will also attempt to lump outliers into a single bucket at the top. * * rows.push({age: 85}) * * {buckets, chartMax} = histogram.clipping(rows, 'age') * * lastBucket = buckets[buckets.length - 1] * console.log(lastBucket.label, lastBucket.count) * # 48-86* 2 * * The asterix `*` is there to indicate that this bucket is not the same size as the others and non-linear. * The histogram calculator will also "clip" the values for these outliers so that you can * display them in a scatter chart on a linear scale with the last band compressed. * The `clippedChartValue` will be guaranteed to be below the `chartMax` by interpolating it's position between * the bounds of the top band where the actual max value is scaled down to the `chartMax` * * lastBucket = buckets[buckets.length - 1] * console.log(lastBucket.rows[1].age, lastBucket.rows[1].clippedChartValue) * # 85 59.68421052631579 * */ /* <CoffeeScript> if valueField? chartValues = (row[valueField] for row in rows) else chartValues = rows max = functions.max(chartValues) max = Math.max(max, 1) if noClipping upperBound = max chartValuesMinusOutliers = chartValues else q3 = functions.percentileCreator(75)(chartValues) q1 = functions.percentileCreator(25)(chartValues) iqr = q3 - q1 upperBound = q3 + 1.5 * iqr # This is the Tukey recommendation http://exploringdata.net/why_1_5.htm if isNaN(upperBound) or upperBound > max upperBound = max chartValuesMinusOutliers = (c for c in chartValues when c <= upperBound) bucketCount = Math.floor(Math.sqrt(chartValuesMinusOutliers.length)) if bucketCount < 3 bucketCount = 2 bucketSize = Math.floor(upperBound / bucketCount) + 1 upperBound = bucketSize * bucketCount chartMax = upperBound + bucketSize # This will be at the very top of the top bucket valueMax = Math.floor(functions.max(chartValues)) + 1 valueMax = Math.max(chartMax, valueMax) # add clippedChartValues to timeInState # the clippedChartValue is interpolated between upperBound and valueMax to fit within one bucketSize for row in rows if row[valueField] >= upperBound row.clippedChartValue = upperBound + bucketSize * (row[valueField] - upperBound) / (valueMax - upperBound) else row.clippedChartValue = row[valueField] buckets = [] for i in [0..bucketCount] bucket = { label: "#{Math.floor(i * bucketSize)}-#{Math.floor((i + 1) * bucketSize)}", rows: [] count: 0 } buckets.push(bucket) clipped = not (valueMax == chartMax) if clipped buckets[bucketCount].label = "#{upperBound}-#{valueMax}*" else buckets[bucketCount].label = "#{upperBound}-#{valueMax}" total = 0 for row in rows if row[valueField] >= upperBound bucket = buckets[buckets.length - 1] else bucket = buckets[Math.floor(row[valueField] / bucketSize)] bucket.rows.push(row) bucket.count++ total++ percentile = 0 for b in buckets percentile += b.count / total if isNaN(percentile) b.percentile = 0 else b.percentile = percentile buckets[buckets.length - 1].percentile = 1.0 return {buckets, bucketSize, chartMax, clipped, valueMax} exports.histogram = histogram </CoffeeScript> */


Other statistics that accompany a linear-regression analysis can be computed in terms of the functions we already looked at in this tutorial. For example:
- Adjusted R2:
1 - ( (1 - REGR_R2) * ((REGR_COUNT - 1) / (REGR_COUNT - 2)) )
- Standard error:
SQRT( (REGR_SYY-(POWER(REGR_SXY,2)/REGR_SXX))/(REGR_COUNT-2) )
- Total sum of squares:
REGR_SYY
- Regression sum of squares:
POWER(REGR_SXY,2) / REGR_SXX
- Residual sum of squares:
(Total sum of squares)-(Regression sum of squares)
- t-Statistic for a slope:
REGR_SLOPE * SQRT(REGR_SXX) / (Standard error)
- t-Statistic for the y-intercept:
REGR_INTERCEPT/((Standard error)*SQRT((1/REGR_COUNT)+(POWER(REGR_AVGX,2)/REGR_SXX))


WITNESS LIST Appropriations Committee March 18, 2003-8:00A Budget On: Cook, Robert L. (Parks and Wildlife Department)


| The Owly Server | |
| Owly Server is a Server
developed for monitoring any kind of metrics that are collected from
the OwlyClient, and send to the Server. The main idea is that for any new project based in Owly Server only the Client has to be coded and the Server will give the power to do metrics capure, representation, threshold alerts, ... Owly Server is an Open Source Project. All details related to the project can be follow in the github project : OwlyServer |
|


JavaScript vs PHP on new 20,000 inputs
08 Jul 2015Basically I have couple of ways to build a form with a lot of inputs, maybe that won’t be the best practical solution but let’s just see where I am going with this. In one tr I have at least 20 inputs, it maybe be more and I want to multiply that by 1000. Solutions based on JavaScript are done using jQuery. These are the scenarios I have tried:
1). JavaScript (cloning): Render/load the page first with basic inputs or it should have at-least one row(tr). - Copy the last row, or maybe better have a template of that tr and make a clone. - Find the last tr of that table and attach the newly clones tr. You may use append or next from jQuery functions. - Find the last tr again, the cloned tr and switch the ids and name attributes of each input, select fields that you find in that tr. The switching means incrementing the counter or the tr which will be part of the unique id of each element and the nested array you’re trying to build in the name attribute. Also null the onclick/onchange and other functions (calendars and such) on each input and bind its new functions with incremented id.
This might be a bit more work to it but works just find and it’s fast comparing to making an ajax call to server side.
2). PHP (file): Upload functionally allowing the user to upload an excel/csv file that will be parsed on server side. In the excel I would have all the rows I need to make inputs from and the logic is building the table and its rows in php. Nothing more to it.
3). JavaScript (builder html): Instead of cloning and switching ids on client side I am trying to build the rows with building the html itself in JavaScript. In order to have better solution I would have the inputs configurations/ fields definitions json_econded into browser’s memory. I could then access that array and loop through the fields’ types to render appropriate input. As I go from one to another I am incrementing the id, acctually the same thing as in php. The difference here from the first approch is that I don’t attach each of the row/tr after creating it, but build all the htlm and than find the table id (once) and attach the whole html.
4). PHP (ajax): The standard way, making an ajax call to server side, use the field definitions array, loop and build html. Then return it to client side and attach the html. Each of the 2, 3, and 4 approach would require binding the functions on document ready.
The results (Response time in miliseconds):
| Num. of rows | JS (cloning) | PHP (file) | JS (builder) | PHP (ajax) |
|---|---|---|---|---|
| 500 | 83501 | 30861 | 1721 | 5268 |
| 1000 | 270085 | 56231 | 3297 | 9648 |
This shows that cloning the rows and attaching them is slowest way to do. As the DOM becomes larger it takes more and more time to find the last, find the inputs and switch the ids. The fastest way to do it is to build the html on JavaScript side and attach it all at once. Doing it the same way using ajax is 3 times slower due to making the server call even though it might be faster depending on the server configurations, this is just my case.
Going with the JavaScript approach has also one major advantage besides the performance aspect. If making the save on this form with php you will have to increase the max_input_vars in php.ini and that parameter can’t be set only for that script specified but globally. Instead, this would be another JS approach besides the building of the html, the save can be perform having all the inputs as array in json format and using json_decode on php to make the needed request structure.


A 7-day plan to jumpstart weight loss, rejuvenate your health, and make "green" eating a permanent part of your life!
What is the best cleanse for weight loss? My secret to a lean and healthy body can be summed up in three words: clean green drinks! Healthy meals are a big part of the plan too, but juices and smoothies are key for maximizing nutrition and effortlessly maintaining that slim and sexy body of yours. To help you get started on this incredible way of life, I've outlined a one-week cleanse based on my upcoming third book, Clean Green Drinks, available April 22. This is not an ordinary juice cleanse it's a healthy food and drink plan designed to help you master satiety and nutrition with just three key steps:
1. Clean Green Drinks: Replace breakfast and lunch with two to three clean green drinks for the first week. An energy-boosting juice or green tea can also be consumed during that mid-afternoon slump. Additionally, drink 10 cups of water each day. And if you need a pick-me-up snack? Opt for an apple, banana, or a handful of raw almonds. The next week is about kick-starting your health, so be disciplined!
2. Clean Green Eats: Enjoy a light dinner. See the choices in the seven-day meal plan that follows. If you feel great after this week of clean green drinks and clean eating, continue to eat this way for another week! Drop the pounds and gain more energy.
3. Exercise: Find a routine you LOVE. Remember you must work out for at least 30 minutes daily! Find an activity you enjoy and you may become addicted to this way of life. Yes, there's such thing as a "healthy addiction." Some of my favorites? Yoga, Bar Method, SoulCycle, and running.
Credits to: shapeSmoothies are a great tool for weight loss because you control the ingredients. They make perfect vehicles for relatively low-calorie, yet nutrient-laden ingredients that are capable of keeping you full for a long time.
By combining the right ingredients, you can create smoothies that taste great and help you drop pounds. It doesn't take long to learn what to use and how to make the right combinations. Just keep reading and start losing!
The reason that smoothies can help you lose weight is that you can get all of your necessary nutrients in one glass without adding in excess or empty calories. When you learn about the ingredients that create a balanced smoothie, you will be able to include a good balance of protein, complex carbohydrates, healthy fats, as well as vitamins and nutrients.
Besides the basics, you can include powerhouse ingredients that up the nutritional value of your smoothie without adding extra calories. You can also include elements that enhance your weight loss by boosting your metabolic rate, giving you more energy, and filling you up for hours.
Ingredients for Weight Loss
While many of the traditional ingredients in healthful smoothies support a healthy weight, some are better than others. There are certain things you can put in your smoothie that will boost your weight loss by different means.
Avocado: Alligator pears are the preferred weight loss smoothie thickener, or ingredient that provides that signature smoothie creaminess. They supply ample healthy fat, which will keep you satiated and satisfied until your next meal, and an array of health promoting vitamins and minerals.
Berries: Any kind of berry, strawberry, blueberry, blackberry, and raspberry for instance, add a ton of flavor to a smoothie without adding very many calories or sugar. Additionally, they are high in fiber, which helps to keep you full, and antioxidants for your overall health.
Cayenne pepper: This spice not only adds a kick to your smoothie, it also boosts your weight loss capability. The compound responsible is called capsaicin. Research has shown that adding it to breakfast reduces consumption of fat and carbohydrates later in the day. In other words, consuming a little cayenne pepper will curb your appetite.
Chia seeds: The same little seeds that make hair grow on ceramic animals are a great tool for weight loss. They are packed with fiber and protein to help keep you feeling full and satisfied and they contain numerous healthful nutrients like calcium, antioxidants, and omega-3 fatty acids. They are also known to absorb toxins from your digestive tract. Many of my recipes call for chia seeds or chia seed gel. I prefer the gel because it helps unlock the nutrition, is slightly easier to digest, and adds to the creaminess of your smoothie. To make chia seed gel, combine equal parts chia seeds and water in a small container and let sit for 5-10 minutes to gel. Stores in the fridge for a good month.
Cinnamon: The popular spice helps regulate blood sugar levels by improving the metabolism of glucose. This results in a reduction of the amount of excess blood glucose that can be stored as fat. Abdominal fat, studies have shown, is more sensitive to the effects of cinnamon than fat from any other part of the body.
Coconut oil: This is my number one smoothie weight loss ingredient. As you'll soon read all about below, ample healthy fat in your smoothies and diet is imperative if you're serious about losing weight, and achieving optimal health. The predominant fats (medium chain) in coconut oil are used by the body for energy as opposed to being stored as fat. This superfood keeps you satiated, energized, and feeling good. Go with an organic virgin coconut oil for your smoothies and internal consumption. For more information on this wonderful food, click here.
I get my coconut oil from Mountain Rose Herbs (Coconut Oil Unrefined also Virgin) and Tropical Traditions (Gold Label Virgin Coconut Oil). If you order from Tropical Traditions by clicking on that link and have never ordered from Tropical Traditions in the past, you will receive a free book on Virgin Coconut Oil, and I will receive a discount coupon for referring you. I believe in full disclosure.
Greek yogurt: Compared to other styles of yogurt, Greek yogurt is much higher in protein. This means it can fill you up and keep you fuller longer. Opt for the full-fat variety, and stick with plain. The flavored varieties usually have a lot of added sugar.
Healthy fats: Healthy fats are vital to your overall health and help keep you satiated for hours. Totally denying fat is not a way to lose weight. You will only feel unsatisfied when you eat. Consuming ample healthy fat is actually an integral part of any weight loss plan. Include fats in your smoothies by adding avocado, coconut oil, or nuts and nut butters. If you make elixirs, butter and cream are good options too.
Leafy greens: Greens, like kale, spinach, dandelion, and romaine lettuce, are packed with phytonutrients and low in calories. They are also high in fiber. Make sure to rotate your greens on a regular basis.
Pulp from fruit: If you have a juicer, you know that in addition to the juice, you end up with a pile of throw-away pulp. This is all of the fiber from the fruits and instead of throwing it out or composting it, you can add it to your smoothies for a natural source of fiber.
Stevia: If the fruit you add to your smoothies is not enough sweetness for you, consider using stevia. This natural, zero-calorie sweetener comes from a plant and is free from the side effects and possible risks of artificial sweeteners.
Tea/water/ice: Many smoothie recipes call for milk or fruit juice to create the right consistency. To avoid the extra calories, substitute them with tea, water, or ice. A fruity, herbal tea is a good substitute for juice. Green tea contains healthful nutrients, including a compound thought to aid in weight loss, and it has a mild flavor. For a consistency more like a shake, use ice.
Ingredients to Avoid
There are plenty of great foods and supplements to put in your smoothies that will give you flavor without excess calories. There are also some pitfalls. Too many people assume that any smoothie is a healthy option, but there are some ingredients that should be avoided if you are using smoothies as a weight loss tool. The most important thing you want to avoid in your smoothies is excess sugar. Even "healthier"sugar from natural sources such as fruit, honey, and maple syrup should be minimized.
Canned fruits or vegetables: Fresh produce is always best, but when you can't find what you want, turn to frozen foods before cans. Canned fruits and vegetables often have added preservatives or sweeteners that increase the amount of calories. They have also lost a significant amount of their nutritional value. Fresh and frozen veggies and fruits maintain nutrient content much longer than canned products.
Dairy: Dairy products like milk, ice cream, or frozen yogurt are common ingredients in smoothies, but they are chock full of extra calories. There are exceptions, such as raw milk and plain, full-fat Greek yogurt, which is high in protein and low in sugar, but most dairy should be avoided.
Fruit juice: Juice is often high in sugar and calories and low in nutritional value, especially store-bought products. Many contain added sweeteners, and all have lost the fiber of the whole fruit. A limited amount of 100 percent juice is fine, but too much will just increase your total (bad) calorie intake.
Some Protein powders: By "some" I mean those full of fillers and suspect ingredients (list of ingredients is a long list of hard to pronounce words), which don't support healthy weight loss. A clean protein powder is perfectly acceptable. Don't feel like you have to use a protein powder though as there are many healthy whole food sources of protein such as nuts, nut butters, seeds, Greek yogurt, and gelatin. If you're not sure if a protein powder is right for you, give one a try and see how you respond. If you're wondering, I recommend Sun Warrior protein and these other clean protein powders.
Sweeteners: If your smoothie tastes very sweet, you are probably over doing it on the sweetener and potentially consuming too much sugar for a weight loss plan. Stevia is a natural, no-calories sweetener that you can use. Other good sweeteners, such as honey and maple syrup should be used in moderation. For the full download on sweeteners, see my article on the best and worst sweeteners.
Too much sweet fruit: Whole, fresh fruits are good for you, and a natural way to add flavor and a little sweetness to your smoothie, but too much can be a problem. A lot of fruit in one smoothie can spike your blood sugar and cause digestive problems. A good rule of thumb is to stick to avocados and berries. Small amounts of sweeter fruits such as banana, apple, mango, and pineapple is fine, but keep those to a minimum. Smoothies high in sugar are a recipe for weight gain.
For more information on the ingredients you want to avoid like the plague, check out my article on what makes a smoothies unhealthy.
An Overall Weight Loss Plan
As you work towards your weight loss goal with tasty smoothies as your tool, keep in mind that the healthy way to lose weight includes more than just dietary changes. Your smoothies, if created thoughtfully, will provide you with many of the nutrients you need including protein, carbohydrates, good fats, and vitamins and minerals. But, don't forget to eat healthful foods in addition to those smoothies. Get plenty of vegetables, healthy fats, high quality proteins, whole grains, and moderate amounts of fruit at your regular meals.
Healthy fats were mentioned above as an important weight loss smoothie ingredient and a vital part of a healthy diet. I can't overemphasize this point.  Of all the dietary and lifestyle changes I've made over the years, getting my fats straight has had the biggest impact on my health and well-being. If you haven't already, please be sure to read my article on fat:
The Skinny on Fat: Good Fats vs. Bad Fats
In addition to a balanced diet, you will also need to get plenty of exercise. Try to get some amount of physical activity every day, even if it is just a short walk. High intensity, short duration workouts two to three times a week have been proven to be the most effective form of exercise and great for shedding excess poundage. This form of exercise is also known as High Intensity Interval Training (HITT) and Peak Performance. Dr. Mercola explains it as well as anyone:
10 Minutes of Exercise Yields Hour-Long Effects
Other factors that contribute to weight loss are adequate sleep (underrated), stress reduction, hydration (your liver doesn't metabolize body fat well when burdened by dehydration), and a positive outlook. There's often an emotional component preventing people from losing weight, which is rarely easy to address. Resolving issues in your relationships, career, or past, often leads to profound breakthroughs.
Mindful eating is another strategy that besides being a good practice to help us slow down also often results in weight loss. When you bring mindfulness to your meals you usually make better choices (reach for and consume less junk food), eat less (your gut has ample time to signal to your brain when you're full), and appreciate the food more. To practice mindful eating, remove any distractions such as TV or reading, take small bites and chew slow (tough one for me) and notice the color, smells, and textures of your food. Please don't dismiss this simple practice - it can yield profound results.
Everyone's body is different and not all of us are meant to be as skinny as a supermodel or have 6-pack abs. Learn to love your body and don't get caught up in the game of comparing yourself to others. Staying active while also eating right, getting ample sleep, reducing stress, and enjoying healthful and nutritious smoothies are steps you can take that will get you to your goal weight before you know it.
Smoothie Diet
Smoothie diets have become quite popular. I want to make it clear that I'm not an advocate of smoothie diets. I recommend a smoothie for breakfast and two regular meals for lunch and dinner. Substituting a smoothie for another meal once in a while or having one after working out is perfectly acceptable. Note, most people enjoy smoothies for breakfast. Having your one smoothie for the day at lunch or dinner is absolutely fine.
I'm not a fan of smoothie diets, or detox diets, because they're often undertaken as a quick fix. These diets usually involve severely restricting calories, which is not easy and can actually cause you harm. You may lose weight on a smoothie or detox diet, but it's usually temporary. In the long run you end of gaining the weight you lost back and then some. This yo-yo dieting is not something you want to get caught up in.
I recommend a "real" diet. One based on traditional foods, those that our great grandparents consumed, and in many cases our species has consumed for hundreds and even thousands of years. This diet is based on the work of Weston A. Price and what I personally consume and advocate. For more information, see WAPF Dietary Guidelines.
After experimenting with vegetarianism and veganism I found these dietary guidelines work best for me and have been following them since late 2010. We are unique individuals with unique dietary requirements. There's not one perfect diet that everyone should be on. I recommend experimenting and paying close attention to your body and how you feel to arrive at what diet most resonates with you.
Here are a couple of ideas for weight loss smoothies to get you started in addition to the majority for the smoothie recipes you’ll find on my site. Note, some of these smoothies may seem high in calories, but keep mind those are good calories that will help you shed weight and feel full until your next meal. Each smoothie is 1 serving for an average size person.
Join our 1000+ subscribers and get access to the latest tools, freebies, product announcements and much more!


We are a SAAS company that provides robust user interface testing solutions for modern web applications.
The company is founded in 2016, as part of the first cohort of Entrepreneur First Singapore.
Founders
Uilicious's founders are talented full-stack web application developers who have been building web applications, large and small, for many years.
Eugene
Eugene has been expertly designing and deploying scalable infrastructure for web
applications
for several years.
He spends his spare time breaking things apart and reinventing the wheel.
He loves to contribute to the software developer community, and has published several
libraries to public repositories.
Shi Ling
Shi Ling is master at designing and developing complex but elegant user interfaces, and
has a vast knowledge of the ins and outs of building web applications for multiple
browsers, devices and resolutions.
She is the go to person for fixing user interface issues.

Team
We are hiring!
Join Us
We are looking for software developers with a dedication to quality.
If you have the following skills:
- Javascript, HTML, CSS
- Any OOP programming language
- SQL
Drop us your resume at hello@uilicious.com.


We can start by solving the clues:
| Like an object that curves or bends light (5) | REFRACTIVE |
| With “the”, a derisive sign also frequently called the bird (3) | FINGER |
| Buried remains of a Dracorex or a Brachiosaurus, e.g. (4) | FOSSIL |
| This determines the sum paid in a purchase (1-8i) | PRICE |
| A king, ace, or jack is an example of this component of a deck (20) | CARD |
| With “crowd”, to pay for a specific project as a large group (0) | FUND |
| Relating to blood glucose levels (5-4i) | GLYCEMIC |
| A finger that might be green or opposable (4i) | THUMB |
| What an exothermic reaction produces as a side effect (-4) | HEAT |
| Item traded on exchanges such as Euronext or Nasdaq (8) | STOCK |
| A basic data structure that can be dynamic or associative (-2) | ARRAY |
| It may be genitive, objective, dative, or ablative (3.5+0.5i) | CASE |
Each of the answers makes a two-word phrase with “index” (refractive index, index finger, etc.), which can help in solving the clues and confirming the answers.
This (combined with the title) implies that we want to index into the answers somehow - if we index 5, 3, and 4 into REFRACTIVE, FINGER, and FOSSIL we get “ANS”, which is promisingly the start of “ANSWER”, though none of the other numbers work given they are too large, negative, or even complex.
The next step is suggested by the monospace font and weird spacing: it turns out that each of the answers can be found word search-style within the clues themselves. For example, ARRAY is found reading down from the “A” in “A finger that might be green or opposable”, and CARD is found backwards in “Dracorex”. This lets us extend the indexing to numbers outside the normal range:
If we do this, we find that the 4th, 5th, and 6th clues give “WER”, which confirms that we’re doing the right thing. Continuing indexing in this way, we get “ANSWER MERINO”.
Here are all the words and corresponding indexed letters:
| REFRACTIVE (5) | A |
| FINGER (3) | N |
| FOSSIL (4) | S |
| PRICE (1-8i) | W |
| CARD (20) | E |
| FUND (0) | R |
| GLYCEMIC (5-4i) | M |
| THUMB (4i) | E |
| HEAT (-4) | R |
| STOCK (8) | I |
| ARRAY (-2) | N |
| CASE (3.5+0.5i) | O |


Exceptions and Warnings¶
Exceptions¶
Errors derive from Exception or another custom error. Custom errors are only needed if standard errors, for example ValueError or TypeError, are not accurate descriptions of the cause for the error.
Error when parsing a docstring. |
|
Error due to perfect prediction in discrete models |
|
Error locating the X13 binary |
|
Error when running modes using X13 |
Warnings¶
Warnings derive from either an existing warning or another custom
warning, and are often accompanied by a string using the format
warning_name_doc
that services as a generic message to use when the
warning is raised.
Unexpected conditions when using X13 |
|
Resource not deleted |
|
Non-fatal import error |
|
Base internal Warning class to simplify end-user filtering |
|
Nonlinear optimizer failed to converge to a unique solution |
|
Attempting to write to a read-only cached value |
|
Iteration limit reached without convergence |
|
Test not applicable to model |
|
Non-fatal function non-implementation |
|
Function output contains atypical values |
|
Variables are not compliant with required domain constraints |
|
Non-fatal out-of-range value given |
|
Unexpected condition encountered during estimation |
|
Non-fatal matrix inversion affects output results |
|
Issue occurred when performing hypothesis test |
|
Table granularity and limits restrict interpolation |
|
Numerical implementation affects precision |
|
Non-fatal model specification issue |
|
Hessian noninvertible and standard errors unavailable |
|
Variables are highly collinear |


one
eleven
two
ten
three
nine
four
eigth
five
seven
six
six
seven
five
eight
four
nine
three
ten
two
eleven
one
twelve
full-width
three
three
three
three
one-half
one-half
one-third
one-third
one-third
one-third
two-thirds
two-thirds
one-third
one
one
one
one
one
one
one
one
one
one
one
one


Our trombones use the shiniest brass which is sourced locally. This will increase the longevity of your purchase.
We make sure you recieve your trombone as soon as we have finished making it. We also provide free returns if you are not satisfied.
For every purchase you make, we will ensure there are no damages or faults and we will check and test the pitch of your instrument.
Lorem ipsum.
Lorem ipsum.
Lorem ipsum dolor.
Lorem ipsum.
Lorem ipsum.
Lorem ipsum.
Lorem ipsum dolor.
Lorem ipsum.
Plays similar to a Trumpet
Great for Jazz Bands
Lorem ipsum dolor.
Lorem ipsum.


Created Date:
Qty
Product
Code #
Color
Size
Unit Price
Subtotal
Summary
Total:
Close
Confirm Stock
Package & Delivery
Cancel


Hello World, we are software developers!
freeCodeCamp Survey Form
Thank you for taking the time to help us improve the platform
Name:
Email:
Number:
Select a car to drive:
Volvo
Saab
Mercedes
Audi
Select your favorite food:
Pizza
Steak
Hamburger
Gender
Male
Female
Submit


Chapter 20. CGI Scripting and Alternatives
When a web browser (or other web
client) requests a page from a web server, the server may return
either static or dynamic content. Serving dynamic content involves
server-side web programs that generate and deliver content on the
fly, often based on information that is stored in a database. The one
longstanding Web-wide standard for server-side programming is known
as CGI, which stands for Common Gateway Interface. In server-side
programming, a client sends a structured request to a web server. The
server runs another program, passing the content of the request. The
server captures the output of the other program, and sends that
output to the client as the response to the original request. In
other words, the server's role is that of a gateway
between the client and the other program. The other program is called
a CGI program or CGI script.
CGI enjoys the typical advantages of standards. When you program to
the CGI standard, your program can be deployed on different web
servers, and work despite the differences. This chapter focuses on
CGI scripting in Python. It also mentions the downsides of CGI
(basically, issues of scalability under high load) and some of the
alternative, nonstandard server-side architectures that you can use
instead of CGI.
This chapter assumes that you are familiar with both HTML and HTTP.
For reference material on both of these standards, see
Webmaster in a Nutshell, by Stephen Spainhour
and Robert Eckstein (O'Reilly). For detailed
coverage of HTML, I recommend HTML & XHTML: The
Definitive Guide, by Chuck Musciano and Bill Kennedy
(O'Reilly). And for additional coverage of HTTP, see
the HTTP Pocket Reference, by Clinton Wong
(O'Reilly).
|


HTML Development Guidelines
tl;dr
Background reading can get a little boring, so you can skip past that and onto the good stuff by reading our summary.
<!doctype html>

<title>Website Title</title>
<link rel="stylesheet" href="css/style.css"/>

<brand>Website Title</brand>

Link 1

Link 2

Link 3

Article header

Lorem ipsum...

(c) 2013 MMT Digital

Formatting &
Validating your HTML
Making your code work is easy. Sticking to the rules and making it look pretty is hard. Which leaves you with the questions:
- Do you 'Lint' your HTML?
- Does it Need to validate?
- How do you validate it?
- Should you make it look pretty,
or make it as small as possible?
... questions to which you can find the answers in the HTML Validation Best Practice Guidelines.
Which version of HTML?
HTML5, of course. Duh. James Ford
It's a brave new world, and we don't need the burden of all that cumbersome XHTML rubbish. HTML5 + Polyfils are the way forward, whilst admirably dealing with the browsers of yesteryear.
You'll need a little guidance of course, which is why we've documented our preferred setup in the summary page.
Search Engine Optimisation
Clean, well-structured, semantic HTML has huge benefits for your SEO; as does using RDFa, metadata and appropriate Microformats in your pages, but there's also sitemaps, URL structures and all manner of additional elements to consider.
Regardless of whether Search Engine Optimisation is a top priority for your website, you should always be following the Best Practice Guidelines for SEO and using the appropriate semantic elements.
Background Reading
For some interesting background reading, you might like to take a look at the following resources:
- I Can Smell Your CMS [ Presentation, 40mins ]


|
MemcacheStandalone
Using memcache outside of Objectify
Starting in v3.1, Objectify's write-through memcache can be used directly with the low level API, independent of the rest of Objectify. You can use this to add caching behavior to apps built on the low level API or other datastore APIs that rely on the low level API. IntroductionToObjectify documents how to use memcache with Objectify; this document assumes you are not using Objectify. It assumes you are familiar with the low level API. IntroductionObjectify's memcache integration provides the DatastoreService and AsyncDatastoreService interfaces by wrapping the Google-provided objects and adding cache behavior. By providing these interfaces, memcaching behavior can be added to any code built on top of the low-level API. What you should know about the cache:
Warnings about the cache:
Setup
That's it. Cache ExpirationYou can control cache expiration for the DatastoreService instance by passing it in to the factory method: // Time is in seconds DatastoreService ds = CachingDatastoreServiceFactory.getDatastoreService(600); You can control cache expiration on a key-by-key basis: MemcacheService mem = CachingDatastoreServiceFactory.getDefaultMemcacheService(); EntityMemcache em = new EntityMemcache(mem, new CacheControl() { @Override public Integer getExpirySeconds(Key key) { if ("SomeEntity".equals(key.getKind())) return 600; else if ("Permanent".equals(key.getKind())) return 0; // cache without limit else return null; // do not cache return expirySeconds; } }); DatastoreService ds = CachingDatastoreServiceFactory.getDatastoreService(em); Tracking Hits and MissesYou can construct an EntityMemcache which records cache statistics. MemcacheService mem = ... CacheControl cc = ... EntityMemcache em = new EntityMemcache(mem, cc, new MemcacheStats() { @Override public void recordHit(Key key) { /* do something with the hit */ } @Override public void recordMiss(Key key) { /* do something with the miss */ } }); DatastoreService ds = CachingDatastoreServiceFactory.getDatastoreService(em); |


Manage your events.
No events at the moment...
Create Event
Invoices go here...
Experience the easiest way to plan for your events.


Max: Oh miss, I seem to have lost something.
Stewardess: Well if you describe it to me, maybe I can find it.
Max: Yes, well it was a black attache case, about oh... (gestures with hands) so big. Morocco leather. Beautiful case. And let's see... Oh yes! There was a man attached to it.
— Get Smart, "Closely Watched Planes"
When whatever is in the briefcase is too important to lose, the briefcase will often be handcuffed to the courier. Whether it's a Briefcase Full of Money, jewels, or most often top secret documents, it adds a level of security to the package. However, there are ways around this.
Even if we don't ever see what exactly is in the briefcase, seeing it handcuffed to the courier immediately communicates that it is something of great value or something requiring great security.
Examples
open/close all folders
Comic Books
- Wonder Woman (1942): Diana Prince is keeping a briefcase meant to be full of sensitive documents handcuffed to her wrist when the intel comes through that a bomb has been planted in it. Diana uses the opportunity to fake Diana "Prince"'s death via explosion.
Film
- The Blues Brothers: As seen at the big concert, Elwood Blues carries his harmonica around in a briefcase handcuffed to his wrist. Jake carries the key.
- In the opening of Cloak & Dagger, we see an officer handcuffing a briefcase to himself before leaving the limousine. Agent Jack Flack is tasked to steal this briefcase, and prepared for this, with a gadget watch that cuts through the handcuffs.
- The characters end up having to take one of these from a couple armed guards in Eagle Eye. Although the contents are unknown at the time, it's revealed later that it's an injection of a experimental compound that slows the heart rate to the point where they just hibernate, instead of suffocate.
- In Iron Man 2 Happy Hogan carries around the Mark V "briefcase armor" locked to his wrist like this.
- As part of the con in Ocean's Eleven, the briefcase that holds the "jewels" is handcuffed to one of the titular eleven, until it is turned over to Benedict. When the briefcase is taken down to the casino vault, it is placed on top of the cart carrying The Amazing Yen. When Yen opens the cart, the briefcase almost falls to the floor - which would trigger the alarm - but he manages to grab the handcuffs.
- Ronin has a briefcase handcuffed to the wrist of a VIP the mercenaries are ordered to secure with a MacGuffin inside. The trope is brought up during a planning session when Sam gets increasing frustrated over the lack of information provided to them by Deirdre. The case is indeed handcuffed to someone's wrist, so they shoot him and break the chain with a tiny explosive charge.
Sam: Is the case heavy? Is it explosive? Is it chained to some poor guy's wrist and we're going to have to cut it off?
- In Snatch., an 84-karat diamond makes its way to London in a suitcase handcuffed to Franky Four Fingers. Once Boris hears that only Franky could open the case, he decides to chop off Franky's hand with the case still connected.
- During the opening of Spies Like Us, the courier delivering the satellite images has the briefcase chained to his wrist, and the photos are secured to the inside of the briefcase. Since he's not particularly cleared for the discussion about the photos, he's shoved into a closet. With the chain sticking out the door.
- Used Cars: Kurt Russell's character Rudy is in the process of buying his way into state government and gives a Corrupt Corporate Executive a bribe in a briefcase, which the executive handcuffs to himself while they're both sitting in a limo. When Rudy decides to renege on the deal and use the money for (slightly) more noble purposes he grabs the briefcase and slams the car door on the chain on his way out, breaking it.
- Daylight: The man who transports the jewels that the robbers (that start the whole plot) take carries them like this. The robbers use a very big wire cutter for the job, and also steal the man's car as a getaway vehicle for good measure.
- Condorman. Comic book writer Woody's task is to courier one to a Soviet Femme Fatale Spy. When someone throws a knife at him, Woody instinctively covers his face, raising the briefcase on its chain to miraculously block the knife. This convinces the Soviet spy that Woody really is the elite secret agent he's pretending to be.
- The Golden Child. After Chandler Jarrell gets the Ajanti Dagger back into the United States, it's kept in a briefcase chained to Chandler's wrist for safekeeping. One of the bad guys chops through the chain during a fight to steal the briefcase.
- Escape from New York. After a terrorist takes control of Air Force One, the President handcuffs a briefcase to his wrist and enters the plane's Escape Pod. Later on it's revealed that the briefcase holds a tape which explains the secret of nuclear fusion.
- The Day of the Jackal: Viktor Wolenski, the OAS bag man who picks up the mail for the OAS heads while they're hiding out in Rome, has his briefcase chained to his wrist when making his pickups. The chief of the French Action Service points this out as an obstacle for the operatives sent to intercept Wolenski.
- Played with in For Your Eyes Only where the duty officer on a Spy Ship is handcuffed to a console used to send nuclear launch commands in the event of war. When the vessel is holed by a Sea Mine he drowns, unable to escape from the torrent of water flooding through the breech.
- In The Man Who Never Was, and the book, the dispatch case with the false documents intended to deceive the enemy is handcuffed to the courier's body to ensure they will be recovered when the body washes ashore, as part of an elaborate deception plan.
- In the Chinese comedy Girls vs Gangsters, the girls wake up naked on a beach with two of them handcuffed to a briefcase. They have no idea how this happened.
- Lucy. Lucy's boyfriend Richard tries to get her to deliver a briefcase full of drugs for him. When she is reluctant to do so, he handcuffs her wrist to the briefcase, forcing her to make the delivery.
- Cube 2: Hypercube. Colonel Maguire (apparently a high-ranking Pentagon liaison officer) wakes up in the eponymous hypercube with a briefcase of this type, except the cuffs are not attached to him and the case is empty, so it's just one more thing to add to the mystery. The cuffs however are a Chekhov's Gun which get used later.
Literature
- According to Dave Barry, seeing someone get mugged on the New York City subway is an easy way to identify them as out-of-towners, since native New Yorkers have long since learned to keep their valuables attached with solid chains bolted directly to their skeletons.
- The Bourne Series. A courier has a metal cord wrapped around his body, then out of a sleeve to the briefcase. When someone asks why this trope isn't used instead, they're told there have been "too many severed wrists."
- In one of the Corps books by W.E.B. Griffin, General MacArthur remarks to a Brigadier Pickering that he's the only person he knows who just takes MAGICnote dispatches out of his pocket instead of carrying them in a handcuffed briefcase. The Brigadier replies that he delegates the job of carrying around the handcuffed briefcase to the sergeant who acts as his bodyguard, who was left outside the General's office.
Live Action TV
- Bones: One Victim of the Week is a diamond merchant who was transporting diamonds in a briefcase handcuffed to his hand.
- In the episode "High Court Storm" of Tiger Cubs, a High Court guard is seen going inside a courtroom with a briefcase that's been handcuffed to the guard's wrist.
- UFO episode "Identified". Colonel Straker has a briefcase containing evidence of the existence of U.F.O.s chained to his wrist (it also has Self-Destructing Security). When the car he's riding in is attacked by a U.F.O., he's thrown out of it and the chain is broken. The evidence burns up in the fiery wreck of the car.
- Gilligan's Island had an episode where a briefcase with a set of handcuffs attached washes up on the island. Gilligan winds up handcuffed to the briefcase (fortunately, the key was inside the case) and has a dream where he's a spy.
- In The West Wing, CJ's first day as the President's Chief of Staff includes a Bulgarian official who's been sent to sell the US a bunch of nuclear materials his country doesn't want anymore, and he has to awkwardly manage the metal briefcase of paperwork that's handcuffed to him. (Despite being a fairly realistic show about the Presidency, though, the nuclear football never makes an appearance.)
- Get Smart
- In "Closely Watched Planes", Maxwell Smart manages to lose the courier he's escorting on an airliner in mid-flight. He duly gives a detailed description of a missing briefcase to the stewardess, concluding with, "oh yes, there was a man attached to it."
- "Aboard the Orient Express." Max protests against the Chief sending 99 on a dangerous assignment to deliver a briefcase. After hearing the Chief tell her how only the agent receiving the case has the key to open the handcuffs, Max ends up handcuffing the briefcase to his own wrist. Was this just Max making one of his usual ditzy mistakes, or was it, as 99 assumes, a deliberate ploy to protect her by making sure he would have to make the delivery instead of her? The "Hmmm..." look he gets in his eyes right before picking up the handcuffs suggests she may be right.
- Person of Interest. In "Search and Destroy", Root steals a kevlar-protected (but not chained) briefcase from a courier. Later when the original owners come after her, she uses handcuffs to attach the case to her wrist, to leave her hands free for fighting.
- One episode of Agents of S.H.I.E.L.D. opened with two dozen men in identical outfits wearing identical masks taking the same train, each with a briefcase handcuffed to one wrist.
- Elementary: In "Rip Off", the Victim of the Week had his hand ripped off so the killer could steal a handcuffed briefcase containing conflict diamonds. The briefcase was then thrown into a dumpster unopened, which confuses the police.
- On Atlanta, a drug deal hits a snag when Darius brings the money in this fashion and forgets the key to the cuffs. The seller tells him ominously that they have ways of getting the money anyway. (They just open the briefcase and take the money out.)
- This leads to a murder in an Inspector Morse episode. The courier who's wearing the chained money satchel is a conspirator in the robbery, but unfortunately his partner-in-crime carelessly leaves the key elsewhere when changing jackets. As a result he's murdered so his hand can be cut off.
- Night Court.  Hilarity Ensues.
Music
- In the music video for Fall Out Boy's "The Phoenix", Patrick handcuffs the briefcase containing the... thing, to his arm. Unfortunately, his kidnappers aren't slowed down by that little problem.
Tabletop Games
- Shadowrun adventure Bottled Demon. The magician Topal owns The Guiding Hand talismonger/lore shop. One day an old friend of his, Simon Templeman, enters his shop with a briefcase chained to his wrist. The briefcase contains a idol filled with evil magical energy.
Video Games
- In PAYDAY: The Heist, Matt handcuffs a briefcase of loot to his arm after betraying and escaping the crew. He loses the key after crashing his van, and the crew chooses to fly him and the briefcase out together, as they have neither the time or the equipment to remove it through other means on-site (though that doesn't stop Hoxton from suggesting one).
Web Comics
- In Rogue Diamond, this is how Spike ends up on the pirate's ship.
Web Video
- The Hire. This is the MacGuffin in "Ticker". In a subversion the suitcase contains not secrets, valuables or a Weapon of Mass Destruction, but a human heart to be transplanted into the country's president. When it looks like the Driver might refuse the mission after a helicopter gunship attacks them, the courier chains the case to the Driver's wrist instead. "Now drive!"
Western Animation
- In the Archer episode "Diversity Hire", Conway Stern handcuffs himself to a briefcase containing plans for a secret submarine engine before grabbing onto a helicopter rappel line. Unfortunately for him, Lana then fires a harpoon bolt into the briefcase and pulls on it so hard that Stern's hand is yanked off below the wrist.
- In the Futurama film Bender's Big Score, Professor Farnsworth's doomsday device, kept within a briefcase bag, is directly handcuffed to him in order to prevent it from being stolen.
- Muppet Babies: One of their Imagine Spots had Kermit as a secret agent trying to transport a briefcase like this, and the others being enemy agents trying to steal it in one of those mystery-on-the-train scenarios. Their attempts to steal it got pretty blatant, up to Gonzo trying to hide it under his hat while it was still cuffed to Kermit's wrist!
- Once when Bugs Bunny was a presenter at the Academy Awards, the envelope was delivered to him this way.
Real Life
- The U.S. President's Nuclear Football is handcuffed to one of his military aides who is at his side when he is away from the White House.
- The list of winners for the 2015 Golden Globes was brought by representatives of Ernst & Young, in briefcases, with rhinestone studded handcuffs.
- Kentucky Fried Chicken used to hide the secret recipe in a briefcase and handcuff it to the wrist of a hired guard when its headquarters underwent security upgrades to get a new vault installed.
- During World War II the British dumped a body dressed in a British officer's uniform off the Spanish coast, with fake plans on where the Allies were going to invade next. To ensure the plans stayed with the body they used a leather-covered chain (used by bank couriers at the time) attached to a briefcase, though since the cover story was that 'Major Martin' had been on a long air trip when his plane crashed into the sea, the chain was looped through his belt instead of run down the sleeve.


Irish Hyphenation:
Top 1000 Words
Introduction
The list below was created by finding the most common 1000 words in a large corpus of Irish texts (excluding, for simplicity, words already containing hyphens or apostrophes). All uppercase letters were made lowercase. Hyphens have been inserted according to the rules contained in the latest release.
Of course many of the highest frequency words are short function words which do not admit hyphenations. Note however that the absence of "bad" hyphens is just as important as complete coverage of "good" hyphens; please keep this in mind while scanning the list for errors. If you'd like a deeper list, just ask; I can hyphenate as many as you want of the 300,000+ words in my Irish spellchecking database.
Please email me any questions, comments, or suggestions.This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.


Scenario writers may want to express parameters in a tabular structure. For example:
Given the traders: |name|rank| |Larry|Stooge 3| |Moe|Stooge 1| |Curly|Stooge 2| When Traders are subset to ".*y" by name Then the traders returned are: |name|rank| |Larry|Stooge 3| |Curly|Stooge 2|
JBehave supports multi-line parameters out-of-the-box and the user only needs to declare the parameter type as ExamplesTable for it to be automatically parsed as a tabular structure:
@Given("the traders: $tradersTable") public void theTraders(ExamplesTable tradersTable) { this.traders = toTraders(tradersTable); } private List toTraders(ExamplesTable table) { List traders = new ArrayList(); List rows = table.getRows(); for (Map row : rows) { String name = row.get("name"); String rank = row.get("rank"); traders.add(new Trader(name, rank)); } Collections.sort(traders); return traders; }
Note: Under the hood, JBehave users the same table parsing functionality of the parametrised scenarios, but there is a fundamental difference between these two use cases: with parametrised scenarios, the scenario is run for each line of the table (using in each execution the parameter values of the given row), while in using tabular parameters we are simply using the tabular structure as a parameter, and how this structure is interpreted is up to the scenario writer. The difference is in the Examples: keyword, which is only present for parametrised scenarios.
By default, value in the table are trimmed, i.e. any preceding and trailing whitespace is removed. This is the most useful and common usecase. If, for some reason, you need to preserve the whitespace, you can specify an optional parsing property:
{trim=false} |name |rank | |Larry|Stooge 3| |Moe |Stooge 1| |Curly|Stooge 2|
The tabular parameter con also be loaded from an external resource, be it a classpath resource or a URL.
We need to enable theExamplesTable parameter converter to find the resource with the appropriate resource loader configured via the ExamplesTableFactory:


public interface HttpStatus
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
ACCEPTED |
static int |
BAD_REQUEST |
static int |
CONFLICT |
static int |
CREATED |
static int |
FORBIDDEN |
static int |
FOUND |
static int |
GATEWAY_TIMEOUT |
static int |
INTERNAL_ERROR |
static int |
METHOD |
static int |
METHOD_NOT_ALLOWED |
static int |
MOVED |
static int |
NO_RESPONSE |
static int |
NOT_FOUND |
static int |
NOT_IMPLEMENTED |
static int |
NOT_MODIFIED |
static int |
OK |
static int |
OVERLOADED |
static int |
PARTIAL_INFO |
static int |
PAYMENT_REQUIRED |
static int |
UNAUTHORIZED |
static final int OK
static final int CREATED
static final int ACCEPTED
static final int PARTIAL_INFO
static final int NO_RESPONSE
static final int MOVED
static final int FOUND
static final int METHOD
static final int NOT_MODIFIED
static final int BAD_REQUEST
static final int UNAUTHORIZED
static final int PAYMENT_REQUIRED
static final int FORBIDDEN
static final int NOT_FOUND
static final int METHOD_NOT_ALLOWED
static final int CONFLICT
static final int INTERNAL_ERROR
static final int NOT_IMPLEMENTED
static final int OVERLOADED
static final int GATEWAY_TIMEOUT
Copyright © 2017. All rights reserved.


| GTK+ 2.0 Tutorial using Ocaml | ||
|---|---|---|
| <<< Previous | Miscellaneous Widgets | Next >>> |
The Calendar widget is an effective way to display and retrieve monthly date related information. It is a very simple widget to create and work with.
Creating a GtkCalendar widget is a simple as: (see GMisc.calendar)
val GMisc.calendar : ?options:Gtk.Tags.calendar_display_options list -> ?packing:(GObj.widget -> unit) -> ?show:bool -> unit -> calendar |
There might be times where you need to change a lot of information within this widget and the following functions allow you to make multiple change to a Calendar widget without the user seeing multiple on-screen updates.
method freeze : unit -> unit method thaw : unit -> unit |
They work just like the freeze/thaw functions of every other widget.
The Calendar widget has a few options that allow you to change the way the widget both looks and operates by using the function
method display_options : Gtk.Tags.calendar_display_options list -> unit |
The flags argument can be formed by combining either of the following five options:
this option specifies that the month and year should be shown when drawing the calendar.
this option specifies that the three letter descriptions should be displayed for each day (eg Mon,Tue, etc.).
this option states that the user should not and can not change the currently displayed month. This can be good if you only need to display a particular month such as if you are displaying 12 calendar widgets for every month in a particular year.
this option specifies that the number for each week should be displayed down the left side of the calendar. (eg. Jan 1 = Week 1,Dec 31 = Week 52).
this option states that the calander week will start on Monday instead of Sunday which is the default. This only affects the order in which days are displayed from left to right.
The following functions are used to set the the currently displayed date:
method select_month : month:int -> year:int -> unit method select_day : int -> unit |
With select_day() the specified day number is selected within the current month, if that is possible. A day value of 0 will deselect any current selection.
In addition to having a day selected, any number of days in the month may be "marked". A marked day is highlighted within the calendar display. The following functions are provided to manipulate marked days:
method mark_day : int -> unit method unmark_day : int -> unit method clear_marks : unit |
For example:
let calendar = GMisc.calendar in ... (* Is day 7 marked? *) if calendar#mark_day 7 then ( (* day is marked *) ) else ( ... ) |
Note that marks are persistent across month and year changes.
The final Calendar widget function is used to retrieve the currently selected date, month and/or year.
method date : int * int * int |
The Calendar widget can generate a number of signals indicating date selection and change. The names of these signals are self explanatory, and are; see GMisc.calendar_signals:
month_changed
day_selected
day_selected_double_click
prev_month
next_month
prev_year
next_year
That just leaves us with the need to put all of this together into example code.
(* file: calendar.ml *) type signals = { mutable last_sig: GMisc.label; mutable prev_sig: GMisc.label; mutable prev2_sig: GMisc.label } let signals = let label = GMisc.label () in { last_sig = label; prev_sig = label; prev2_sig = label } let set_signal_strings string = signals.prev2_sig#set_text signals.prev_sig#text; signals.prev_sig#set_text signals.last_sig#text; signals.last_sig#set_text string let show_signal calendar msg () = let (y, m, d) = calendar#date in let str = Printf.sprintf "%s: %d/%d/%d" msg y m d in set_signal_strings str let toggle_flags calendar but_flags () = let rec loop bflags = match bflags with | [] -> [] | (but, flag)::rest -> if but#active then flag :: loop rest else loop rest in let flags = loop but_flags in calendar#display_options flags let font_selection_ok font_window calendar () = let font_name = font_window#selection#font_name in let font_desc = GPango.font_description font_name in calendar#misc#modify_font font_desc let select_font calendar () = let fwin = GWindow.font_selection_dialog ~title:"Font Selection Dialog" ~modal:true ~position:`MOUSE () in fwin#connect#destroy ~callback:fwin#destroy; fwin#ok_button#connect#clicked ~callback:(font_selection_ok fwin calendar); fwin#cancel_button#connect#clicked ~callback:fwin#destroy; fwin#show () let flags = [("Show Heading", true, `SHOW_HEADING); ("Show Day Names", true, `SHOW_DAY_NAMES); ("No Month Change", false, `NO_MONTH_CHANGE); ("Show Week Numbers", false, `SHOW_WEEK_NUMBERS); ("Week Start Monday", false, `WEEK_START_MONDAY)] let create_calendar () = (* Create a new window; set title and border width *) let window = GWindow.window ~title:"Calendar Example" ~resizable:false ~border_width:10 () in (* Set a handler for destroy event that immediately exits GTK. *) window#connect#destroy ~callback:GMain.Main.quit; let vbox = GPack.vbox ~border_width:10 ~packing:window#add () in (* The top part of the window, Calendar, flags and fontsel. *) let hbox = GPack.hbox ~packing:vbox#add () in let hbbox = GPack.button_box `HORIZONTAL ~layout:`SPREAD ~spacing:5 ~packing:hbox#add () in (* Calendar widget *) let frame = GBin.frame ~packing:hbbox#add () in let calendar = GMisc.calendar ~packing:frame#add () in calendar#mark_day 19; calendar#connect#month_changed ~callback:(show_signal calendar "month_changed"); calendar#connect#day_selected ~callback:(show_signal calendar "day_selected"); calendar#connect#day_selected_double_click ~callback:(show_signal calendar "day_selected_double_click"); calendar#connect#prev_month ~callback:(show_signal calendar "prev_month"); calendar#connect#next_month ~callback:(show_signal calendar "next_month"); calendar#connect#prev_year ~callback:(show_signal calendar "prev_year"); calendar#connect#next_year ~callback:(show_signal calendar "next_year"); let separator = GMisc.separator `VERTICAL ~packing:hbox#add () in let vbox2 = GPack.vbox ~packing:hbox#add () in (* Build the Right frame with the flags in *) let frame = GBin.frame ~label:"Flags" ~packing:vbox2#add () in let vbox3 = GPack.vbox ~packing:frame#add () in let toggle_button (label, active, flag) = (GButton.check_button ~label ~active ~packing:vbox3#add (), flag) in let flag_buttons = List.map toggle_button flags in let set_flag_cb (but, _) = but#connect#toggled ~callback:(toggle_flags calendar flag_buttons); () in List.iter set_flag_cb flag_buttons; (* Build the right font-button *) let button = GButton.button ~label:"Font..." ~packing:vbox2#add () in button#connect#clicked ~callback:(select_font calendar); (* Build the Signal-event part. *) let frame = GBin.frame ~label:"Signal events" ~packing:vbox#add () in let vbox2 = GPack.vbox ~packing:frame#add () in let hbox = GPack.hbox ~packing:vbox2#add () in let label = GMisc.label ~text:"Signal: " ~packing:hbox#add () in signals.last_sig <- GMisc.label ~packing:hbox#add (); let hbox = GPack.hbox ~packing:vbox2#add () in let label = GMisc.label ~text:"Previous signal: " ~packing:hbox#add () in signals.prev_sig <- GMisc.label ~packing:hbox#add (); let hbox = GPack.hbox ~packing:vbox2#add () in let label = GMisc.label ~text:"Second previous signal: " ~packing:hbox#add () in signals.prev2_sig <- GMisc.label ~packing:hbox#add (); let bbox = GPack.button_box `HORIZONTAL ~layout:`END ~packing:vbox#add () in let button = GButton.button ~label:"Close" ~packing:bbox#add () in button#connect#clicked ~callback:GMain.Main.quit; button#misc#set_can_default true; button#misc#grab_default (); window#show () let main () = create_calendar (); (* Enter the event loop *) GMain.Main.main () let _ = Printexc.print main () |
| <<< Previous | Home | Next >>> |
| Combo Box | Up | Color Selection |


About
Documentation
Learning Path
Examples
Forum
Install
Type your Dip program here (Please be careful of incorrect capitalisation):
Note: The online version of Dip is missing a few features.
Download Dip
to get the full experience!
{{ inputt }}
{% for i in output %} {{ i }} {% endfor %} {{error}}


Beta This is a test version of the layout of this page. Take the survey to help us improve it
Guidance
Updated COLLECT guides for local authorities, maintained schools and academies for the autumn 2016 collection.
These guides are for:
The guides will help you to complete and submit data for the school census 2016 using COLLECT , the Department for Education’s centralised data collection and management system.
The guides include information on:
The editing guide includes information on:
More guidance on submitting data for the school census is available.


In the County Court Business Centre Online Court |
||
Claim number: |
{{ ccj.claim.referenceNumber }} |
|
County court judgment requested at: |
{{ ccj.requestedAt }} |
The defendant has not filed an admission or defence to my claim.
| Full Name: | {{ claimant.name }} |
| Address: |
{{ claimant.address.line1 }}
{% if claimant.address.line2 is not empty %} {{ claimant.address.line2 }} {% endif %} {% if claimant.address.line3 is not empty %} {{ claimant.address.line3 }} {% endif %} {{ claimant.address.city }} {{ claimant.address.postcode }} |
| Email: | {{ ccj.claim.submitterEmail }} |
| Full Name: | {{ defendant.name }} |
| Address: |
{{ defendant.address.line1 }}
{% if defendant.address.line2 is not empty %} {{ defendant.address.line2 }} {% endif %} {% if defendant.address.line3 is not empty %} {{ defendant.address.line3 }} {% endif %} {{ defendant.address.city }} {{ defendant.address.postcode }} |
| Email: | {{ defendant.email }} |
| Date of birth: | {{ ccj.defendantDateOfBirth | default('Unable to provide') }} |
| Amount: | {{ ccj.amount.totalAmount }} |
| Interest rate claimed: | {{ ccj.amount.interest.rate }} |
| Date interest is claimed from: | {{ ccj.amount.interest.fromDate }} |
| Interest daily amount: | {{ ccj.amount.interest.dailyAmount }} |
| Interest: | {{ ccj.amount.interest.amount }} |
| Fee amount: | {{ ccj.amount.feeAmount }} |
| Amount already paid: | {{ ccj.amount.paidAmount }} |
| Amount to be paid by defendant: | {{ ccj.amount.remainingAmount }} |
| When you want the defendant to pay: | {{ ccj.repaymentOption }} |
| Name: | {{ claimant.name }} |
| Organisation: | {{ claimant.name }} |
| Name: | {{ ccj.claim.countyCourtJudgment.statementOfTruth.signerName }} |
| Position held: | {{ ccj.claim.countyCourtJudgment.statementOfTruth.signerRole }} |
| I declare that the details I have given are true to the best of my knowledge. | |
| {{ ccj.requestedDate}} |


Our partners see the WIN program as a bold and audacious pathway to unlock untapped talent in the community. Through this initiative, sponsor companies will receive and onboard qualified talent while also making an impact on the community they serve, a true win-win scenario.
Carolina Fintech Hub is a nonprofit partnership of leading financial services firms, fintech companies, universities and government working to fuel the future growth and success of emerging financial technologies. By fostering a culture of collaboration and innovation, we ensure fintech in all verticals have access to the talent, capital, financial industry expertise and strategic alliances they need to succeed.
Carolina Fintech Hub is teaming up with community and national leaders to create new pathways for untapped talent to find great work in technology. WIN will offer paid professional development to underserved, motivated adults in the Carolinas. Upon successful completion of the intensive 24-week program, the participant will be offered full time employment at a predetermined sponsor institution.


“The informality of the festival is one of its main attractions; in the above photo, bassist Lee Seung-Ha of the Panama Jazz All Stars shares the stage with bassist Isaac Levien of the ensemble presented by the Berklee Global Jazz project. Seung-Ha boldly asked the group’s guest artist, drummer Terri Lyne Carrington if he could sit in, and she said, “Why not?” The interplay between the two bassists provided one of many festival highlights.”