text:
 DELETE FROM reindex_crtab_aoco_gist WHERE id = 301;
1: BEGIN;
2: BEGIN;
1: REINDEX index idx_reindex_crtab_aoco_gist;
2&: REINDEX TABLE  reindex_crtab_aoco_gist;
1: COMMIT;
2<:
2: COMMIT;
3: select count(*) from reindex_crtab_aoco_gist where  (box1 * POINT '(2.0, 0)' ) ~= (BOX '( (1,1), (2,2) )' * POINT '(2.0, 0)');
3: set enable_seqscan=false;
3: set enable_indexscan=true;
3: set enable_bitmapscan=true;
3: select count(*) from reindex_crtab_aoco_gist where (box1 * POINT '(2.0, 0)' ) ~= (BOX '( (1,1), (2,2) )' * POINT '(2.0, 0)');

-- expect to have all the segments update relfilenode twice, one by 'reindex index', and one by 'reindex table'
-- by exposing the invisible rows, we can see the historical updates to the relfilenode of given index
-- aggregate by gp_segment_id and oid can verify total number of updates
-- finally compare total number of segments + master to ensure all segments and master got reindexed twice
3: set gp_select_invisible=on;
3: select relname, sum(relfilenode_updated_count)::int/(select count(*) from gp_segment_configuration where role='p' and xmax=0) as all_segs_reindexed_count from (select oid, relname, (count(relfilenode)-1) as relfilenode_updated_count from (select gp_segment_id, oid, relfilenode, relname from pg_class union all select gp_segment_id, oid, relfilenode, relname from gp_dist_random('pg_class')) all_pg_class where relname = 'idx_reindex_crtab_aoco_gist' group by gp_segment_id, oid, relname) per_seg_filenode_updated group by oid, relname;
3: set gp_select_invisible=off;


text:
/*================================================================================
	Item Name: Materialize - Material Design Admin Template
	Version: 3.1
	Author: GeeksLabs
	Author URL: http://www.themeforest.net/user/geekslabs
================================================================================
*/

redpajama_set_name: RedPajamaGithub


text:
$packageName = 'stellar'
$url = 'https://github.com/stellarchat/desktop-client/releases/download/v4.0/StellarDesktopWin32-v4.0.zip'
$checksum = '{checksum}'
$checksumType = 'sha256'
$url64 = 'https://github.com/stellarchat/desktop-client/releases/download/v4.0/StellarDesktopWin64-v4.0.zip'
$checksum64 = '{checksumx64}'
$checksumType64 = 'sha256'
$toolsDir = $(Split-Path -parent $MyInvocation.MyCommand.Definition)

Install-ChocolateyZipPackage -PackageName "$packageName" `
                             -Url "$url" `
                             -UnzipLocation "$toolsDir" `
                             -Url64bit "$url64" `
                             -Checksum "$checksum" `
                             -ChecksumType "$checksumType" `
                             -Checksum64 "$checksum64" `
                             -ChecksumType64 "$checksumType64"

Write-Verbose "Creating empty sidecar so shimgen.exe creates shim for GUI rather than console"
$guiExe = Get-ChildItem -Recurse -Path $toolsDir -Include "StellarWallet.exe"
if ($guiExe) {
    Set-Content -Path $($guiExe.FullName+".gui") -Value $null
} else {Write-Warning "Can't find StellarWallet.exe installation directory"}


text:
using System.Buffers;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Text.Json;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using Benchmarks.Serialization.Models;
using Benchmarks.Utilities;
using MessagePack;
using Microsoft.Extensions.DependencyInjection;
using Orleans.Serialization;
using Orleans.Serialization.Buffers;
using Orleans.Serialization.Session;
using Xunit;

namespace Benchmarks.Serialization.Comparison;

[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)]
[Config(typeof(BenchmarkConfig))]
public class ArraySerializeBenchmark
{
    private static readonly MyVector3[] _value;
    private static readonly Serializer<MyVector3[]> _orleansSerializer;
    private static readonly SerializerSession _session;
    private static readonly ArrayBufferWriter<byte> _arrayBufferWriter;
    private static readonly Utf8JsonWriter _jsonWriter;
    private static readonly MemoryStream _stream;

    static ArraySerializeBenchmark()
    {
        _value = Enumerable.Repeat(new MyVector3 { X = 10.3f, Y = 40.5f, Z = 13411.3f }, 1000).ToArray();
        var serviceProvider = new ServiceCollection()
            .AddSerializer(builder => builder.AddAssembly(typeof(ArraySerializeBenchmark).Assembly))
            .BuildServiceProvider();
        _orleansSerializer = serviceProvider.GetRequiredService<Serializer<MyVector3[]>>();
        _session = serviceProvider.GetRequiredService<SerializerSessionPool>().GetSession();

        // create buffers
        _stream = new MemoryStream();

        var serialize1 = _orleansSerializer.SerializeToArray(_value);
        var serialize2 = MessagePackSerializer.Serialize(_value);
        ProtoBuf.Serializer.Serialize(_stream, _value);
        var serialize3 = _stream.ToArray();
        _stream.Position = 0;
        var serialize4 = Encoding.UTF8.GetBytes(JsonSerializer.Serialize(_value));

        _arrayBufferWriter = new ArrayBufferWriter<byte>(new[] { serialize1, serialize2, serialize3, serialize4 }.Max(x => x.Length));
        _jsonWriter = new Utf8JsonWriter(_arrayBufferWriter);
    }

    // return byte[]

    [Benchmark(Baseline = true), BenchmarkCategory(" byte[]")]
    public byte[] MessagePackSerialize()
    {
        return MessagePackSerializer.Serialize(_value);
    }

    [Benchmark, BenchmarkCategory(" byte[]")]
    public byte[] ProtobufNetSerialize()
    {
        ProtoBuf.Serializer.Serialize(_stream, _value);
        var array = _stream.ToArray();
        _stream.Position = 0;
        return array;
    }

    [Benchmark, BenchmarkCategory(" byte[]")]
    public byte[] SystemTextJsonSerialize()
    {
        JsonSerializer.Serialize(_stream, _value);
        var array = _stream.ToArray();
        _stream.Position = 0;
        return array;
    }

    [Benchmark, BenchmarkCategory(" byte[]")]
    public byte[] OrleansSerialize()
    {
        return _orleansSerializer.SerializeToArray(_value);
    }

    // use BufferWriter

    [Fact]
    [Benchmark(Baseline = true), BenchmarkCategory("BufferWriter")]
    public void MessagePackBufferWriter()
    {
        MessagePackSerializer.Serialize(_arrayBufferWriter, _value);
        _arrayBufferWriter.Clear();
    }

    [Fact]
    [Benchmark, BenchmarkCategory("BufferWriter")]
    public void ProtobufNetBufferWriter()
    {
        ProtoBuf.Serializer.Serialize(_arrayBufferWriter, _value);
        _arrayBufferWriter.Clear();
    }

    [Fact]
    [Benchmark, BenchmarkCategory("BufferWriter")]
    public void SystemTextJsonBufferWriter()
    {
        JsonSerializer.Serialize(_jsonWriter, _value);
        _jsonWriter.Flush();
        _arrayBufferWriter.Clear();
        _jsonWriter.Reset(_arrayBufferWriter);
    }

    [Fact]
    [Benchmark, BenchmarkCategory("BufferWriter")]
    public void OrleansBufferWriter()
    {
        var writer = Writer.CreatePooled(_session);
        try
        {
            _orleansSerializer.Serialize(_value, ref writer);
        }
        finally
        {
            writer.Dispose();
            _session.PartialReset();
        }
    }

    [Fact]
    [Benchmark, BenchmarkCategory("BufferWriter")]
    public void OrleansBufferWriter2()
    {
        // wrap ArrayBufferWriter<byte>
        var writer = _arrayBufferWriter.CreateWriter(_session);
        try
        {
            _orleansSerializer.Serialize(_value, ref writer);
        }
        finally
        {
            writer.Dispose();
            _session.PartialReset();
        }

        _arrayBufferWriter.Clear(); // clear ArrayBufferWriter<byte>
    }
}


text:
<title>Testing add/remove shape</title>

<meta name="svg.render.forceflash" content="true"/>

Testing add/remove shape

	<input type="checkbox" dojoType="dijit.form.CheckBox" id="cb" name="cb" onClick="flip()">
	Add shape to the surface

That's all Folks!


text:
<!DOCTYPE frameset SYSTEM "frameset.dtd">
<frameset>
    <predicate lemma="zipcode">

        <roleset framnet="" id="zipcode.01" name="zipcode" vncls="9.9">
            <roles>
                <role descr="zip-coder, code-writer, agent" f="" n="0">
                    <vnrole vncls="9.9" vntheta="agent"/>
                </role>
                <role descr="code itself, theme" f="" n="1">
                    <vnrole vncls="9.9" vntheta="theme"/>
                </role>

                <note/>
                <role descr="thing zipcoded, destination" f="" n="2">
                    <vnrole vncls="9.9" vntheta="destination"/>
                </role>
            </roles>
            <example name="Adjectival Usage" src="web usage" type="">
                <text>Once the zipcoded disk image is mounted, it can be used just like a D64 image.</text>

                <rel f="">zipcoded</rel>
                <arg f="" n="1">disk image</arg>

                <note>Adjectival Usage</note>
            </example>

            <example name="Transitive" src="web usage" type="">
                <inflection aspect="ns" form="ns" person="ns" tense="ns" voice="ns"/>
                <text>Fabio zipcoded the zipdisc.</text>

                <arg f="" n="0">Fabio</arg>
                <rel f="">zipcoded</rel>
                <arg f="" n="2">the zipdisc</arg>

                <note/>
            </example>

            <note>Automatically created based on framefiles: feather (9.9), added by Kev</note>
        </roleset>

        <note/>
    </predicate>

    <note/>
</frameset>


text:
/**
 * @ngdoc overview
 * @name directive.bkndNgGrid
 */
angular.module('backAnd.directives', ['ui.bootstrap', 'textAngular', 'ui.bootstrap.datetimepicker'])
    .directive('bkndNgGrid', ['Global', 'dataListService', 'dataItemService', 'configService', '$filter', 'filterService', '$location', '$route', '$sce', '$compile', '$window',
        function (Global, dataListService, dataItemService, configService, $filter, filterService, $location, $route, $sce, $compile, $window) {
        /**
         * @ngdoc directive
         * @name directive.bkndNgGrid
         * @description grid element, ng-grid wrapper that binds to backand rest api
         * @param {string} viewName, view or table from the database
         * @param {object} options, ng-grid options
         * @param {object} filterOptions, backand rest api filter options: {fieldName, operator, value}
         * @param {string} inputStyle, optional, optional css class
         * @returns {object} directive
         */
        return {
            restrict: 'E',
            scope: {
                viewName: '=',
                options: '=',
                filterOptions: '=',
                inputStyle: '=',
                buttonGroups: '=',
                disableEditOnDblClick: '='
            },
            replace: false,
            templateUrl: ($(window).width() > 768) ? 'backand/js/directives/grids/partials/grid.html' : 'backand/js/directives/grids/partials/grid-mobile.html',

            /**
             * @name link
             * @methodOf directive.bkndNgGrid
             * @description manage the scope of the bkndNgGrid directive
             * @param {object} scope, required, the scope of the directive
             * @param {object} el, required, the element of the directive
             * @param {object} attrs, required, the attributes of the directive
             */
            link: function (scope) {
                scope.global = Global;
                scope.isMobile = $(window).width() < 768;
                /**
                 * @ngdoc function
                 * @name viewName
                 * @methodOf backand.js.directive.bkndNgGrid
                 * @description Get the new Backand's view name and re-load the configraion
                 *              and data
                 */
                scope.$watch('viewName', function () {
                    if (scope.viewName) {
                        scope.viewNameId = scope.viewName;
                        scope.buildNewGrid(scope.viewNameId);
                        //scope.getData();

                    }
                    else if ($location.$$path == '/grids' && $location.search().viewName) {
                        scope.viewNameId = $location.search().viewName;
                        scope.buildNewGrid(scope.viewNameId);
                        //scope.getData();
                    }
                });

                 /**
                 * @ngdoc function
                 * @name buildNewGrid
                 * @methodOf backand.js.directive.bkndNgGrid
                 * @description Due to limitations in ng-grid, in order to reload the settings,
                 *              we must remove it and rebuild it.
                 *              Configuration loaded async
                 * @param {string} viewName reference to view name
                 */
                scope.buildNewGrid = function (viewName) {
                    var configTable = {};
                    //Read the View's configuration
                     scope.myPromise = configService.read({
                        dataType: "view",
                        id: viewName
                    }, function (data) {
                        scope.$emit('gridConfigCompleted', data);

                        scope.configTable = data;
                        var tableElementScope = $("#bknd-grid_" + scope.viewNameId + " .ngGrid").scope();
                        if (tableElementScope) {
                            $("#bknd-grid_" + scope.viewNameId + " .ngGrid").remove();
                        }
                        var inputStyle = (scope.inputStyle) ? angular.toJson(scope.inputStyle).replace(/\"/gi, "'") : 'getTableStyle()';
                        var html = '

';
                        // Step 1: parse HTML into DOM element
                        var template = angular.element(html);
                        // Step 2: compile the template
                        var linkFn = $compile(template);
                        //Step 3: link the compiled template with the scope.
                        var element = linkFn(scope);
                        // Step 4: Append to DOM
                        $("#bknd-grid_" + scope.viewNameId).append(element);

                        scope.setNGGridConfiguration();
                    });
                };

                scope.setNGGridConfiguration = function () {
                    //Grid Settings

                    scope.dataTable = {};
                    scope.columns = [];
                    scope.sortOptions = {};
                    scope.mySelections = [];
                    scope.totalServerItems = 0;

                    scope.pagingOptions = {
                        pageSizes: [5, 10, 15, 20, 30, 50, 100, 200, 500, 1000],
                        pageSize: scope.configTable.design.rowsperPage,
                        currentPage: 1
                    };

                    scope.dataTable = {
                        columnDefs: 'columns',
                        data: 'dataFill',
                        selectedItems: scope.mySelections,
                        enablePaging: true,
                        showFooter: scope.configTable && scope.configTable.toolbarSettings.hideFooter ? !scope.configTable.toolbarSettings.hideFooter : true,
                        useExternalSorting: true,
                        sortOptions: scope.sortOptions,
                        totalServerItems: 'totalServerItems',
                        pagingOptions: scope.pagingOptions,
                        rowHeight: scope.configTable && scope.configTable.design.rowHeightInPixels ? scope.configTable.design.rowHeightInPixels : 30,
                        headerRowHeight: 30,
                        footerRowHeight: 47,
                        multiSelect: false,
                        enableColumnResize: true,
                        rowTemplate: '

',
                        // grid edititing
                        //enableCellEditOnFocus: true,
                    };
                    if (scope.isMobile)
                        scope.dataTable.plugins = [new ngGridFlexibleHeightPlugin()];

                    //Grid caption
                    scope.global.currentName = scope.configTable.captionText;
                    //Toolbar setting
                    scope.showToolbar = scope.configTable && scope.configTable.toolbarSettings ? !scope.configTable.toolbarSettings.hideToolbar : true;
                    scope.showSearch = scope.configTable && scope.configTable.design ? !scope.configTable.design.hideSearchBox : true;
                    scope.showAdd = scope.configTable && scope.configTable.dataEditing ? scope.configTable.dataEditing.allowAdd : true;
                    scope.showEdit = scope.configTable && scope.configTable.dataEditing ? scope.configTable.dataEditing.allowEdit : true;
                    scope.showDelete = scope.configTable && scope.configTable.dataEditing ? scope.configTable.dataEditing.allowDelete : true;
                    scope.showFilter = scope.configTable && !scope.configTable.hideFilter;
                    scope.collapseFilter = scope.configTable && !scope.configTable.collapseFilter;

                    scope.filterToolbarOptionsOutput = null;

                    if (scope.showFilter) {
                        filterService.getFilterOptions(scope.viewNameId, function (data) {
                            scope.$emit('filterToolbarOptionsInput', data, scope);
                            scope.filterToolbarOptions = data;
                        });
                    }

                    scope.filterScope = null;

                    scope.$on('onfilter', function (event, filterToolbarOptions, filterScope) {
                        scope.filterScope = filterScope;
                        scope.filterToolbarOptionsOutput = filterToolbarOptions;
                        scope.$emit('filterToolbarOptionsOutput', scope.filterToolbarOptionsOutput, scope, filterScope);

                        scope.getData();
                    });

                    // Grid footer custom style
                    if (!scope.isMobile)
                        scope.dataTable.footerTemplate =
                            '
' +
                            '
' +
                            'Showing {{pagingOptions.pageSize * (pagingOptions.currentPage-1) +1}} to {{footerPageMax(pagingOptions.pageSize,pagingOptions.currentPage,maxRows())}} of {{maxRows()}} rows' +
                            '
' +
                            '
' +
                            '{{i18n.ngPageSizeLabel}} ' +
                            '<select class="bkndGridSelect" ng-model="pagingOptions.pageSize" >' +
                            '<option ng-repeat="size in pagingOptions.pageSizes">{{size}}</option>' +
                            '</select>' +
                            '
' +
                            '
' +
                            '<pagination style="margin-top:6px;" total-items="maxRows()" ng-model="pagingOptions.currentPage" max-size="5" class="pagination-md" boundary-links="true" rotate="false" items-per-page="pagingOptions.pageSize"></pagination>' +
                            '
' +
                            '
';
                    else
                        scope.dataTable.footerTemplate =
                            '
' +
                            '
' +
                            '{{pagingOptions.pageSize * (pagingOptions.currentPage-1) +1}} to {{footerPageMax(pagingOptions.pageSize,pagingOptions.currentPage,maxRows())}} of {{maxRows()}} rows' +
                            '
' +
                            '
' +
                            '<pagination style="margin-top:6px;" total-items="maxRows()" ng-model="pagingOptions.currentPage" max-size="0" class="pagination pagination-sm" boundary-links="false" rotate="false" items-per-page="pagingOptions.pageSize"></pagination>' +
                            '
' +
                            '
';

                    scope.footerPageMax = function (pageSize, currentPage, max) {
                        return Math.min((pageSize * currentPage), max);
                    };

                    //update the configuration
                    scope.newButton = scope.configTable.description.newButtonName;
                    scope.editButton = scope.configTable.description.editButtonName;
                    scope.deleteButton = scope.configTable.description.deleteButtonName;
                    scope.setToolbar();

                    // We are adding columns and its custom filter to the table based on type
                    // this will also need to be changed to handle multiple tables on the same page
                    angular.forEach(scope.configTable.fields, function (col) {
                        if (!col.donotDisplayinGrid) {
                            scope.columns.push({
                                headerCellTemplate: scope.myHeaderCellTemplate(col, scope.configTable),
                                cellFilter: col.type,
                                displayName: col.displayName,
                                width: col.columnWidth,
                                cellTemplate: scope.getCellTemplate(col, scope.configTable),
                                //// grid edititing
                                //enableCellEditOnFocus: true,
                                //editableCellTemplate: scope.getEditableCellTemplate(col, scope.configTable),
                            });
                        }
                    });

                };

                scope.setToolbar = function () {
                    if (scope.buttonGroups)
                        scope.btnGroups = scope.buttonGroups;
                    else
                        scope.btnGroups = [
                            { buttons: [
                                { text: scope.newButton, iconClass: "glyphicon-plus", callback: scope.addRow },
                                { text: scope.editButton, iconClass: "glyphicon-pencil", callback: scope.editSelected },
                                { text: scope.deleteButton, iconClass: "glyphicon-trash", callback: scope.deleteSelected }
                            ] }
                        ];
                    scope.$emit('setToolbarCompleted', scope.btnGroups, scope);

                };

                scope.showClearFilter = false;

                /**
                 * @ngdoc function
                 * @name getData
                 * @methodOf backand.js.directive.bkndNgGrid
                 * @description Reads the data from the API and populate the grid
                 * @param {string} searchText The value of the filter search text box
                 */
                scope.getData = function (searchText) {
                    if (searchText == 'undefined') searchText == null;
                    // We are requesting data for the specific page of the table.
                    var sortString = '[' + JSON.stringify(scope.sortOptions) + ']';
                    // Read the filter either from attribute or query string
                    var filterString = '';
                    if (scope.filterOptions)
                        filterString = scope.filterOptions;
                    else if ($location.search().filterOptions)
                        filterString = $location.search().filterOptions;
                    else
                        filterString = scope.filterToolbarOptionsOutput;

                    if (!(typeof filterString == 'string' || filterString instanceof String)) {// is not string
                        filterString = JSON.stringify(filterString);
                    }
                    //Read from the service configuration
                    scope.myPromise = dataListService.read({
                        dataType: "view",
                        viewName: scope.viewNameId,
                        pageSize: scope.pagingOptions.pageSize,
                        pageNumber: scope.pagingOptions.currentPage,
                        filter: filterString,
                        sort: sortString,
                        search: searchText
                    }, function (largeLoad) {
                        // We have received table data and add the data to the scope
                        scope.$emit('gridDataCompleted', { config: scope.configTable, data: largeLoad });

                        scope.dataFill = largeLoad.data;
                        scope.totalServerItems = largeLoad.totalRows;
                        scope.showClearFilter = searchText || (scope.filterToolbarOptionsOutput && scope.filterToolbarOptionsOutput.length);

                    });
                };

                scope.filterKeyPress = function (keyEvent) {
                    if (keyEvent.which === 13)
                        scope.activateFilter();
                };
                scope.activateFilter = function () {
                    var searchText = scope.searchText || null;
                    scope.getData(searchText);
                };
                scope.deactivateFilter = function () {
                    scope.searchText = '';
                    if (scope.filterScope)
                        scope.filterScope.reset();

                    scope.getData('');
                };

                scope.editSelected = function () {
                    if (!scope.isSingleRowSelected()) {
                        $window.alert(messages.pleaseSelectRow);
                        return;
                    }

                    if (scope.mySelections != null && scope.mySelections.length == 1) {
                        $location.search({
                            rowId: scope.mySelections[0].__metadata.id,
                            viewName: scope.viewNameId
                        });
                        $location.path('/forms');
                    }
                };

                scope.addRow = function () {

                    var defaultFieldsValues = null;

                    if (scope.filterOptions) {
                        defaultFieldsValues = [];
                        var filterOptions = JSON.parse(scope.filterOptions);

                        angular.forEach(filterOptions, function (filterOption) {
                            var defaultFieldValue = new backand.defaultFieldValue(filterOption.fieldName, filterOption.value);
                            defaultFieldsValues.push(defaultFieldValue);
                        });
                    }

                    $location.search({
                        viewName: scope.viewNameId,
                        defaultFieldsValues: angular.toJson(defaultFieldsValues)
                    });

                    $location.path('/forms');
                };

                // todo: take it out of here! (check out ngTranslate or angular get-text modulse)
                var messages = {
                    pleaseSelectRow: "Please select a row.",
                    confirm: "Are you sure that you want to delete the selected row?",
                    failure: "Failed to delete the row. Please contact your system administrator.",
                    idMissing: "id is missing.",
                    tableMissing: "table is missing."
                };

                scope.deleteSelected = function () {

                    if (!scope.isSingleRowSelected()) {
                        $window.alert(messages.pleaseSelectRow);
                        return;
                    }

                    if (!confirm(messages.confirm)) {
                        return;
                    }

                    var id = scope.getSelectedRowId();

                    if (!id) {
                        console.error(messages.idMissing)
                        $window.alert(messages.failure);
                        return;
                    }

                    var viewName = scope.viewNameId;
                    if (!viewName) {
                        console.error(messages.tableMissing)
                        $window.alert(messages.failure);
                        return;
                    }

                    var params = {
                        dataType: "view",
                        id: id,
                        viewName: viewName
                    };

                    try {
                        scope.myPromise = dataItemService.delete(params, function (data) {
                                scope.getData();
                            },
                            function (error) {
                                if (error.status == 500) {
                                    console.error(error.data, error);
                                    $window.alert(messages.failure);
                                }
                                else {
                                    console.warn(error.data, error);
                                    $window.alert(error.data);
                                }
                            });
                    }
                    catch (err) {
                        console.error(err.description)
                        $window.alert(messages.failure);
                    }
                };

                scope.isSingleRowSelected = function () {
                    return (scope.mySelections != null && scope.mySelections.length == 1);
                };

                scope.getSelectedRowId = function () {
                    if (!scope.isSingleRowSelected())
                        return null;

                    return scope.mySelections[0].__metadata.id;
                };

                // This is the call to get the data based on the table
                // and receives arguments of page size and page number
                // should look into creating a table directive that receives
                // arguments eg table name, and paging information
                scope.myHeaderCellTemplate = function (col, view) {
                    return '
' +
                        '
{{col.displayName}}
' +
                        '

' +
                        '

' +
                        '
{{col.sortPriority}}
' +
                        '
' +
                        '

';
                }

                scope.getTextAlignment = function (col, view) {
                    if (col.grid.textAlignment == "inherit") {
                        if (col.type == "Numeric" || col.type == "DateTime")
                            return "right";
                        else return "left";
                    }
                    else return col.grid.textAlignment;
                }

                scope.myCustomSort = function (col) {
                    if (!col.sortDirection || col.sortDirection == "asc")
                        col.sortDirection = "desc";
                    else
                        col.sortDirection = "asc";
                    scope.sortOptions = {
                        fieldName: col.displayName,
                        order: col.sortDirection
                    };
                    scope.getData();
                }

                scope.getCellTemplate = function (col, view) {
                    var cellTemplate = '';
                    switch (col.type) {
                        case 'Image':
                            var height = (view.design.rowHeightInPixels != '') ? view.design.rowHeightInPixels + 'px' : 'auto';
                            var width = (height != 'auto') ? 'auto' : col.columnWidth + 'px';
                            cellTemplate = '

';
                            break;
                        case 'Html':
                            cellTemplate = '

';
                            break;
                        case 'LongText':
                            cellTemplate = '
{{row.entity["' + col.name + '"]}}
';
                            break;
                        case 'Url':
                            cellTemplate = '

';
                            break;
                        case 'MultiSelect':
                            if (col.displayFormat == "CheckList")
                                cellTemplate = '
{{row.entity.__metadata.descriptives["' + col.name + '"].label}}
';
                            else
                                cellTemplate = '
' + col.displayName + '
';
                            break;
                        case 'SingleSelect':
                            cellTemplate = '
{{row.entity.__metadata.descriptives["' + col.name + '"].label}}
';
                            break;
                        default:
                            cellTemplate = '
{{row.entity["' + col.name + '"]}}
';
                            break;
                    }

                    var colAndCellTemplate = { col: col, cellTemplate: cellTemplate };
                    scope.$emit('setCellTemplate', colAndCellTemplate);

                    return colAndCellTemplate.cellTemplate;
                };

                scope.renderHtml = function (html_code) {
                    return $sce.trustAsHtml(html_code);
                };

                scope.renderUrl = function (value) {
                    var html = '';
                    if (value != '') {
                        var urls = value.split('|');
                        if (urls.length == 1) {
                            html = '' + urls[0] + '';
                        }
                        else {
                            var href = (urls[2] != undefined) ? urls[2] : '#';
                            var target = (urls[1] != undefined) ? urls[1] : '_blank';
                            var value = (urls[0] != undefined) ? urls[0] : href;
                            html = '' + value + '';
                        }
                    }
                    return $sce.trustAsHtml(html);
                }

                scope.renderSubGridUrl = function (value, id) {
                    var field = $filter('filter')(scope.configTable.fields, function (f) {
                        return f.name === value;
                    })[0];
                    if (field) {
                        var filterItem = new backand.filter.item(field.relatedParentFieldName, backand.filter.operator.relation.in, id);

                        $location.search({
                            viewName: field.relatedViewName,
                            filterOptions: angular.toJson([filterItem])
                        });
                        $location.path('/grids');
                    }
                }

                scope.$watch('pagingOptions', function (newVal, oldVal) {
                    if (newVal !== oldVal) {
                        scope.getData();
                    }
                }, true);

                scope.$watch('filterOptions', function (newVal, oldVal) {
                    if (newVal !== oldVal) {
                        scope.getData();
                    }
                }, true);

                scope.getTableStyle = function () {
                    var top = ($('.ngViewport').offset() != undefined) ? $('.ngViewport').offset().top : 0;
                    var bottom = 0;
                    if ($('.ngFooterPanel').height() != undefined) {
                        bottom = $('.ngFooterPanel').height();
                    }

                    var height = ($(window).height() - top - bottom);
                    if (scope.collapseFilter) {
                        height += -1;
                    }
                    height += 'px';

                    return {
                        'height': height
                    };
                };

                //scope.fixHorizontalScroll = false;
                //scope.$on('ngGridEventData', function (newColumns) {
                //    if (!scope.fixHorizontalScroll) {
                //        setTimeout(function () {
                //            if (!scope.fixHorizontalScroll) {
                //                var colCount = newColumns.targetScope.columns.length;
                //                var lastCells = $('.' + newColumns.targetScope.gridId + ' .colt' + (colCount - 1));
                //                if (lastCells.length > 1) {
                //                    scope.fixHorizontalScroll = true;
                //                    lastCells.each(function () {
                //                        var lastCell = $(this);
                //                        lastCell.width(lastCell.width() - 18);
                //                    })
                //                }
                //            }
                //        }, 1);

                //    }

                //});

            }
        }
            ;
    }])
    .
    directive('ngBlur', function () {
        return function (scope, elem, attrs) {
            elem.bind('blur', function () {
                scope.$apply(attrs.ngBlur);
            });
        };
    });


text:
**webaudio-pianoroll** is a GUI library for displaying piano rolls used in music applications.

* Editmode - `webaudio-pianoroll` has four edit mode, `gridmono`, `gridpoly`, `dragmono` and `dragpoly`. `grid` types are just toggle the grid cell by clicking, and the note length is always 1 tick. `grid` types matche to rhythm machine like app. The other hand, `drag` types can specify note length by dragging. that are matches generic pianoroll apps.
* Many customize options.
* Play support - `webaudio-pianoroll` has not direct sound generation function, but has play support function.

Live Demo page is available.
### [Live Demo : 'gridmono' mode](https://g200kg.github.io/webaudio-pianoroll/)
###  [Live Demo : 'dragpoly' timebase=480 mode](https://g200kg.github.io/webaudio-pianoroll/index3.html)

----
## Usage

* #### Install webaudio-pianoroll

Deploy `webaudio-pianoroll.js` appropriately. necessary file is only `webaudio-pianoroll.js`.

Load the `webaudio-pianoroll.js` :
  `<script src="./webaudio-pianoroll.js"></script>`

  Or, just directory load from GitHub pages as CDN.
  `<script src="https://g200kg.github.io/webaudio-pianoroll/webaudio-pianoroll.js"></script>`

* #### If needed, load webcomponents.js in your HTML:
`<script src="webcomponents-lite.min.js"></script>`

* #### place webaudio-pianoroll element in your HTML:
 `<webaudio-pianoroll></webaudio-pianoroll>`

 In default, it makes element like this:
![](./images/screenshot1.png)

  Then you can customize the pianoroll with attributes. For example,
 `<webaudio-pianoroll width="300" height="200" xrange="64" markend="64" collt="#33f" coldk="#338" editmode="dragmono"></webaudio-pianoroll>
`

 ![](./images/screenshot2.png)

## How To Operate

#### Common
* Time axis can be zoomed by mouse wheel if enabled by a "wheelzoom" attribute.

#### Grid Mode
* The cell can be toggle on/off by clicking.
* When dragging, you can turn on or off multiple cells depending on the state of the first cell.

#### Drag mode
* Drag with the left button to create a specified length note.
* Click existing note to select.
* Drag with the right button to select notes within the specified area (Whether the note is included in the range or not is determined based on whether or not the beginning of the note is included).
* Selected notes can be moved by left button dragging.
* Drag the left or right edge of the selected note to change the length of the note.
* Right click on the selected note to delete menu.

## Attributes

|Attribute     |Options|Default   |Description               |
|--------------|-------|----------|--------------------------|
|**width**     |Number |640       | width of element in px   |
|**height**    |Number |320       | height of element in px  |
|**editmode**  |String |"gridmono"| combination of "grid"/"drag" + "mono"/"poly"|
|**timebase**  |Number |16        | time resolution of 1 bar,
(1 bar / timebase = 1 tick)  |
|**xrange**    |Number |16        | time axis view range in tick|
|**yrange**    |Number |16        | y axis view range in note number|
|**xoffset**   |Number |0         | time axis offset in tick|
|**yoffset**   |Number |60        | y axis offset in note number|
|**xscroll**   |Number |0         | if 1, x axis scroll enable|
|**yscroll**   |Number |0         | if 1, y axis scroll enable|
|**grid**      |Number |4         | time axis grid density in tick|
|**snap**      |Number |1         | note x position snapping in tick|
|**wheelzoom** |Number |0         | if non 0, time axis zoom by wheel is enabled|
|**xruler**    |Number |24        | time axis ruler height in px|
|**yruler**    |Number |24        | y axis ruler width in px|
|**octadj**    |Number |-1        | ruler octave value adjust
(-1 : 60=C4)|
|**cursor**    |Number |0         |current play position in tick|
|**markstart** |Number |0         | play range start marker position in tick|
|**markend**   |Number |16        | play range end marker position in tick|
|**collt**     |String |"#ccc"    | score background (light part) color|
|**coldk**     |String |"#aaa"    | score background (dark part) color|
|**colgrid**   |String |"#666"    | score grid color|
|**colnote**   |String |"#f22"    | note color |
|**colnotesel**|String |"#0f0"    | selected note color (for editmode="drag")|
|**colnoteborder**|String|"#000" | note border color|
|**colrulerbg**|String |"#666"    | ruler background color|
|**colrulerfg**|String |"#fff"    | ruler foreground color|
|**colrulerborder**|String|"#000"| ruler border color|
|**bgsrc**     |String|null| background image url. To make visible this, you should set collt/coldk non-opaque with 'rgba(r,g,b,a)' style. |
|**cursorsrc** |String | internal resource| playcursor image url|
|**cursoroffset**|Number|0|playcursor image x offset in px|
|**markstartsrc**|String|internal resource| markstart image url|
|**markstartoffset**|Number|0| markstart image x offset in px|
|**markendsrc**|String|internal resource| markend image url|
|**markendoffset**|Number|-24| markend image  x offset in px|
|**kbsrc**     |String|internal resource| keyboard image url|
|**kbwidth**   |Number|40|keyboard image width in px|
|**loop**      |Number |1         | loop play|
|**preload**   |Number |1| data preload when play in sec|
|**tempo**     |Number|120|tempo when play|

## Functions

|Function|Description|
|--------|-----------|
|**redraw()**| redraw all|
|**getMMLString()**| get MML string of current data.
Note that this function is for `mono` type editmode.|
|**setMMLString(str)**| set MML string to webaudio-pianoroll.
Note that this function is for `mono` type editmode.|
|**locate(tick)**| set cursor to specified tick|
|**play(audioContext, callback, starttick)**|play current data. `webaudio-pianoroll` does not generate sound directly, but it passes necessary information to the specified callback function. `audioContext` is used to control the time axis. If `starttick` is not specified, play from current cursor position.|
|**stop()**|stop playing.|

## Callback
play() function passes necessary data for playing to callback function like :
`callback({t:noteOnTime, g:noteOffTime, n:noteNumber})`

Here the noteOnTime and noteOffTime is audioContext timeline value.

## DataStructure
If you want to access directly to sequence data, you can touch the `DOMElement.sequence`.

`DOMElement.sequence` is an Array of noteEvents. Here the noteEvent is a object of one note infomation of:
`{t:noteOnTick g:noteLength n:noteNumber}`

## License
`webaudio-pianoroll` is licensed under the Apache License, Version 2.0


text:
using namespace Nektar;

/// Defines a solution which excites all modes in the Tet expansion.
NekDouble Tet_sol(NekDouble x, NekDouble y, NekDouble z,
                    int order1, int order2, int order3);

/// Defines another solution which excites all modes in the Tet expansion.
NekDouble Tet_sol2(NekDouble x, NekDouble y, NekDouble z, int P, int Q, int R);

int main(int argc, char *argv[])
{
    if(argc != 8)
    {
        cerr << "usage: LocTetExpDemo MeshFile nummodes0 nummodes1 nummodes2 "
                "nx ny nz" << endl;
        exit(1);
    }

    int i;

    string in(argv[1]);
    int nummodes0 = atoi(argv[2]);
    int nummodes1 = atoi(argv[3]);
    int nummodes2 = atoi(argv[4]);
    int nquad0    = atoi(argv[5]);
    int nquad1    = atoi(argv[6]);
    int nquad2    = atoi(argv[7]);
    int ntotquad  = nquad0*nquad1*nquad2;

    SpatialDomains::MeshGraph3D graph3D;
    graph3D.ReadGeometry(in);

    LibUtilities::BasisType  bTypeX = LibUtilities::eModified_A;
    LibUtilities::BasisType  bTypeY = LibUtilities::eModified_B;
    LibUtilities::BasisType  bTypeZ = LibUtilities::eModified_C;

    LibUtilities::PointsType qtypeX = LibUtilities::eGaussLobattoLegendre;
    LibUtilities::PointsType qtypeY = LibUtilities::eGaussRadauMAlpha1Beta0;
    LibUtilities::PointsType qtypeZ = LibUtilities::eGaussRadauMAlpha2Beta0;

    const LibUtilities::PointsKey   pointsKey0( nquad0, qtypeX );
    const LibUtilities::PointsKey   pointsKey1( nquad1, qtypeY );
    const LibUtilities::PointsKey   pointsKey2( nquad2, qtypeZ );

    const LibUtilities::BasisKey    basisKey0( bTypeX, nummodes0, pointsKey0 );
    const LibUtilities::BasisKey    basisKey1( bTypeY, nummodes1, pointsKey1 );
    const LibUtilities::BasisKey    basisKey2( bTypeZ, nummodes2, pointsKey2 );

    SpatialDomains::TetGeomSharedPtr geom;
    if(!(geom = boost::dynamic_pointer_cast<SpatialDomains::TetGeom>(
                                                graph3D.GetCompositeItem(0,0))))
    {
        cerr << "Could not find TetGeom in input file" << endl;
        exit(1);
    }

    LocalRegions::TetExpSharedPtr E = MemoryManager<LocalRegions::TetExp>
                    ::AllocateSharedPtr(basisKey0,basisKey1,basisKey2,geom);

    Array<OneD,NekDouble> x(ntotquad);
    Array<OneD,NekDouble> y(ntotquad);
    Array<OneD,NekDouble> z(ntotquad);
    E->GetCoords(x,y,z);

    Array<OneD,NekDouble> sol(ntotquad);
    //----------------------------------------------
    // Define solution to be projected
    for(i = 0; i < ntotquad; i++)
    {
        sol[i]  = Tet_sol(x[i],y[i],z[i],nummodes0,nummodes1,nummodes2);
    }
    //----------------------------------------------

    //---------------------------------------------
    // Project onto Expansion
    Array<OneD, NekDouble> coeffs(E->GetNcoeffs());
    Array<OneD, NekDouble> phys  (ntotquad);
    E->FwdTrans( sol, coeffs );
    //---------------------------------------------

    //-------------------------------------------
    // Backward Transform Solution to get projected values
    E->BwdTrans( coeffs, phys );
    //-------------------------------------------

    //--------------------------------------------
    // Calculate L_p error
    cout << "L infinity error: " << E->Linf(phys, sol) << endl;
    cout << "L 2 error:        " << E->L2  (phys, sol) << endl;
    //--------------------------------------------
    return 0;
}

NekDouble Tet_sol(NekDouble x, NekDouble y, NekDouble z,
                    int nummodes1, int nummodes2, int nummodes3)
{
    NekDouble sol = 0;

    for(int i = 0; i < nummodes1; ++i)
    {
        for(int j = 0; j < nummodes2; ++j)
        {
            for(int k = 0; k < nummodes3; ++k)
            {
                sol += pow(x,i) * pow(y,j) * pow(z,k);
            }
        }
    }

    return sol;
}

NekDouble Tet_sol2(NekDouble x, NekDouble y, NekDouble z, int P, int Q, int R) {
    NekDouble sol = 0;

    for(int i = 0; i <= P; ++i) {
        for(int j = 0; j <= Q - j; ++j) {
            for(int k = 0; k <= R - i - j; ++k) {
                sol += pow(x,i) * pow(y,j) * pow(z,k);
            }
        }
    }

    return sol;
}


text:
package cz.lbenda.coursing.service;

import cz.lbenda.coursing.dto.Lap;

/**
 * Created by Lukas Benda <lbenda @ lbenda.cz> on 6/21/14.
 */
public interface LapService extends AbstractDTOService<Lap> {
}


text:
from .mnemon import mnemon as mnc
from .dec import mnemon as mnd

__all__ = ["mnc", "mnd"]


text:
/* jshint latedef:false */
/* jshint forin:false */
/* jshint noempty:false */

'use strict';

exports.Operations = require('./operations');
exports.Accounts = require('./accounts');
exports.Extensions = require('./extensions');
exports.Projects = require('./projects');


text:
layout: post
title: "What the New NIST Guidelines Mean for Authentication"
description: "Learn about NIST's Digital Authentication Guideline and what it means for authentication security."
date: 2016-11-29 8:30
category: Hot Topics, Authentication
is_non-tech: true
author:
  name: "Kim Maida"
  url: "https://twitter.com/KimMaida"
  mail: "kim.maida@auth0.com"
  avatar: "https://en.gravatar.com/userimage/20807150/4c9e5bd34750ec1dcedd71cb40b4a9ba.png"
design:
  bg_color: "#485FB8"
  image: https://cdn.auth0.com/blog/nist-auth-guideline/NISTimage.png
tags:
- security
- passwords
- authentication
- NIST
related:
- 2016-10-06-announcing-auth0-eu-us-privacy-shield-certification
- 2016-08-25-announcing-Auth0-Guardian-a-new-way-to-login
---

**TL;DR:** The US National Institute of Standards and Technology ([NIST](https://www.nist.gov/)) is creating new policies for Federal agencies implementing authentication. Learn about [NIST Special Publication 800-63-3: Digital Authentication Guideline](https://pages.nist.gov/800-63-3/sp800-63-3.html) and what it means for authentication security.

---

## NIST Digital Authentication Guideline

The [US National Institute of Standards and Technology (NIST)](https://www.nist.gov/) is creating new policies for Federal agencies implementing authentication.

![Digital Authentication Guideline: US NIST logo](https://cdn.auth0.com/blog/nist-auth-guideline/nist.png)

The draft, called **Special Publication 800-63-3**, is available [on the NIST website](https://pages.nist.gov/800-63-3) as well as [on NIST's GitHub](https://github.com/usnistgov/800-63-3). The suite of documents includes the following:

* [800-63-3: Digital Authentication Guideline](https://pages.nist.gov/800-63-3/sp800-63-3.html) (overview)
* [800-63A: Enrollment & Identity Proofing](https://pages.nist.gov/800-63-3/sp800-63a.html)
* [800-63B: Authentication & Lifecycle Management](https://pages.nist.gov/800-63-3/sp800-63b.html)
* [800-63C: Federation & Assertions](https://pages.nist.gov/800-63-3/sp800-63c.html)

The policies are intended for Federal agency applications, but serve as a standard for many others as well.

## NIST Improved Password Requirements

The NIST Digital Authentication Guideline strives for improved password requirements. One of the guiding principles is _better user experience_ and shifting the burden to the verifier whenever possible. In order to support the creation of passwords that users will remember while implementing excellent security, several guidelines are important:

* Length: 8 character minimum, >64 character maximum
* Compare new passwords to a [dictionary](https://auth0.com/docs/connections/database/password-options#password-dictionary) and don't allow common, easily-guessed passwords (such as `password`, `abc123`, etc.)
* Allow all printing characters + spaces
* Should offer option to show password rather than dots or asterisks; helps typing accuracy
* Don't enforce composition rules (ie., no "passwords must include uppercase and lowercase letters, a number...", etc.); such rules provide a poor user experience
* Don't use password hints; they weaken authentication
* Don't expire passwords arbitrarily; regular expiration encourages users to choose easy-to-guess, less secure passwords
* Don't use [Knowledge-based Authentication (KBA)](https://en.wikipedia.org/wiki/Knowledge-based_authentication)

## NIST Guidelines for Password Storage

NIST also supplies guidelines for the verifier's encryption and storage of passwords. These policies ensure that [passwords are stored securely](https://nakedsecurity.sophos.com/2013/11/20/serious-security-how-to-store-your-users-passwords-safely/):

* Passwords shall be hashed with 32-bit (or greater) random salt
* Use approved key derivation function [PBKDF2](https://www.ietf.org/rfc/rfc6070.txt) using [SHA-1, SHA-2, or SHA-3](https://en.wikipedia.org/wiki/Secure_Hash_Algorithm) with at least 10,000 iterations
* Passwords should use keyed [HMAC](https://tools.ietf.org/html/rfc2104) hash with the key stored separately

## NIST on Multifactor Authentication

NIST recommends utilizing [out-of-band (OOB) authentication](https://www.techopedia.com/definition/29532/out-of-band-authentication-ooba) to provide [2-factor Authentication (2FA)](https://auth0.com/learn/two-factor-authentication/). The guidelines also state that **SMS is _deprecated_ for OOB authentication**. SMS can be compromised by a variety of threats such as smartphone malware, [SS7 attacks](https://www.theguardian.com/technology/2016/apr/19/ss7-hack-explained-mobile-phone-vulnerability-snooping-texts-calls), forwarding, change of phone number, and more.

Examples of non-SMS OOB authenticators include [Auth0 Guardian](https://auth0.com/docs/multifactor-authentication/guardian), [Duo Mobile](https://duo.com/solutions/features/two-factor-authentication-methods/duo-mobile), and [Google Authenticator](https://support.google.com/accounts/answer/1066447?hl=en). NIST states that use of biometrics must be _with_ another authentication factor for [Multifactor Authentication](https://auth0.com/docs/multifactor-authentication).

## Conclusion

Overall, the new guidelines put the user experience at the forefront while also establishing more robust storage and authentication methods. Although the NIST Digital Authentication Guideline governs Federal sites, its tenets are good standards for _any_ app or site with authentication. The guideline is currently in draft. When the policies are final, Federal agencies as well as many other companies and vendors will make strides to comply with the new guidelines for improved authentication security and user experience. To learn more, check out the [NIST Draft 800-63-3](https://pages.nist.gov/800-63-3) itself and [Jim Fenton's "Toward Better Password Requirements"](http://www.slideshare.net/jim_fenton/toward-better-password-requirements) presentation.


text:
import Component from '@ember/component';
import {inject as service} from '@ember/service';

export default Component.extend({
    ui: service(),

    tagName: 'h2',
    classNames: ['view-title']
});


text:
"""
Verifies that ios watch extensions and apps are built correctly.
"""

import TestGyp
import TestMac

import sys

if sys.platform == 'darwin':
  print "This test is currently disabled: https://crbug.com/483696."
  sys.exit(0)

if sys.platform == 'darwin' and TestMac.Xcode.Version() >= "0620":
  test = TestGyp.TestGyp(formats=['ninja', 'xcode'])

  test.run_gyp('watch.gyp', chdir='watch')

  test.build(
      'watch.gyp',
      'WatchContainer',
      chdir='watch')

  # Test that the extension exists
  test.built_file_must_exist(
      'WatchContainer.app/PlugIns/WatchKitExtension.appex',
      chdir='watch')

  # Test that the watch app exists
  test.built_file_must_exist(
      'WatchContainer.app/PlugIns/WatchKitExtension.appex/WatchApp.app',
      chdir='watch')

  test.pass_test()


text:
namespace content {
class BrowserMainRunner;
struct MainFunctionParams;
}

int ShellBrowserMain(
    const content::MainFunctionParams& parameters,
    const scoped_ptr<content::BrowserMainRunner>& main_runner);

#endif  // CONTENT_SHELL_BROWSER_SHELL_BROWSER_MAIN_H_


text:
Follow the guidelines below for building Electron on Windows.

## Prerequisites

* Windows 7 / Server 2008 R2 or higher
* Visual Studio 2015 - [download VS 2015 Community Edition for
  free](https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx)
* [Python 2.7](http://www.python.org/download/releases/2.7/)
* [Node.js](http://nodejs.org/download/)
* [Git](http://git-scm.com)

If you don't currently have a Windows installation,
[dev.microsoftedge.com](https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/)
has timebombed versions of Windows that you can use to build Electron.

Building Electron is done entirely with command-line scripts and cannot be done
with Visual Studio. You can develop Electron with any editor but support for
building with Visual Studio will come in the future.

**Note:** Even though Visual Studio is not used for building, it's still
**required** because we need the build toolchains it provides.

**Note:** While older versions of Electron required Visual Studio 2013, Electron 1.1 and later does require Visual Studio 2015.

## Getting the Code

```powershell
$ git clone https://github.com/electron/electron.git
```

## Bootstrapping

The bootstrap script will download all necessary build dependencies and create
the build project files. Notice that we're using `ninja` to build Electron so
there is no Visual Studio project generated.

```powershell
$ cd electron
$ python script\bootstrap.py -v
```

## Building

Build both Release and Debug targets:

```powershell
$ python script\build.py
```

You can also only build the Debug target:

```powershell
$ python script\build.py -c D
```

After building is done, you can find `electron.exe` under `out\D` (debug
target) or under `out\R` (release target).

## 32bit Build

To build for the 32bit target, you need to pass `--target_arch=ia32` when
running the bootstrap script:

```powershell
$ python script\bootstrap.py -v --target_arch=ia32
```

The other building steps are exactly the same.

## Visual Studio project

To generate a Visual Studio project, you can pass the `--msvs` parameter:

```powershell
$ python script\bootstrap.py --msvs
```

## Tests

Test your changes conform to the project coding style using:

```powershell
$ python script\cpplint.py
```

Test functionality using:

```powershell
$ python script\test.py
```

Tests that include native modules (e.g. `runas`) can't be executed with the
debug build (see [#2558](https://github.com/electron/electron/issues/2558) for
details), but they will work with the release build.

To run the tests with the release build use:

```powershell
$ python script\test.py -R
```

## Troubleshooting

### Command xxxx not found

If you encountered an error like `Command xxxx not found`, you may try to use
the `VS2015 Command Prompt` console to execute the build scripts.

### Fatal internal compiler error: C1001

Make sure you have the latest Visual Studio update installed.

### Assertion failed: ((handle))->activecnt >= 0

If building under Cygwin, you may see `bootstrap.py` failed with following
error:

```
Assertion failed: ((handle))->activecnt >= 0, file src\win\pipe.c, line 1430

Traceback (most recent call last):
  File "script/bootstrap.py", line 87, in <module>
    sys.exit(main())
  File "script/bootstrap.py", line 22, in main
    update_node_modules('.')
  File "script/bootstrap.py", line 56, in update_node_modules
    execute([NPM, 'install'])
  File "/home/zcbenz/codes/raven/script/lib/util.py", line 118, in execute
    raise e
subprocess.CalledProcessError: Command '['npm.cmd', 'install']' returned non-zero exit status 3
```

This is caused by a bug when using Cygwin Python and Win32 Node together. The
solution is to use the Win32 Python to execute the bootstrap script (assuming
you have installed Python under `C:\Python27`):

```powershell
$ /cygdrive/c/Python27/python.exe script/bootstrap.py
```

### LNK1181: cannot open input file 'kernel32.lib'

Try reinstalling 32bit Node.js.

### Error: ENOENT, stat 'C:\Users\USERNAME\AppData\Roaming\npm'

Simply making that directory [should fix the problem](http://stackoverflow.com/a/25095327/102704):

```powershell
$ mkdir ~\AppData\Roaming\npm
```

### node-gyp is not recognized as an internal or external command

You may get this error if you are using Git Bash for building, you should use
PowerShell or VS2015 Command Prompt instead.


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>moe.pingu.iii.type</title>
<meta name="date" content="2016-04-20">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

moe.pingu.iii.type

Classes

TypeFinalTestEx1


text:
#include "Windows.h"
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <dbghelp.h>
#include <stdlib.h>

#include "symbols.h"

#define FAKE_BASE_ADDRESS 0x1

bool PdbOpenPdb(PDB_PARSER_T *pPdbParserHandle, const char *pPDBPath)
{
    bool bOk = false;

    pPdbParserHandle->hProcess = GetCurrentProcess();
    if (SymInitialize(pPdbParserHandle->hProcess, NULL, false) == false){
        printf("Failed to SymInitialize\n");
        return false;
    }

    DWORD BaseAddr = FAKE_BASE_ADDRESS;
    DWORD FileSize = 0;
    HANDLE hFile = CreateFile(pPDBPath, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
    if (hFile != INVALID_HANDLE_VALUE){
        if (GetFileSize(hFile, &FileSize) != INVALID_FILE_SIZE){
            if (SymLoadModule(pPdbParserHandle->hProcess, NULL, pPDBPath, NULL, BaseAddr, FileSize) > 0){
                bOk = true;
            }
            else{
                printf("Failed to SymLoadModuleEx (%d)\n", GetLastError());
            }
        }
        else{
            printf("Failed to GetFileSize (%d)\n", GetLastError());
        }
    }
    else{
        printf("Failed to CreateFile\n");
    }

    if (hFile != INVALID_HANDLE_VALUE){
        CloseHandle(hFile);
    }
    if (bOk == false){
        SymCleanup(pPdbParserHandle->hProcess);
    }

    return bOk;
}

bool PdbGetSymbolsRVA(PDB_PARSER_T  *pPdbParserHandle, const char *pSymbolName, uint64_t *pRVA)
{
    char Buffer[1024];
    memset(Buffer, 0, sizeof(Buffer));
    SYMBOL_INFO *pInfo = (SYMBOL_INFO *)Buffer;
    *pRVA = 0;

    pInfo->SizeOfStruct = sizeof(*pInfo);
    pInfo->MaxNameLen = MAX_PATH;
    pInfo->ModBase = 0;

    if (SymFromName(pPdbParserHandle->hProcess, pSymbolName, pInfo) == false) {
        printf("Failed to SymFromName (%d)\n", GetLastError());
        return false;
    }
    *pRVA = pInfo->Address - FAKE_BASE_ADDRESS;

    return true;
}

bool PdbClose(PDB_PARSER_T  *pPdbParserHandle)
{
    SymCleanup(pPdbParserHandle->hProcess);
    return true;
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.kusto.models;

import com.azure.resourcemanager.kusto.fluent.models.OutboundNetworkDependenciesEndpointInner;
import java.util.List;

/** An immutable client-side representation of OutboundNetworkDependenciesEndpoint. */
public interface OutboundNetworkDependenciesEndpoint {
    /**
     * Gets the id property: Fully qualified resource Id for the resource.
     *
     * @return the id value.
     */
    String id();

    /**
     * Gets the name property: The name of the resource.
     *
     * @return the name value.
     */
    String name();

    /**
     * Gets the type property: The type of the resource.
     *
     * @return the type value.
     */
    String type();

    /**
     * Gets the etag property: A unique read-only string that changes whenever the resource is updated.
     *
     * @return the etag value.
     */
    String etag();

    /**
     * Gets the category property: The type of service accessed by the Kusto Service Environment, e.g., Azure Storage,
     * Azure SQL Database, and Azure Active Directory.
     *
     * @return the category value.
     */
    String category();

    /**
     * Gets the endpoints property: The endpoints that the Kusto Service Environment reaches the service at.
     *
     * @return the endpoints value.
     */
    List<EndpointDependency> endpoints();

    /**
     * Gets the provisioningState property: The provisioned state of the resource.
     *
     * @return the provisioningState value.
     */
    ProvisioningState provisioningState();

    /**
     * Gets the inner com.azure.resourcemanager.kusto.fluent.models.OutboundNetworkDependenciesEndpointInner object.
     *
     * @return the inner object.
     */
    OutboundNetworkDependenciesEndpointInner innerModel();
}


text:
namespace sesame { namespace crypto {

std::shared_ptr<IMachine> MachineFactory::buildMachine( const Protocol protocol )
{
   std::shared_ptr<IMachine> machine;

   switch ( protocol )
   {
      case PROTOCOL_SCRYPT_AES_CBC_SHA_V1:
         machine.reset( new ScryptAesCbcShaV1Machine() );
         break;

      case PROTOCOL_UNKNOWN:
         throw std::runtime_error( "unknown protocol" );

      default:
         throw std::runtime_error( "unsupported protocol" );
   }

   return machine;
}

} }


text:
using System;
using UnityEngine;
using System.Reflection;
using System.Collections.Generic;
using System.Linq;
using UnityEditor;

public class RuneManager : MonoBehaviour
{

    public static string RUNE_TYPE = "runeType";

    public static Dictionary<string, Type> stringToRune = new Dictionary<string, Type>();

    public List<Rune> gameRunes;

    public Queue<Rune> runePump;

    private Dictionary<Type, List<Action<Rune, Action>>> runeEvents;

    public static RuneManager Singelton;

    public int currentCallbacks;

    public Queue<string> messages;

    void Awake()
    {

        Singelton = this;
        runeEvents = new Dictionary<Type, List<Action<Rune, Action>>>();
        gameRunes = new List<Rune>();
        currentCallbacks = 0;
        runePump = new Queue<Rune>();
        messages = new Queue<string>();
    }

    void Update()
    {
        if(messages.Count > 0)
        {
            ParseRuneAndExecute(messages.Dequeue());
        }
    }

    public void ParseRuneAndExecute(string runeAsString)
    {
        Debug.Log(runeAsString);
        JSONObject jsonObject = new JSONObject(runeAsString);
        string typeOfRune = jsonObject[RUNE_TYPE].str;
        if (typeOfRune != "optionRune")
        {
            var type = Type.GetType(typeOfRune);
			var runeObj = Activator.CreateInstance(type);
            for (int i = 0; i < jsonObject.keys.Count; i++)
            {
                var property = type.GetProperty(jsonObject.keys[i]);
                if (jsonObject.keys[i] == "runeType")
                    continue;
                switch (jsonObject[jsonObject.keys[i]].type)
                {
                    case JSONObject.Type.STRING:
                        property.SetValue(runeObj, jsonObject[jsonObject.keys[i]].str, null);
                        break;
                    case JSONObject.Type.NUMBER:

                        if (!jsonObject.keys[i].Contains("uid"))
                        {
//							Debug.Log (jsonObject.keys [i]);
                            property.SetValue(runeObj, (int)jsonObject[jsonObject.keys[i]].i, null);
                        }
                        else
                        {
                            property.SetValue(runeObj, jsonObject[jsonObject.keys[i]].i.ToString(), null);
                        }
                        break;
                    case JSONObject.Type.BOOL:
                        property.SetValue(runeObj, jsonObject[jsonObject.keys[i]].b, null);
                        break;
                    case JSONObject.Type.ARRAY:
                        break;
                    default:
                 //       Debug.Log("I have not done that type");
                        break;
                }
            }
            Singelton.ExecuteRune((Rune)runeObj);
        }
        else
        {
            OptionsManager.Singleton.StartToProcessOptions(jsonObject);
        }
    }

    public void PlaceMessageInQueue(string message)
    {
        messages.Enqueue(message);
    }

    public void ExecuteRune(Rune rune)
    {
        runePump.Enqueue(rune);
        if (currentCallbacks == 0)
        {
            PumpRuneQue();
        }
    }

    void PumpRuneQue()
    {
        var rune = runePump.Dequeue();
        CallbackNumberUp();
        rune.Execute(CallbackNumberDown);
        if (runeEvents.ContainsKey(rune.GetType()))
        {
            for (var i = 0; i < runeEvents[rune.GetType()].Count; i++)
            {
                CallbackNumberUp();
                runeEvents[rune.GetType()][i].Invoke(rune, CallbackNumberDown);
            }
        }
        RecordAllRune(rune);
    }

    public void AddListener(Type type, Action<Rune, Action> action)
    {
        if (!runeEvents.ContainsKey(type))
            runeEvents.Add(type, new List<Action<Rune, Action>>());

        runeEvents[type].Add(action);
    }

    public void RemoveListener(Type type, Action<Rune, Action> action)
    {
        if (!runeEvents.ContainsKey(type)) return;

        runeEvents[type].Remove(action);
    }

    public void CallbackNumberUp()
    {

        currentCallbacks++;
    }

    public void CallbackNumberDown()
    {
        currentCallbacks--;
        if (currentCallbacks != 0) return;
        if (runePump.Count > 0)
        {
            PumpRuneQue();
        }
    }

    public void RecordAllRune(Rune rune)
    {
        gameRunes.Add(rune);
    }

}

public abstract class Rune
{
    public string name;
    public abstract void OnGUI();
    public abstract void Execute(System.Action action);
}


text:
var io = null;
var Lobby = require("./models/Lobby");
var User = require("./models/User");
var queueManager = require("./queueManager");
var slackbot = require("./slackbot.js")

var lobbies = [];

var createLobby = function (lobbyUrl, lobbyName) {
    var newLobby = new Lobby();
    newLobby.title = lobbyName;
    newLobby.namespace = io.of(lobbyUrl);

    //Join a lobby
    newLobby.namespace.on("connection", function (socket) {
        socket.on("join_lobby", function (user) {
            if (socket.user) {
                newLobby.users.splice(newLobby.users.indexOf(socket.user), 1);
                console.log("User changed name to " + user);
                socket.user.name = user;
            } else {
                console.log("User: " + user + " has joined the lobby");
                socket.user = new User();
                socket.user.name = user;
                socket.user.color = '#' + Math.floor(Math.random() * 16777215).toString(16);
            }

            newLobby.users.push(socket.user);

            if (newLobby.users.length == 1) {
                //Start the internal timer
                newLobby.timer = setInterval(function () {
                    if (newLobby.queue[0]) {
                        newLobby.queue[0].time++;
                    }
                }, 1000);
            }

            //Let everyone else know
            newLobby.namespace.emit("lobby", newLobby.users);

            //Tell them what's playing
            socket.emit("song", newLobby.queue[0]);
            socket.emit("queue", newLobby.queue);
        });

        socket.on("disconnect", function () {
            for (var i = 0; i < newLobby.users.length; i++) {
                if (newLobby.users[i].color == socket.user.color) {
                    console.log(socket.user.name + " has left the lobby.");
                    newLobby.users.splice(i, 1);
                }
            }

            //Let everyone else know
            newLobby.namespace.emit("lobby", newLobby.users);

            if (!newLobby.users.length) {
                //If nobody is in the room, pause the timer
                clearInterval(newLobby.timer);
            }
        });

        socket.on("clear_lobby",function(){
            newLobby.queue = [];
            newLobby.history = [];
            //Let everyone know
            newLobby.namespace.emit("queue", newLobby.queue);
        });

        queueManager.manage(socket, newLobby);
    });
    //Let the socket pay attention to the queue of songs
    slackbot.setup(io, newLobby);
    lobbies.push(newLobby);
}

var setup = function (newio) {
    io = newio;

    createLobby("default", "Default Lobby");
}
exports.setup = setup;


text:
"""
Description of recisio.py
======================

:Example:

source activate py27
python recisio.py

"""

import os
import re
import sys
import utils
import shutil
import pymysql
from pydub import AudioSegment

def rm_space(string):
    """
    remove the first and last space if present in the str
    """
    if " " in string[0]:
        string = string[1:]
    if " " in string[-1]:
        string = string[:-1]
    return string

def list_files():
    folders = ["../features/marsyas/", "../features/yaafe/"]
    data = []
    for fold in folders:
        file_list = os.listdir(fold)
        for filen in file_list:
            filen = filen.replace("_", " ")
            info = filen.split("-")
            data.append(rm_space(info[2]) + "," + rm_space(info[0]) + "," + rm_space(info[1]) + "\n")
    data = list(set(data))
    with open("file_list.csv", "w") as filep:
        filep.write("id,artist,track\n")
        for line in data:
            filep.write(line)

def bextract_features(in_fn, out_fn, verbose=False):
    bextract_cmd = "bextract -mfcc -zcrs -ctd -rlf -flx -ws 1024 -as 898 -sv -fe " + in_fn + " -w " + out_fn
    if not verbose:
        bextract_cmd += " > /dev/null 2>&1"
    # print(bextract_cmd)
    # sys.exit()
    os.system(bextract_cmd)

def validate_arff(filename):
    """Description of validate_arff

    Check if filename exists on path and is a file
    If file corresponds to valid arff file return absolute path
    Otherwise move file to invalid directory and return False
    """
    # Check if file exists
    if os.path.isfile(filename) and os.path.exists(filename):
        filename = os.path.abspath(filename)
    else:
        return False
    # If does not satisfy min size, move to "empty" folder
    if os.stat(filename).st_size < 8100:
        tmp_path = filename.split("/")
        empty_dirname = "/".join(tmp_path[:-1]) + "/empty/"
        if not os.path.exists(empty_dirname):
            os.makedirs(empty_dirname)
        shutil.move(filename, empty_dirname + tmp_path[-1])
        return False
    # # If filename does not match with feature name, move to "invalid" folder
    # name_file = filename.split("/")[-1][:12]
    # with open(filename) as filep:
    #     for i, line in enumerate(filep):
    #         if i == 70:
    #             # 71th line
    #             name_feat = line.split(" ")[2][1:13]
    #             break
    # if name_file != name_feat:
    #     tmp_path = filename.split("/")
    #     invalid_dirname = "/".join(tmp_path[:-1]) + "/invalid/"
    #     if not os.path.exists(invalid_dirname):
    #         os.makedirs(invalid_dirname)
    #     shutil.move(filename, invalid_dirname + tmp_path[-1])
    #     return False
    # If everything went well, return filename absolute path
    return filename

def merge_arff(indir, outfilename):
    """Description of merge_arff

    bextract program from Marsyas generate one output file per audio file
    This function merge them all in one unique file
    Check if analysed file are valid i.e. not empty
    """
    utils.print_success("Preprocessing ARFFs")
    indir = utils.abs_path_dir(indir)
    filenames = os.listdir(indir)
    outfn = open(outfilename, 'w')
    cpt_invalid_fn = 0
    # Write first lines of ARFF template file
    for filename in filenames:
        if os.path.isfile(indir + filename):
            new_fn = validate_arff(indir + filename)
            if new_fn:
                with open(new_fn, 'r') as template:
                    nb_line = 74
                    for line in template:
                        if not nb_line:
                            break
                        nb_line -= 1
                        outfn.write(line)
                    break
            else:
                cpt_invalid_fn += 1
    # Append all arff file to the output file
    cur_file_num = 1
    for filename in filenames:
        if os.path.isfile(indir + filename):
            new_fn = validate_arff(indir + filename)
            if new_fn:
                cur_file_num = cur_file_num + 1
                utils.print_progress_start("Analysing file\t" + str(cur_file_num))
                fname = open(new_fn, 'r')
                outfn.write("".join(fname.readlines()[74:77]))
                fname.close()
            else:
                cpt_invalid_fn += 1
    utils.print_progress_end()
    outfn.close()
    # os.system("rm " + indir + "*.arff")
    if cpt_invalid_fn:
        utils.print_warning(str(cpt_invalid_fn) + " ARFF files with errors found")
    return outfilename

def marsyas(out_dir, filelist):
    """Definition of marsyas

    bextract is the cmd in marsyas that extract the features.
    It needs as input a file which contains a list of audio files to compute.
    If an audio file is corrupted, bextract crashes.
    So, it is necessary to call bextract with only one audio file each time.

    bextract then produces one output file for each audio file.
    It is neccesary to merge those files into one common file.
    """
    dir_feat = utils.create_dir(utils.create_dir(out_dir) + "marsyas/")
    tmp = "tmp.mf"
    for index, filen in enumerate(filelist):
        utils.print_progress_start(str(index+1) + "/" + str(len(filelist)) + " " + filen.split(os.sep)[-1])
        dir_audio = filen.split("/")[:-1]
        filen = filen.split("/")[-1]
        filen = filen.replace(" ", "_")
        filen = filen.replace("'", "_")
        filen = filen.replace('"', "_")
        # tmp = filen + ".mf"
        with open(tmp, "a") as filep:
            filep.write(os.sep.join(dir_audio) + os.sep + filen + "\n")
        outfilename = dir_feat + filen + ".arff"
    bextract_features(tmp, outfilename, verbose=True)
    os.remove(tmp)
    merge_arff(dir_feat, out_dir + "marsyas.arff")

def run_cmd(cmd_name, verbose=False):
    if not verbose:
        cmd_name += " > /dev/null 2>&1"
    os.system(cmd_name)

def essentia_extract_feat(in_fn, out_fn, verbose=False):
    cmd = "/home/yann/MTG/Extractor/essentia-extractors-v2.1_beta2/streaming_extractor_music '" + in_fn + "' '" + out_fn + "'"
    run_cmd(cmd)

def essentia(out_dir, filen):
    dir_feat = utils.create_dir(utils.create_dir(out_dir) + "essentia/")
    output = dir_feat + filen.split("/")[-1] + ".json"
    essentia_extract_feat(filen, output)

def extract_features(dir_audio, dir_feat):
    dir_audio = utils.abs_path_dir(dir_audio)
    dir_feat = utils.abs_path_dir(dir_feat)
    filelist = []
    for elem in os.listdir(dir_audio):
        if os.path.isfile(dir_audio + elem):
            filelist.append(dir_audio + elem)
        else:
            for filename in os.listdir(dir_audio + elem):
                if "ld.wav" in filename:
                    filelist.append(dir_audio + elem + "/" + filename)
    # marsyas(dir_feat, filelist)
    for index, filen in enumerate(filelist):
        utils.print_progress_start(str(index+1) + "/" + str(len(filelist)) + " " + filen.split(os.sep)[-1])
        utils.yaafe(filen)
        essentia(dir_feat, filen)
    utils.print_progress_end()

def request(query, verbose=False):
    try:
        db = pymysql.connect(host="localhost",user="yann",passwd="yann",db="doctorat")
    except Exception:
        print("Error in MySQL connexion")
    else:
        cur = db.cursor()
        try:
            cur.execute(query)
        except Exception:
            print("Error with query: " + query)
        else:
            db.commit()
            result = cur.fetchall()
            print(result)
        db.close()

def update_filelist():
    """
    @brief      Update the database with the boolean indicating if features have
     been extracted a tool
    """
    main_dir = "E:/_These/DataSets/Recisio/features/"
    folders = ["marsyas/", "yaafe/", "essentia/"]
    for fold in folders:
        fold = main_dir + fold
        query = "UPDATE recisio SET " + fold.split("/")[-2] + " = 1 WHERE id = "
        file_list = os.listdir(fold)
        for index, filen in enumerate(file_list):
            print(index)
            m = re.search(r"\d{2,10}", filen)
            request(query + m.group())

def export(outfile):
    """
    @brief      Export artist and track name from the database
    @param      outfile  The outfile for storing artist and track name
    """
    query = "SELECT artist,track FROM recisio "
    query += "WHERE feat_marsyas=1 AND feat_yaafe=1 and feat_essentia=1 "
    query += "and artist NOT IN ('christmas-carol', 'traditional', 'comptine', "
    query += "'nursery-rhyme', 'happy-birthday-songs', 'mexican-traditional') "
    query += "ORDER BY artist ASC "
    query += "INTO OUTFILE '" + outfile + "' "
    query += "FIELDS TERMINATED BY ',' "
    request(query)

def remaining(outfile):
    """
    @brief      Export remaining tracks to listen to
    @param      outfile  The outfile for storing the artist and track name
    """
    query = "SELECT artist,track "
    query += "FROM recisio "
    query += "WHERE feat_marsyas=1 AND feat_yaafe=1 and feat_essentia=1 and tag_gender ='' "
    query += "ORDER BY artist ASC "
    query += "INTO OUTFILE '" + outfile + "' "
    query += "FIELDS TERMINATED BY ',' "
    request(query)

def add_info_bv():
    """
    @brief      Adds an information about the presence of backing vocals.
                So update gender to mixed.
                TODO: later need to listen to the lead voice without bv

    @return     No return value
    """
    main_dir = "E:/_These/DataSets/Recisio/audio/"
    query1 = "UPDATE recisio SET gender = 'mixed' WHERE id = "
    query2 = "UPDATE recisio SET tag_back_voc = 1 WHERE id = "
    for index, fold in enumerate(os.listdir(main_dir)):
        print(index)
        if os.path.isdir(main_dir + fold):
            filelist = os.listdir(main_dir + fold)
            for filen in filelist:
                if "-bv-" in filen:
                    m = re.search(r"\d{2,10}", filen)
                    request(query1 + m.group())
                    request(query2 + m.group())
                    break

def stat():
    """
    @brief      Display stat about the database
    """
    pass
    # query = "SELECT artist,track "
    # query += "FROM recisio "
    # query += "WHERE marsyas=1 AND yaafe=1 and essentia=1 and gender ='' "
    # query += "ORDER BY artist ASC "
    #intro
     query += "INTO OUTFILE '" + outfile + "' "
    # query += "FIELDS TERMINATED BY ',' "
    # request(query)

def audio2mp3(folder, verbose=True):
    """
    @brief      Convert any audio files to mp3

    @param      folder  The folder containing audio files to be converted in mp3
    """
    folder = utils.abs_path_dir(folder)
    filelist = os.listdir(folder)
    for index, entire_fn in enumerate(filelist):
        if verbose:
            print(str(index + 1) + "/" + str(len(filelist)) + " " + entire_fn)
        filen = entire_fn.split(".")[0]
        extension = entire_fn.split(".")[1]
        print(filen)
        print(extension)
        print(folder + entire_fn)
        print(folder + filen)
        audio = AudioSegment.from_file(folder + entire_fn, format=extension)
        audio.export(folder + filen + ".mp3", format="mp3")
    if verbose:
        print("Conversion done")

def main():
    """
    @brief      Main entry point
    """
    # audio2mp3("D:/_Doctorat/ISMIR2017/origins/conv")
    # list_files()
    # update_filelist()
    # export(outfile="D:/_Doctorat/ISMIR2017/data/artist_track.csv")
    # remaining(outfile="D:/_Doctorat/ISMIR2017/data/remaining.csv")
    # add_info_bv()
    # dir_feat1 = "/media/sf_SharedFolder/DataSets/Recisio/features/"
    # dir_feat2 = "E:/_These/DataSets/Recisio/features/"
    dir_audio = "/media/sf_DATA/ISMIR2017/origins/"
    dir_feat3 = "/media/sf_DATA/ISMIR2017/features/origins/"
    extract_features(dir_audio, dir_feat3)

if __name__ == "__main__":
    main()


text:
package com.netflix.eureka.guice;

import com.google.inject.AbstractModule;
import com.google.inject.Scopes;
import com.netflix.eureka.DefaultEurekaServerConfig;
import com.netflix.eureka.DefaultEurekaServerContext;
import com.netflix.eureka.EurekaServerConfig;
import com.netflix.eureka.EurekaServerContext;
import com.netflix.eureka.aws.AwsBinderDelegate;
import com.netflix.eureka.cluster.PeerEurekaNodes;
import com.netflix.eureka.registry.AbstractInstanceRegistry;
import com.netflix.eureka.registry.AwsInstanceRegistry;
import com.netflix.eureka.registry.InstanceRegistry;
import com.netflix.eureka.registry.PeerAwareInstanceRegistry;
import com.netflix.eureka.resources.DefaultServerCodecs;
import com.netflix.eureka.resources.ServerCodecs;

/**
 * @author David Liu
 */
public class Ec2EurekaServerModule extends AbstractModule {
    @Override
    protected void configure() {
        bind(EurekaServerConfig.class).to(DefaultEurekaServerConfig.class).in(Scopes.SINGLETON);
        bind(PeerEurekaNodes.class).in(Scopes.SINGLETON);

        bind(AwsBinderDelegate.class).asEagerSingleton();

        // registry and interfaces
        bind(AwsInstanceRegistry.class).asEagerSingleton();
        bind(InstanceRegistry.class).to(AwsInstanceRegistry.class);
        bind(AbstractInstanceRegistry.class).to(AwsInstanceRegistry.class);
        bind(PeerAwareInstanceRegistry.class).to(AwsInstanceRegistry.class);

        bind(ServerCodecs.class).to(DefaultServerCodecs.class).in(Scopes.SINGLETON);

        bind(EurekaServerContext.class).to(DefaultEurekaServerContext.class).in(Scopes.SINGLETON);
    }

    @Override
    public boolean equals(Object obj) {
        return Ec2EurekaServerModule.class.equals(obj.getClass());
    }

    @Override
    public int hashCode() {
        return Ec2EurekaServerModule.class.hashCode();
    }
}


text:
<?php

namespace PROCERGS\LoginCidadao\CoreBundle\Controller\Admin;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Routing\Annotation\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Response;
use PROCERGS\LoginCidadao\CoreBundle\Form\Type\ContactFormType;
use PROCERGS\LoginCidadao\CoreBundle\Entity\SentEmail;
use PROCERGS\OAuthBundle\Entity\Client;

/**
 * @Route("/admin")
 */
class DefaultController extends Controller
{

    /**
     * @Route("/", name="lc_admin")
     * @Template()
     */
    public function indexAction()
    {
        return $this->redirect($this->generateUrl('lc_admin_app'));
    }

}


text:
<!doctype html>

    <meta name="viewport" content="width=device-width">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>{% block title %}{% endblock %}</title>

                {% block preheader %}{% endblock %}

                          {% block content %}{% endblock %}


text:
@implementation DZAlphaView
- (void) touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [self.nextResponder touchesBegan:touches withEvent:event];
    [self.superview touchesBegan:touches withEvent:event];
}

- (void) touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [self.nextResponder touchesEnded:touches withEvent:event];
    [self.superview touchesEnded:touches withEvent:event];
}

- (void) touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [self.nextResponder touchesMoved:touches withEvent:event];
    [self.superview touchesMoved:touches withEvent:event];
}

- (void) touchesCancelled:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [self.nextResponder touchesCancelled:touches withEvent:event];
    [self.superview touchesCancelled:touches withEvent:event];
}

@end


text:
"""
Tests for mc_tools2.py

Functions
---------
    mc_sample_path          [Status: TBD]

"""

from __future__ import division

import numpy as np
import unittest
from numpy.testing import assert_allclose

# from quantecon.mc_tools import DMarkov, mc_sample_path
from mc_tools2 import DMarkov

# KMR Function
# Useful because it seems to have 1 unit eigvalue, but a second one that
# approaches unity.  Good test of accuracy.
def KMR_Markov_matrix_sequential(N, p, epsilon):
    """
    Generate the Markov matrix for the KMR model with *sequential* move

    N: number of players
    p: level of p-dominance for action 1
       = the value of p such that action 1 is the BR for (1-q, q) for any q > p,
         where q (1-q, resp.) is the prob that the opponent plays action 1 (0, resp.)
    epsilon: mutation probability

    References:
        KMRMarkovMatrixSequential is contributed from https://github.com/oyamad
    """
    P = np.zeros((N+1, N+1), dtype=float)
    P[0, 0], P[0, 1] = 1 - epsilon * (1/2), epsilon * (1/2)
    for n in range(1, N):
        P[n, n-1] = \
            (n/N) * (epsilon * (1/2) +
                     (1 - epsilon) * (((n-1)/(N-1) < p) + ((n-1)/(N-1) == p) * (1/2))
                     )
        P[n, n+1] = \
            ((N-n)/N) * (epsilon * (1/2) +
                         (1 - epsilon) * ((n/(N-1) > p) + (n/(N-1) == p) * (1/2))
                         )
        P[n, n] = 1 - P[n, n-1] - P[n, n+1]
    P[N, N-1], P[N, N] = epsilon * (1/2), 1 - epsilon * (1/2)
    return P

# Tests: methods of DMarkov #

def test_dmarkov_pmatrices():
    """
    Test the methods of DMarkov with P matrix and known solutions
    """
    testset = [
        {'P': np.array([[0.4, 0.6], [0.2, 0.8]]),  # P matrix
         'stationary_dists': np.array([[0.25, 0.75]]),  # Known solution
         'comm_classes': [list(range(2))],
         'rec_classes': [list(range(2))],
         'is_irreducible': True,
         },
        {'P': np.eye(2),
         'stationary_dists': np.eye(2),
         'comm_classes': [[i] for i in range(2)],
         'rec_classes': [[i] for i in range(2)],
         'is_irreducible': False,
         }
    ]

    # Loop Through TestSet #
    for test_dict in testset:
        mc = DMarkov(test_dict['P'])
        computed = mc.compute_stationary()
        assert_allclose(computed, test_dict['stationary_dists'])

        assert(sorted(mc.comm_classes) == sorted(test_dict['comm_classes']))
        assert(mc.num_comm_classes == len(test_dict['comm_classes']))
        assert(mc.is_irreducible == test_dict['is_irreducible'])
        assert(sorted(mc.rec_classes) == sorted(test_dict['rec_classes']))
        assert(mc.num_rec_classes == len(test_dict['rec_classes']))

# Basic Class Structure with Setup #
####################################

class Test_dmarkov_compute_stationary_KMRMarkovMatrix2():
    """
    Test Suite for mc_compute_stationary using KMR Markov Matrix [suitable for nose]
    """

    # Starting Values #

    N = 27
    epsilon = 1e-2
    p = 1/3
    TOL = 1e-2

    def setUp(self):
        """ Setup a KMRMarkovMatrix and Compute Stationary Values """
        self.P = KMR_Markov_matrix_sequential(self.N, self.p, self.epsilon)
        self.mc = DMarkov(self.P)
        self.stationary = self.mc.compute_stationary()
        stat_shape = self.stationary.shape

        if len(stat_shape) == 1:
            self.n_stat_dists = 1
        else:
            self.n_stat_dists = stat_shape[0]

    def test_markov_matrix(self):
        "Check that each row of matrix sums to 1"
        mc = self.mc
        assert_allclose(np.sum(mc.P, axis=1), np.ones(mc.n))

    def test_sum_one(self):
        "Check each stationary distribution sums to 1"
        stationary_distributions = self.stationary
        assert_allclose(np.sum(stationary_distributions, axis=1),
                        np.ones(self.n_stat_dists))

    def test_nonnegative(self):
        "Check that the stationary distributions are non-negative"
        stationary_distributions = self.stationary
        assert(np.all(stationary_distributions > -1e-16))

    def test_left_eigen_vec(self):
        "Check that vP = v for all stationary distributions"
        mc = self.mc
        stationary_distributions = self.stationary

        if self.n_stat_dists == 1:
            assert_allclose(np.dot(stationary_distributions, mc.P),
                            stationary_distributions, atol=self.TOL)
        else:
            for i in range(self.n_stat_dists):
                curr_v = stationary_distributions[i, :]
                assert_allclose(np.dot(curr_v, mc.P), curr_v, atol=self.TOL)


text:
//
//  main.m
//  Check It Off
//
//  Created by ___FULLUSERNAME___ on ___DATE___.
//  Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved.
//

#import <UIKit/UIKit.h>

int main(int argc, char* argv[])
{
    @autoreleasepool {
        int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate");
        return retVal;
    }
}


text:
package org.kiji.schema;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import java.util.Iterator;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.kiji.schema.KijiDataRequestBuilder.ColumnsDef;
import org.kiji.schema.layout.KijiTableLayouts;
import org.kiji.schema.util.VersionInfo;

/** Basic tests for a fake Kiji instance. */
public class TestFakeKiji extends KijiClientTest {
  private static final Logger LOG = LoggerFactory.getLogger(TestFakeKiji.class);

  @Test
  public void testFakeKiji() throws Exception {
    LOG.info("Opening an in-memory kiji instance");
    final KijiURI uri = KijiURI
        .newBuilder(String.format("kiji://.fake.%s/instance", getTestId()))
        .build();
    final Configuration conf = HBaseConfiguration.create();
    KijiInstaller.get().install(uri, conf);

    final Kiji kiji = Kiji.Factory.open(uri, conf);
    try {
      LOG.info(String.format("Opened fake Kiji '%s'.", kiji.getURI()));

      final KijiSystemTable systemTable = kiji.getSystemTable();
      assertTrue("Client data version should support installed Kiji instance data version",
          VersionInfo.getClientDataVersion().compareTo(systemTable.getDataVersion()) >= 0);

      assertNotNull(kiji.getSchemaTable());
      assertNotNull(kiji.getMetaTable());

      kiji.createTable(KijiTableLayouts.getLayout(KijiTableLayouts.SIMPLE));
      final KijiTable table = kiji.openTable("table");
      try {
        {
          final KijiTableReader reader = table.openTableReader();
          try {
            final KijiDataRequest dataRequest = KijiDataRequest.builder()
                .addColumns(ColumnsDef.create().addFamily("family"))
                .build();
            final KijiRowScanner scanner = reader.getScanner(dataRequest);
            try {
              assertFalse(scanner.iterator().hasNext());
            } finally {
              scanner.close();
            }
          } finally {
            reader.close();
          }
        }

        {
          final KijiTableWriter writer = table.openTableWriter();
          try {
            writer.put(table.getEntityId("row1"), "family", "column", "the string value");
          } finally {
            writer.close();
          }
        }

        {
          final KijiTableReader reader = table.openTableReader();
          try {
            final KijiDataRequest dataRequest = KijiDataRequest.builder()
                .addColumns(ColumnsDef.create().addFamily("family"))
                .build();
            final KijiRowScanner scanner = reader.getScanner(dataRequest);
            try {
              final Iterator<KijiRowData> it = scanner.iterator();
              assertTrue(it.hasNext());
              KijiRowData row = it.next();
              assertEquals("the string value",
                  row.getMostRecentValue("family", "column").toString());
              assertFalse(it.hasNext());
            } finally {
              scanner.close();
            }
          } finally {
            reader.close();
          }
        }
      } finally {
        table.release();
      }
    } finally {
      kiji.release();
    }
  }
}


text:
<?php

namespace OrcaServices\Heartbeat\Heartbeat\Sensor;

use Cake\Chronos\Chronos;

/**
 * Heartbeat Status
 */
class Status
{

    /**
     * Informational status
     */
    const STATUS_INFORMATIONAL = 1;

    /**
     * Noncritical status
     */
    const STATUS_NONCRITICAL = 2;

    /**
     * Critical status
     */
    const STATUS_CRITICAL = 3;

    /**
     * The name of the sensor
     *
     * @var string
     */
    protected $name;

    /**
     * The actual status
     *
     * @var mixed
     */
    protected $status;

    /**
     * The sensor check duration in seconds
     *
     * @var float
     */
    protected $duration;

    /**
     * The date/time when the sensor check was last executed
     *
     * @var \Cake\Chronos\Chronos
     */
    protected $lastExecuted;

    /**
     * How severe the status is, e.g.
     *
     * @var
     */
    protected $severity;

    /**
     * Whether sensor status was fetched from cache
     *
     * @var bool
     */
    protected $checkCached = false;

    /**
     * Status construction
     *
     * @param string $name The name of the sensor
     * @param mixed $status The actual status.
     * @param float $duration How long it took to execute the check.
     * @param Chronos $lastExecuted The date/time when it was executed last.
     * @param int $severity The status severity.
     */
    public function __construct($name, $status, $duration, $lastExecuted, $severity)
    {
        $this->name = $name;
        $this->status = $status;
        $this->duration = $duration;
        $this->lastExecuted = $lastExecuted;
        $this->severity = $severity;
    }

    /**
     * Get the name of the sensor
     *
     * @return string
     */
    public function getName(): string
    {
        return $this->name;
    }

    /**
     * Get the sensor check status
     *
     * @return mixed
     */
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * Get the sensor check duration in seconds
     *
     * @return float The sensor check duration in seconds.
     */
    public function getDuration(): float
    {
        return $this->duration;
    }

    /**
     * Get the date/time when the sensor check was last executed
     *
     * @return Chronos The date/time when the sensor check was last executed.
     */
    public function getLastExecuted(): Chronos
    {
        return $this->lastExecuted;
    }

    /**
     * Get the severity of the status
     *
     * @return mixed The severity of the status.
     */
    public function getSeverity()
    {
        return $this->severity;
    }

    /**
     * Set whether the sensor status was fetched from cache
     *
     * @param bool $wasCached
     */
    public function setCheckWasCached(bool $wasCached) {

        $this->checkCached = $wasCached;
    }

    /**
     * Check whether sensor status was fetched from cache
     *
     * @return bool Whether status was cached
     */
    public function wasCheckCached(): bool
    {
        return $this->checkCached;
    }
}