GlobeRiders is extremely proud to offer the 1st inaugural ride of our Himalaya Adventure. We have already done this Ride two times in the Himalayas. We did these exploratory journeys to gain experience and make crucial connections while scouting for the best tracks for our 2018 Adventure.
Your tour leader will be Helge Pedersen who in his younger days criss crossed the globe for 10 years solo on his BMW R80G/S. Needless to say that Helge loves to ride the world. The Himalayas beg to be visited and what better way to do so as on a motorcycle. People are colorful and friendly, nature will impress you with its beauty and you will return as a changed person.
GlobeRiders has been doing group motorcycle adventure tours in Asia since 2000.
Our journeys always start with a Online Forum where we as a group will discuss and prepare for the journey ahead. There are lots of logistics involved in this undertaking, all from bike preparations, visas, inoculations to shipping of the bikes and getting to know your fellow riders.
In early September 2018 we will meet in Chengdu, China. the city is well known for Panda conservation and breeding. From Chengdu we ride north to Tibet as we take our time so we can get used to the high altitude.
The tour being 61 days long gives us enough time not only to ride, but also gives us the opportunity to learn about the cultures and experience the incredible nature of SE Asia.
You will find some of the highlights of the journey below, however the best way to learn about these journeys is to take the time to visit past journals from the various exploratory expeditions, see the list at the bottom of this page with direct links to the journal pages.
Tour Begins: September 11th 2018 we meet in Chengdu, China.
Minimum Group Size: 8 riders and motorcycles - pillion passengers or passengers in chase vehicle are welcome too!
The journey starts in beautiful Chengdu where we will visit the Panda Park. It his here that the Chinese government have been succesful in breeding the endangered Panda.
After leaving Chengdu we will start our ride to Tibet. We will gradually climb higher and higher and slowly, but shurly get aclimitated to higher altitude.
After several days in Lhasa the journey continues to Base Camp of Mt. Everest. Hopefully the weather is good and we will get a good look/picture of the worlds tallest mnountain.
The capital of Nepal, Kathmandu, is another highlight on this journey with rich culture and wonderful people.
Before leaving Nepal we will stop in Chitwan National Park where we spend two nights at a luxory lodge. We will have several excurtions both on the river and on the back of a elephant from where we can enjoy the local wildlife.
After a short two days transit through India we enter Bhutan and immideatelly start to climb the steep hills of the Himalayas. The road is good and the view is spectacular.
We spend no less than 10 days in Bhutan entering in the west and exciting in the far east. In between we will meet some of the most graciouse people. Nature will take your breath away as the roads winds up and down valleys. Truly a highlight on this journey.
After leaving Bhutan we will transit through India on the way to Myanmar. On the way we will see a very different India from what most people are used to see. People are different and so is their land and cultural way of life.
Myanmar is another hidden gem in SE Asia. We have at this stage of the ride said farwell to the high mountains of the Himalayas. From now on much of our traveling will be through farmland and this is the season for rice harvest.
Highlights in Myanmar is our visit to Bagan, Mandaley and not to forget the 3 nights we spend at Inle Lake. We will criss cross the lake in high speed boats to visit villages, crafts centers and local markets.
In so many ways it feels like a cultural shock to enter Thailand where the roads are more like the highways we are used to from home and tourism is everywhere.
Our journey ends in Bangkok, Thailand, and it is here we pack up our bikes and ship them back to Seattle. Still we will have a few days to see some of the atractions in and around Bangkok. Cultural villages and the floating market are all on the agenda.
Accommodations on this journey will vary in quality depending on location and we always strive to provide good hotels and interesting places to spend the night.
All tracks and maps will be uploaded to your Garmin GPS and this is also accompanied with a Map Book and a Road Book. In other words we do not travel in a large group, but rather encourage riders to join in smaller riding groups of 2-3 riders.
We always have room for a spouse or a friend to join our journey with reserved space in our chase vehicle. This can be for the full journey or just for a part of the journey.
To participate in the tour, you must be both experienced and comfortable riding in crowded urban traffic, and over relatively long distances on roads with varying surface conditions on a fully loaded motorcycle. You should own a rough-terrain capable "dual-purpose" type motorcycle, with sturdy, lockable panniers or saddlebags and an approved handlebar-mounted portable Garmin GPS (Global Positioning System) receiver.
The tour package fee DOES include round-trip containerized shipment of your motorcycle from our home port of Seattle, Washington, USA to Chengdu, China. On the return from Bangkok, Thailand, back to Seattle, Washington, USA. Carnet de Passage and the fees involved with this plus all permits for your motorcycle.
Also included is a chase vehicle as your support with English speaking guide and motorcycle guide(s) from GlobeRiders. All outings like museums and cultural events are included and we provide bus transportation so no need to ride your bike. All accommodations, most dinners, all breakfasts, some lunches (on rest days when not riding), fees for guides, drivers and support staff are included.
You will be given a high quality tour T-shirt, decals for your bike, Road and Map Book and your GPS will be loaded with tour maps and tracks of the journey.
The tour package DOES NOT include visa processing fees, motorcycle or shipping insurance, your personal airfare or transportation to Chengdu, China, return airfare or transportation from Bangkok, Thailand, transportation of your motorcycle to/from our home port of Seattle, Washington, USA, deposit fees for your Carnet de Passage, road insurance for your bike or your personal daily expenses such as fuel, consumables, lunch on riding days and tips for guides and drivers, or motorcycle repair or recovery fees in case of a break-down or accident.
** NOTE - A deposit is required to secure your place on this tour. If we are unable to attract a minimum of 8 Riders, the tour will be canceled and your deposit will be refunded in full. The tour is being offered at the tour packages fees listed above for 8 to 18 Riders. If/when we have received a minimum of 8 deposits, the tour is "Go" ; your deposit will not be refunded. Should you withdraw from the tour for any reason it is not refundable. At our discretion, you may be allowed to apply a credit in the amount of your original deposit towards a future tour if taken within one calendar year from the date of your withdrawal. This credit may only be used once. If this credit is not used within one calendar year from the date of your original withdrawal, the credit is forfeited.
The Fine Print: Early planning is essential. Riders and passengers must be qualified by GlobeRiders and provide riding and character references. Tour participants are required to obtain a signed certification of good health from their physician. Only approved motorcycles with spoked wheels are allowed on our tours. An approved Garmin GPS receiver is required for all tours. Participants must show proof of medical and medical evacuation insurance. Safety first: a full coverage or flip-up style full-coverage helmet, full-fingered gloves, full-coverage riding suit with protective armor and riding boots must be worn at all times when your motorbike is in motion. Priority placement is always given to GlobeRiders clients who are return customers. Final pricing for any tour may be adjusted to reflect changes in foreign exchange rates and/or the final group size.
Archived Journals from previous Himalaya Adventures.


text:
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * Used in or for console
 *
 * @package phpMyAdmin-Console
 */

/**
 * Console object
 */
var PMA_console = {
    /**
     * @var object, jQuery object, selector is '#pma_console>.content'
     * @access private
     */
    $consoleContent: null,
    /**
     * @var object, jQuery object, selector is '#pma_console .content',
     *  used for resizer
     * @access private
     */
    $consoleAllContents: null,
    /**
     * @var object, jQuery object, selector is '#pma_console .toolbar'
     * @access private
     */
    $consoleToolbar: null,
    /**
     * @var object, jQuery object, selector is '#pma_console .template'
     * @access private
     */
    $consoleTemplates: null,
    /**
     * @var object, jQuery object, form for submit
     * @access private
     */
    $requestForm: null,
    /**
     * @var object, contain console config
     * @access private
     */
    config: null,
    /**
     * @var bool, if console element exist, it'll be true
     * @access public
     */
    isEnabled: false,
    /**
     * @var bool, make sure console events bind only once
     * @access private
     */
    isInitialized: false,
    /**
     * Used for console initialize, reinit is ok, just some variable assignment
     *
     * @return void
     */
    initialize: function() {

        if ($('#pma_console').length === 0) {
            return;
        }

        PMA_console.isEnabled = true;

        // Cookie var checks and init
        if (! $.cookie('pma_console_height')) {
            $.cookie('pma_console_height', 92);
        }
        if (! $.cookie('pma_console_mode')) {
            $.cookie('pma_console_mode', 'info');
        }

        // Vars init
        PMA_console.$consoleToolbar = $("#pma_console").find(">.toolbar");
        PMA_console.$consoleContent = $("#pma_console").find(">.content");
        PMA_console.$consoleAllContents = $('#pma_console').find('.content');
        PMA_console.$consoleTemplates = $('#pma_console').find('>.templates');

        // Generate a from for post
        PMA_console.$requestForm = $('<form method="post" action="import.php">' +
            '<input name="is_js_confirmed" value="0">' +
            '<textarea name="sql_query"></textarea>' +
            '<input name="console_message_id" value="0">' +
            '<input name="server" value="">' +
            '<input name="db" value="">' +
            '<input name="table" value="">' +
            '<input name="token" value="' +
            PMA_commonParams.get('token') +
            '">' +
            '</form>'
        );
        PMA_console.$requestForm.bind('submit', AJAX.requestHandler);

        // Event binds shouldn't run again
        if (PMA_console.isInitialized === false) {

            // Load config first
            var tempConfig = JSON.parse($.cookie('pma_console_config'));
            if (tempConfig) {
                if (tempConfig.alwaysExpand === true) {
                    $('#pma_console_options input[name=always_expand]').prop('checked', true);
                }
                if (tempConfig.startHistory === true) {
                    $('#pma_console_options').find('input[name=start_history]').prop('checked', true);
                }
                if (tempConfig.currentQuery === true) {
                    $('#pma_console_options').find('input[name=current_query]').prop('checked', true);
                }
                if (ConsoleEnterExecutes === true) {
                    $('#pma_console_options').find('input[name=enter_executes]').prop('checked', true);
                }
                if (tempConfig.darkTheme === true) {
                    $('#pma_console_options').find('input[name=dark_theme]').prop('checked', true);
                    $('#pma_console').find('>.content').addClass('console_dark_theme');
                }
            } else {
                $('#pma_console_options').find('input[name=current_query]').prop('checked', true);
            }

            PMA_console.updateConfig();

            PMA_consoleResizer.initialize();
            PMA_consoleInput.initialize();
            PMA_consoleMessages.initialize();
            PMA_consoleBookmarks.initialize();
            PMA_consoleDebug.initialize();

            PMA_console.$consoleToolbar.children('.console_switch').click(PMA_console.toggle);

            $('#pma_console').find('.toolbar').children().mousedown(function(event) {
                event.preventDefault();
                event.stopImmediatePropagation();
            });

            $('#pma_console').find('.button.clear').click(function() {
                PMA_consoleMessages.clear();
            });

            $('#pma_console').find('.button.history').click(function() {
                PMA_consoleMessages.showHistory();
            });

            $('#pma_console').find('.button.options').click(function() {
                PMA_console.showCard('#pma_console_options');
            });

            $('#pma_console').find('.button.debug').click(function() {
                PMA_console.showCard('#debug_console');
            });

            PMA_console.$consoleContent.click(function(event) {
                if (event.target == this) {
                    PMA_consoleInput.focus();
                }
            });

            $('#pma_console').find('.mid_layer').click(function() {
                PMA_console.hideCard($(this).parent().children('.card'));
            });
            $('#debug_console').find('.switch_button').click(function() {
                PMA_console.hideCard($(this).closest('.card'));
            });
            $('#pma_bookmarks').find('.switch_button').click(function() {
                PMA_console.hideCard($(this).closest('.card'));
            });
            $('#pma_console_options').find('.switch_button').click(function() {
                PMA_console.hideCard($(this).closest('.card'));
            });

            $('#pma_console_options').find('input[type=checkbox]').change(function() {
                PMA_console.updateConfig();
            });

            $('#pma_console_options').find('.button.default').click(function() {
                $('#pma_console_options input[name=always_expand]').prop('checked', false);
                $('#pma_console_options').find('input[name=start_history]').prop('checked', false);
                $('#pma_console_options').find('input[name=current_query]').prop('checked', true);
                $('#pma_console_options').find('input[name=enter_executes]').prop('checked', false);
                $('#pma_console_options').find('input[name=dark_theme]').prop('checked', false);
                PMA_console.updateConfig();
            });

            $('#pma_console_options').find('input[name=enter_executes]').change(function() {
                PMA_consoleMessages.showInstructions(PMA_console.config.enterExecutes);
            });

            $(document).ajaxComplete(function (event, xhr, ajaxOptions) {
                if (ajaxOptions.dataType && ajaxOptions.dataType.indexOf('json') != -1) {
                    return;
                }
                try {
                    var data = JSON.parse(xhr.responseText);
                    PMA_console.ajaxCallback(data);
                } catch (e) {
                    console.trace();
                    console.log("Invalid JSON!" + e.message);
                    if (AJAX.xhr && AJAX.xhr.status === 0 && AJAX.xhr.statusText !== 'abort') {
                        PMA_ajaxShowMessage($('<div />',{'class':'error','html':PMA_messages.strRequestFailed+' ( '+escapeHtml(AJAX.xhr.statusText)+' )'}));
                        AJAX.active = false;
                        AJAX.xhr = null;
                    }
                }
            });

            PMA_console.isInitialized = true;
        }

        // Change console mode from cookie
        switch($.cookie('pma_console_mode')) {
            case 'collapse':
                PMA_console.collapse();
                break;
            /* jshint -W086 */// no break needed in default section
            default:
                $.cookie('pma_console_mode', 'info');
            case 'info':
            /* jshint +W086 */
                PMA_console.info();
                break;
            case 'show':
                PMA_console.show(true);
                PMA_console.scrollBottom();
                break;
        }
    },
    /**
     * Execute query and show results in console
     *
     * @return void
     */
    execute: function(queryString, options) {
        if (typeof(queryString) != 'string' || ! /[a-z]|[A-Z]/.test(queryString)) {
            return;
        }
        PMA_console.$requestForm.children('textarea').val(queryString);
        PMA_console.$requestForm.children('[name=server]').attr('value', PMA_commonParams.get('server'));
        if (options && options.db) {
            PMA_console.$requestForm.children('[name=db]').val(options.db);
            if (options.table) {
                PMA_console.$requestForm.children('[name=table]').val(options.table);
            } else {
                PMA_console.$requestForm.children('[name=table]').val('');
            }
        } else {
            PMA_console.$requestForm.children('[name=db]').val(
                (PMA_commonParams.get('db').length > 0 ? PMA_commonParams.get('db') : ''));
        }
        PMA_console.$requestForm.find('[name=profiling]').remove();
        if (options && options.profiling === true) {
            PMA_console.$requestForm.append('<input name="profiling" value="on">');
        }
        if (! confirmQuery(PMA_console.$requestForm[0], PMA_console.$requestForm.children('textarea')[0].value)) {
            return;
        }
        PMA_console.$requestForm.children('[name=console_message_id]')
            .val(PMA_consoleMessages.appendQuery({sql_query: queryString}).message_id);
        PMA_console.$requestForm.trigger('submit');
        PMA_consoleInput.clear();
        PMA_reloadNavigation();
    },
    ajaxCallback: function(data) {
        if (data && data.console_message_id) {
            PMA_consoleMessages.updateQuery(data.console_message_id, data.success,
                (data._reloadQuerywindow ? data._reloadQuerywindow : false));
        } else if ( data && data._reloadQuerywindow) {
            if (data._reloadQuerywindow.sql_query.length > 0) {
                PMA_consoleMessages.appendQuery(data._reloadQuerywindow, 'successed')
                    .$message.addClass(PMA_console.config.currentQuery ? '' : 'hide');
            }
        }
    },
    /**
     * Change console to collapse mode
     *
     * @return void
     */
    collapse: function() {
        $.cookie('pma_console_mode', 'collapse');
        var pmaConsoleHeight = $.cookie('pma_console_height');

        if (pmaConsoleHeight < 32) {
            $.cookie('pma_console_height', 92);
        }
        PMA_console.$consoleToolbar.addClass('collapsed');
        PMA_console.$consoleAllContents.height(pmaConsoleHeight);
        PMA_console.$consoleContent.stop();
        PMA_console.$consoleContent.animate({'margin-bottom': -1 * PMA_console.$consoleContent.outerHeight() + 'px'},
            'fast', 'easeOutQuart', function() {
                PMA_console.$consoleContent.css({display:'none'});
                $(window).trigger('resize');
            });
        PMA_console.hideCard();
    },
    /**
     * Show console
     *
     * @param bool inputFocus If true, focus the input line after show()
     * @return void
     */
    show: function(inputFocus) {
        $.cookie('pma_console_mode', 'show');

        var pmaConsoleHeight = $.cookie('pma_console_height');

        if (pmaConsoleHeight < 32) {
            $.cookie('pma_console_height', 32);
            PMA_console.collapse();
            return;
        }
        PMA_console.$consoleContent.css({display:'block'});
        if (PMA_console.$consoleToolbar.hasClass('collapsed')) {
            PMA_console.$consoleToolbar.removeClass('collapsed');
        }
        PMA_console.$consoleAllContents.height(pmaConsoleHeight);
        PMA_console.$consoleContent.stop();
        PMA_console.$consoleContent.animate({'margin-bottom': 0},
            'fast', 'easeOutQuart', function() {
                $(window).trigger('resize');
                if (inputFocus) {
                    PMA_consoleInput.focus();
                }
            });
    },
    /**
     * Change console to SQL information mode
     * this mode shows current SQL query
     * This mode is the default mode
     *
     * @return void
     */
    info: function() {
        // Under construction
        PMA_console.collapse();
    },
    /**
     * Toggle console mode between collapse/show
     * Used for toggle buttons and shortcuts
     *
     * @return void
     */
    toggle: function() {
        switch($.cookie('pma_console_mode')) {
            case 'collapse':
            case 'info':
                PMA_console.show(true);
                break;
            case 'show':
                PMA_console.collapse();
                break;
            default:
                PMA_consoleInitialize();
        }
    },
    /**
     * Scroll console to bottom
     *
     * @return void
     */
    scrollBottom: function() {
        PMA_console.$consoleContent.scrollTop(PMA_console.$consoleContent.prop("scrollHeight"));
    },
    /**
     * Show card
     *
     * @param string cardSelector Selector, select string will be "#pma_console " + cardSelector
     * this param also can be JQuery object, if you need.
     *
     * @return void
     */
    showCard: function(cardSelector) {
        var $card = null;
        if (typeof(cardSelector) !== 'string') {
            if (cardSelector.length > 0) {
                $card = cardSelector;
            } else {
                return;
            }
        } else {
            $card = $("#pma_console " + cardSelector);
        }
        if ($card.length === 0) {
            return;
        }
        $card.parent().children('.mid_layer').show().fadeTo(0, 0.15);
        $card.addClass('show');
        PMA_consoleInput.blur();
        if ($card.parents('.card').length > 0) {
            PMA_console.showCard($card.parents('.card'));
        }
    },
    /**
     * Scroll console to bottom
     *
     * @param object $targetCard Target card JQuery object, if it's empty, function will hide all cards
     * @return void
     */
    hideCard: function($targetCard) {
        if (! $targetCard) {
            $('#pma_console').find('.mid_layer').fadeOut(140);
            $('#pma_console').find('.card').removeClass('show');
        } else if ($targetCard.length > 0) {
            $targetCard.parent().find('.mid_layer').fadeOut(140);
            $targetCard.find('.card').removeClass('show');
            $targetCard.removeClass('show');
        }
    },
    /**
     * Used for update console config
     *
     * @return void
     */
    updateConfig: function() {
        PMA_console.config = {
            alwaysExpand: $('#pma_console_options input[name=always_expand]').prop('checked'),
            startHistory: $('#pma_console_options').find('input[name=start_history]').prop('checked'),
            currentQuery: $('#pma_console_options').find('input[name=current_query]').prop('checked'),
            enterExecutes: $('#pma_console_options').find('input[name=enter_executes]').prop('checked'),
            darkTheme: $('#pma_console_options').find('input[name=dark_theme]').prop('checked')
        };
        $.cookie('pma_console_config', JSON.stringify(PMA_console.config));
        /*Setting the dark theme of the console*/
        if (PMA_console.config.darkTheme) {
            $('#pma_console').find('>.content').addClass('console_dark_theme');
        } else {
            $('#pma_console').find('>.content').removeClass('console_dark_theme');
        }
    },
    isSelect: function (queryString) {
        var reg_exp = /^SELECT\s+/i;
        return reg_exp.test(queryString);
    }
};

/**
 * Resizer object
 * Careful: this object UI logics highly related with functions under PMA_console
 * Resizing min-height is 32, if small than it, console will collapse
 */
var PMA_consoleResizer = {
    _posY: 0,
    _height: 0,
    _resultHeight: 0,
    /**
     * Mousedown event handler for bind to resizer
     *
     * @return void
     */
    _mousedown: function(event) {
        if ($.cookie('pma_console_mode') !== 'show') {
            return;
        }
        PMA_consoleResizer._posY = event.pageY;
        PMA_consoleResizer._height = PMA_console.$consoleContent.height();
        $(document).mousemove(PMA_consoleResizer._mousemove);
        $(document).mouseup(PMA_consoleResizer._mouseup);
        // Disable text selection while resizing
        $(document).bind('selectstart', function() { return false; });
    },
    /**
     * Mousemove event handler for bind to resizer
     *
     * @return void
     */
    _mousemove: function(event) {
        if (event.pageY < 35) {
            event.pageY = 35
        }
        PMA_consoleResizer._resultHeight = PMA_consoleResizer._height + (PMA_consoleResizer._posY -event.pageY);
        // Content min-height is 32, if adjusting height small than it we'll move it out of the page
        if (PMA_consoleResizer._resultHeight <= 32) {
            PMA_console.$consoleAllContents.height(32);
            PMA_console.$consoleContent.css('margin-bottom', PMA_consoleResizer._resultHeight - 32);
        }
        else {
            // Logic below makes viewable area always at bottom when adjusting height and content already at bottom
            if (PMA_console.$consoleContent.scrollTop() + PMA_console.$consoleContent.innerHeight() + 16
                >= PMA_console.$consoleContent.prop('scrollHeight')) {
                PMA_console.$consoleAllContents.height(PMA_consoleResizer._resultHeight);
                PMA_console.scrollBottom();
            } else {
                PMA_console.$consoleAllContents.height(PMA_consoleResizer._resultHeight);
            }
        }
    },
    /**
     * Mouseup event handler for bind to resizer
     *
     * @return void
     */
    _mouseup: function() {
        $.cookie('pma_console_height', PMA_consoleResizer._resultHeight);
        PMA_console.show();
        $(document).unbind('mousemove');
        $(document).unbind('mouseup');
        $(document).unbind('selectstart');
    },
    /**
     * Used for console resizer initialize
     *
     * @return void
     */
    initialize: function() {
        $('#pma_console').find('.toolbar').unbind('mousedown');
        $('#pma_console').find('.toolbar').mousedown(PMA_consoleResizer._mousedown);
    }
};

/**
 * Console input object
 */
var PMA_consoleInput = {
    /**
     * @var array, contains Codemirror objects or input jQuery objects
     * @access private
     */
    _inputs: null,
    /**
     * @var bool, if codemirror enabled
     * @access private
     */
    _codemirror: false,
    /**
     * @var int, count for history navigation, 0 for current input
     * @access private
     */
    _historyCount: 0,
    /**
     * @var string, current input when navigating through history
     * @access private
     */
    _historyPreserveCurrent: null,
    /**
     * Used for console input initialize
     *
     * @return void
     */
    initialize: function() {
        // _cm object can't be reinitialize
        if (PMA_consoleInput._inputs !== null) {
            return;
        }
        if (typeof CodeMirror !== 'undefined') {
            PMA_consoleInput._codemirror = true;
        }
        PMA_consoleInput._inputs = [];
        if (PMA_consoleInput._codemirror) {
            PMA_consoleInput._inputs.console = CodeMirror($('#pma_console').find('.console_query_input')[0], {
                theme: 'pma',
                mode: 'text/x-sql',
                lineWrapping: true,
                extraKeys: {"Ctrl-Space": "autocomplete"},
                hintOptions: {"completeSingle": false, "completeOnSingleClick": true},
                gutters: ["CodeMirror-lint-markers"],
                lint: {
                    "getAnnotations": CodeMirror.sqlLint,
                    "async": true,
                }
            });
            PMA_consoleInput._inputs.console.on("inputRead", codemirrorAutocompleteOnInputRead);
            PMA_consoleInput._inputs.console.on("keydown", function(instance, event) {
                PMA_consoleInput._historyNavigate(event);
            });
            if ($('#pma_bookmarks').length !== 0) {
                PMA_consoleInput._inputs.bookmark = CodeMirror($('#pma_console').find('.bookmark_add_input')[0], {
                    theme: 'pma',
                    mode: 'text/x-sql',
                    lineWrapping: true,
                    extraKeys: {"Ctrl-Space": "autocomplete"},
                    hintOptions: {"completeSingle": false, "completeOnSingleClick": true},
                    gutters: ["CodeMirror-lint-markers"],
                    lint: {
                        "getAnnotations": CodeMirror.sqlLint,
                        "async": true,
                    }
                });
                PMA_consoleInput._inputs.bookmark.on("inputRead", codemirrorAutocompleteOnInputRead);
            }
        } else {
            PMA_consoleInput._inputs.console =
                $('<textarea>').appendTo('#pma_console .console_query_input')
                    .on('keydown', PMA_consoleInput._historyNavigate);
            if ($('#pma_bookmarks').length !== 0) {
                PMA_consoleInput._inputs.bookmark =
                    $('<textarea>').appendTo('#pma_console .bookmark_add_input');
            }
        }
        $('#pma_console').find('.console_query_input').keydown(PMA_consoleInput._keydown);
    },
    _historyNavigate: function(event) {
        if (event.keyCode == 38 || event.keyCode == 40) {
            var upPermitted = false;
            var downPermitted = false;
            var editor = PMA_consoleInput._inputs.console;
            var cursorLine;
            var totalLine;
            if (PMA_consoleInput._codemirror) {
                cursorLine = editor.getCursor().line;
                totalLine = editor.lineCount();
            } else {
                // Get cursor position from textarea
                var text = PMA_consoleInput.getText();
                cursorLine = text.substr(0, editor.prop("selectionStart")).split("\n").length - 1;
                totalLine = text.split(/\r*\n/).length;
            }
            if (cursorLine === 0) {
                upPermitted = true;
            }
            if (cursorLine == totalLine - 1) {
                downPermitted = true;
            }
            var nextCount;
            var queryString = false;
            if (upPermitted && event.keyCode == 38) {
                // Navigate up in history
                if (PMA_consoleInput._historyCount === 0) {
                    PMA_consoleInput._historyPreserveCurrent = PMA_consoleInput.getText();
                }
                nextCount = PMA_consoleInput._historyCount + 1;
                queryString = PMA_consoleMessages.getHistory(nextCount);
            } else if (downPermitted && event.keyCode == 40) {
                // Navigate down in history
                if (PMA_consoleInput._historyCount === 0) {
                    return;
                }
                nextCount = PMA_consoleInput._historyCount - 1;
                if (nextCount === 0) {
                    queryString = PMA_consoleInput._historyPreserveCurrent;
                } else {
                    queryString = PMA_consoleMessages.getHistory(nextCount);
                }
            }
            if (queryString !== false) {
                PMA_consoleInput._historyCount = nextCount;
                PMA_consoleInput.setText(queryString, 'console');
                if (PMA_consoleInput._codemirror) {
                    editor.setCursor(editor.lineCount(), 0);
                }
                event.preventDefault();
            }
        }
    },
    /**
     * Mousedown event handler for bind to input
     * Shortcut is Ctrl+Enter key or just ENTER, depending on console's
     * configuration.
     *
     * @return void
     */
    _keydown: function(event) {
        if (PMA_console.config.enterExecutes) {
            // Enter, but not in combination with Shift (which writes a new line).
            if (!event.shiftKey && event.keyCode === 13) {
                PMA_consoleInput.execute();
            }
        } else {
            // Ctrl+Enter
            if (event.ctrlKey && event.keyCode === 13) {
                PMA_consoleInput.execute();
            }
        }
    },
    /**
     * Used for send text to PMA_console.execute()
     *
     * @return void
     */
    execute: function() {
        if (PMA_consoleInput._codemirror) {
            PMA_console.execute(PMA_consoleInput._inputs.console.getValue());
        } else {
            PMA_console.execute(PMA_consoleInput._inputs.console.val());
        }
    },
    /**
     * Used for clear the input
     *
     * @param string target, default target is console input
     * @return void
     */
    clear: function(target) {
        PMA_consoleInput.setText('', target);
    },
    /**
     * Used for set focus to input
     *
     * @return void
     */
    focus: function() {
        PMA_consoleInput._inputs.console.focus();
    },
    /**
     * Used for blur input
     *
     * @return void
     */
    blur: function() {
        if (PMA_consoleInput._codemirror) {
            PMA_consoleInput._inputs.console.getInputField().blur();
        } else {
            PMA_consoleInput._inputs.console.blur();
        }
    },
    /**
     * Used for set text in input
     *
     * @param string text
     * @param string target
     * @return void
     */
    setText: function(text, target) {
        if (PMA_consoleInput._codemirror) {
            switch(target) {
                case 'bookmark':
                    PMA_console.execute(PMA_consoleInput._inputs.bookmark.setValue(text));
                    break;
                default:
                case 'console':
                    PMA_console.execute(PMA_consoleInput._inputs.console.setValue(text));
            }
        } else {
            switch(target) {
                case 'bookmark':
                    PMA_console.execute(PMA_consoleInput._inputs.bookmark.val(text));
                    break;
                default:
                case 'console':
                    PMA_console.execute(PMA_consoleInput._inputs.console.val(text));
            }
        }
    },
    getText: function(target) {
        if (PMA_consoleInput._codemirror) {
            switch(target) {
                case 'bookmark':
                    return PMA_consoleInput._inputs.bookmark.getValue();
                default:
                case 'console':
                    return PMA_consoleInput._inputs.console.getValue();
            }
        } else {
            switch(target) {
                case 'bookmark':
                    return PMA_consoleInput._inputs.bookmark.val();
                default:
                case 'console':
                    return PMA_consoleInput._inputs.console.val();
            }
        }
    }

};

/**
 * Console messages, and message items management object
 */
var PMA_consoleMessages = {
    /**
     * Used for clear the messages
     *
     * @return void
     */
    clear: function() {
        $('#pma_console').find('.content .console_message_container .message:not(.welcome)').addClass('hide');
        $('#pma_console').find('.content .console_message_container .message.failed').remove();
        $('#pma_console').find('.content .console_message_container .message.expanded').find('.action.collapse').click();
    },
    /**
     * Used for show history messages
     *
     * @return void
     */
    showHistory: function() {
        $('#pma_console').find('.content .console_message_container .message.hide').removeClass('hide');
    },
    /**
     * Used for getting a perticular history query
     *
     * @param int nthLast get nth query message from latest, i.e 1st is last
     * @return string message
     */
    getHistory: function(nthLast) {
        var $queries = $('#pma_console').find('.content .console_message_container .query');
        var length = $queries.length;
        var $query = $queries.eq(length - nthLast);
        if (!$query || (length - nthLast) < 0) {
            return false;
        } else {
            return $query.text();
        }
    },
    /**
     * Used to show the correct message depending on which key
     * combination executes the query (Ctrl+Enter or Enter).
     *
     * @param bool enterExecutes Only Enter has to be pressed to execute query.
     * @return void
     */
    showInstructions: function(enterExecutes) {
        enterExecutes = +enterExecutes || 0; // conversion to int
        var $welcomeMsg = $('#pma_console').find('.content .console_message_container .message.welcome span');
        $welcomeMsg.children('[id^=instructions]').hide();
        $welcomeMsg.children('#instructions-' + enterExecutes).show();
    },
    /**
     * Used for log new message
     *
     * @param string msgString Message to show
     * @param string msgType Message type
     * @return object, {message_id, $message}
     */
    append: function(msgString, msgType) {
        if (typeof(msgString) !== 'string') {
            return false;
        }
        // Generate an ID for each message, we can find them later
        var msgId = Math.round(Math.random()*(899999999999)+100000000000);
        var now = new Date();
        var $newMessage =
            $('<div class="message ' +
                (PMA_console.config.alwaysExpand ? 'expanded' : 'collapsed') +
                '" msgid="' + msgId + '"><div class="action_content"></div></div>');
        switch(msgType) {
            case 'query':
                $newMessage.append('<div class="query highlighted"></div>');
                if (PMA_consoleInput._codemirror) {
                    CodeMirror.runMode(msgString,
                        'text/x-sql', $newMessage.children('.query')[0]);
                } else {
                    $newMessage.children('.query').text(msgString);
                }
                $newMessage.children('.action_content')
                    .append(PMA_console.$consoleTemplates.children('.query_actions').html());
                break;
            default:
            case 'normal':
                $newMessage.append('<div>' + msgString + '</div>');
        }
        PMA_consoleMessages._msgEventBinds($newMessage);
        $newMessage.find('span.text.query_time span')
            .text(now.getHours() + ':' + now.getMinutes() + ':' + now.getSeconds())
            .parent().attr('title', now);
        return {message_id: msgId,
                $message: $newMessage.appendTo('#pma_console .content .console_message_container')};
    },
    /**
     * Used for log new query
     *
     * @param string queryData Struct should be
     * {sql_query: "Query string", db: "Target DB", table: "Target Table"}
     * @param string state Message state
     * @return object, {message_id: string message id, $message: JQuery object}
     */
    appendQuery: function(queryData, state) {
        var targetMessage = PMA_consoleMessages.append(queryData.sql_query, 'query');
        if (! targetMessage) {
            return false;
        }
        if (queryData.db && queryData.table) {
            targetMessage.$message.attr('targetdb', queryData.db);
            targetMessage.$message.attr('targettable', queryData.table);
            targetMessage.$message.find('.text.targetdb span').text(queryData.db);
        }
        if (PMA_console.isSelect(queryData.sql_query)) {
            targetMessage.$message.addClass('select');
        }
        switch(state) {
            case 'failed':
                targetMessage.$message.addClass('failed');
                break;
            case 'successed':
                targetMessage.$message.addClass('successed');
                break;
            default:
            case 'pending':
                targetMessage.$message.addClass('pending');
        }
        return targetMessage;
    },
    _msgEventBinds: function($targetMessage) {
        // Leave unbinded elements, remove binded.
        $targetMessage = $targetMessage.filter(':not(.binded)');
        if ($targetMessage.length === 0) {
            return;
        }
        $targetMessage.addClass('binded');

        $targetMessage.find('.action.expand').click(function () {
            $(this).closest('.message').removeClass('collapsed');
            $(this).closest('.message').addClass('expanded');
        });
        $targetMessage.find('.action.collapse').click(function () {
            $(this).closest('.message').addClass('collapsed');
            $(this).closest('.message').removeClass('expanded');
        });
        $targetMessage.find('.action.edit').click(function () {
            PMA_consoleInput.setText($(this).parent().siblings('.query').text());
            PMA_consoleInput.focus();
        });
        $targetMessage.find('.action.requery').click(function () {
            var query = $(this).parent().siblings('.query').text();
            var $message = $(this).closest('.message');
            if (confirm(PMA_messages.strConsoleRequeryConfirm + '\n' +
                (query.length<100 ? query : query.slice(0, 100) + '...'))
            ) {
                PMA_console.execute(query, {db: $message.attr('targetdb'), table: $message.attr('targettable')});
            }
        });
        $targetMessage.find('.action.bookmark').click(function () {
            var query = $(this).parent().siblings('.query').text();
            var $message = $(this).closest('.message');
            PMA_consoleBookmarks.addBookmark(query, $message.attr('targetdb'));
            PMA_console.showCard('#pma_bookmarks .card.add');
        });
        $targetMessage.find('.action.edit_bookmark').click(function () {
            var query = $(this).parent().siblings('.query').text();
            var $message = $(this).closest('.message');
            var isShared = $message.find('span.bookmark_label').hasClass('shared');
            var label = $message.find('span.bookmark_label').text();
            PMA_consoleBookmarks.addBookmark(query, $message.attr('targetdb'), label, isShared);
            PMA_console.showCard('#pma_bookmarks .card.add');
        });
        $targetMessage.find('.action.delete_bookmark').click(function () {
            var $message = $(this).closest('.message');
            if (confirm(PMA_messages.strConsoleDeleteBookmarkConfirm + '\n' + $message.find('.bookmark_label').text())) {
                $.post('import.php',
                    {token: PMA_commonParams.get('token'),
                    server: PMA_commonParams.get('server'),
                    action_bookmark: 2,
                    ajax_request: true,
                    id_bookmark: $message.attr('bookmarkid')},
                    function () {
                        PMA_consoleBookmarks.refresh();
                    });
            }
        });
        $targetMessage.find('.action.profiling').click(function () {
            var $message = $(this).closest('.message');
            PMA_console.execute($(this).parent().siblings('.query').text(),
                {db: $message.attr('targetdb'),
                table: $message.attr('targettable'),
                profiling: true});
        });
        $targetMessage.find('.action.explain').click(function () {
            var $message = $(this).closest('.message');
            PMA_console.execute('EXPLAIN ' + $(this).parent().siblings('.query').text(),
                {db: $message.attr('targetdb'),
                table: $message.attr('targettable')});
        });
        $targetMessage.find('.action.dbg_show_trace').click(function () {
            var $message = $(this).closest('.message');
            if (!$message.find('.trace').length) {
                PMA_consoleDebug.getQueryDetails(
                    $message.data('queryInfo'),
                    $message.data('totalTime'),
                    $message
                );
                PMA_consoleMessages._msgEventBinds($message.find('.message:not(.binded)'));
            }
            $message.addClass('show_trace');
            $message.removeClass('hide_trace');
        });
        $targetMessage.find('.action.dbg_hide_trace').click(function () {
            var $message = $(this).closest('.message');
            $message.addClass('hide_trace');
            $message.removeClass('show_trace');
        });
        $targetMessage.find('.action.dbg_show_args').click(function () {
            var $message = $(this).closest('.message');
            $message.addClass('show_args expanded');
            $message.removeClass('hide_args collapsed');
        });
        $targetMessage.find('.action.dbg_hide_args').click(function () {
            var $message = $(this).closest('.message');
            $message.addClass('hide_args collapsed');
            $message.removeClass('show_args expanded');
        });
        if (PMA_consoleInput._codemirror) {
            $targetMessage.find('.query:not(.highlighted)').each(function(index, elem) {
                    CodeMirror.runMode($(elem).text(),
                        'text/x-sql', elem);
                    $(this).addClass('highlighted');
                });
        }
    },
    msgAppend: function(msgId, msgString, msgType) {
        var $targetMessage = $('#pma_console').find('.content .console_message_container .message[msgid=' + msgId +']');
        if ($targetMessage.length === 0 || isNaN(parseInt(msgId)) || typeof(msgString) !== 'string') {
            return false;
        }
        $targetMessage.append('<div>' + msgString + '</div>');
    },
    updateQuery: function(msgId, isSuccessed, queryData) {
        var $targetMessage = $('#pma_console').find('.console_message_container .message[msgid=' + parseInt(msgId) +']');
        if ($targetMessage.length === 0 || isNaN(parseInt(msgId))) {
            return false;
        }
        $targetMessage.removeClass('pending failed successed');
        if (isSuccessed) {
            $targetMessage.addClass('successed');
            if (queryData) {
                $targetMessage.children('.query').text('');
                $targetMessage.removeClass('select');
                if (PMA_console.isSelect(queryData.sql_query)) {
                    $targetMessage.addClass('select');
                }
                if (PMA_consoleInput._codemirror) {
                    CodeMirror.runMode(queryData.sql_query, 'text/x-sql', $targetMessage.children('.query')[0]);
                } else {
                    $targetMessage.children('.query').text(queryData.sql_query);
                }
                $targetMessage.attr('targetdb', queryData.db);
                $targetMessage.attr('targettable', queryData.table);
                $targetMessage.find('.text.targetdb span').text(queryData.db);
            }
        } else {
            $targetMessage.addClass('failed');
        }
    },
    /**
     * Used for console messages initialize
     *
     * @return void
     */
    initialize: function() {
        PMA_consoleMessages._msgEventBinds($('#pma_console').find('.message:not(.binded)'));
        if (PMA_console.config.startHistory) {
            PMA_consoleMessages.showHistory();
        }
        PMA_consoleMessages.showInstructions(PMA_console.config.enterExecutes);
    }
};

/**
 * Console bookmarks card, and bookmarks items management object
 */
var PMA_consoleBookmarks = {
    _bookmarks: [],
    addBookmark: function (queryString, targetDb, label, isShared, id) {
        $('#pma_bookmarks').find('.add [name=shared]').prop('checked', false);
        $('#pma_bookmarks').find('.add [name=label]').val('');
        $('#pma_bookmarks').find('.add [name=targetdb]').val('');
        $('#pma_bookmarks').find('.add [name=id_bookmark]').val('');
        PMA_consoleInput.setText('', 'bookmark');

        switch(arguments.length) {
            case 4:
                $('#pma_bookmarks').find('.add [name=shared]').prop('checked', isShared);
            case 3:
                $('#pma_bookmarks').find('.add [name=label]').val(label);
            case 2:
                $('#pma_bookmarks').find('.add [name=targetdb]').val(targetDb);
            case 1:
                PMA_consoleInput.setText(queryString, 'bookmark');
            default:
                break;
        }
    },
    refresh: function () {
        $.get('import.php',
            {ajax_request: true,
            token: PMA_commonParams.get('token'),
            server: PMA_commonParams.get('server'),
            console_bookmark_refresh: 'refresh'},
            function(data) {
                if (data.console_message_bookmark) {
                    $('#pma_bookmarks').find('.content.bookmark').html(data.console_message_bookmark);
                    PMA_consoleMessages._msgEventBinds($('#pma_bookmarks').find('.message:not(.binded)'));
                }
            });
    },
    /**
     * Used for console bookmarks initialize
     * message events are already binded by PMA_consoleMsg._msgEventBinds
     *
     * @return void
     */
    initialize: function() {
        if ($('#pma_bookmarks').length === 0) {
            return;
        }
        $('#pma_console').find('.button.bookmarks').click(function() {
            PMA_console.showCard('#pma_bookmarks');
        });
        $('#pma_bookmarks').find('.button.add').click(function() {
            PMA_console.showCard('#pma_bookmarks .card.add');
        });
        $('#pma_bookmarks').find('.card.add [name=submit]').click(function () {
            if ($('#pma_bookmarks').find('.card.add [name=label]').val().length === 0
                || PMA_consoleInput.getText('bookmark').length === 0)
            {
                alert(PMA_messages.strFormEmpty);
                return;
            }
            $(this).prop('disabled', true);
            $.post('import.php',
                {token: PMA_commonParams.get('token'),
                ajax_request: true,
                console_bookmark_add: 'true',
                label: $('#pma_bookmarks').find('.card.add [name=label]').val(),
                server: PMA_commonParams.get('server'),
                db: $('#pma_bookmarks').find('.card.add [name=targetdb]').val(),
                bookmark_query: PMA_consoleInput.getText('bookmark'),
                shared: $('#pma_bookmarks').find('.card.add [name=shared]').prop('checked')},
                function () {
                    PMA_consoleBookmarks.refresh();
                    $('#pma_bookmarks').find('.card.add [name=submit]').prop('disabled', false);
                    PMA_console.hideCard($('#pma_bookmarks').find('.card.add'));
                });
        });
        $('#pma_console').find('.button.refresh').click(function() {
            PMA_consoleBookmarks.refresh();
        });
    }
};

var PMA_consoleDebug;
PMA_consoleDebug = {
    _config: {
        groupQueries: false,
        orderBy: 'exec', // Possible 'exec' => Execution order, 'time' => Time taken, 'count'
        order: 'asc' // Possible 'asc', 'desc'
    },
    _lastDebugInfo: {
        debugInfo: null,
        url: null
    },
    initialize: function () {
        // Try to get debug info after every AJAX request
        $(document).ajaxSuccess(function (event, xhr, settings, data) {
            if (data._debug) {
                PMA_consoleDebug.showLog(data._debug, settings.url);
            }
        });

        // Initialize config
        this._initConfig();

        if (this.configParam('groupQueries')) {
            $('#debug_console').addClass('grouped');
        } else {
            $('#debug_console').addClass('ungrouped');
            if (PMA_consoleDebug.configParam('orderBy') == 'count') {
                $('#debug_console').find('.button.order_by.sort_exec').addClass('active');
            }
        }
        var orderBy = this.configParam('orderBy');
        var order = this.configParam('order');
        $('#debug_console').find('.button.order_by.sort_' + orderBy).addClass('active');
        $('#debug_console').find('.button.order.order_' + order).addClass('active');

        // Initialize actions in toolbar
        $('#debug_console').find('.button.group_queries').click(function () {
            $('#debug_console').addClass('grouped');
            $('#debug_console').removeClass('ungrouped');
            PMA_consoleDebug.configParam('groupQueries', true);
            PMA_consoleDebug.refresh();
            if (PMA_consoleDebug.configParam('orderBy') == 'count') {
                $('#debug_console').find('.button.order_by.sort_exec').removeClass('active');
            }
        });
        $('#debug_console').find('.button.ungroup_queries').click(function () {
            $('#debug_console').addClass('ungrouped');
            $('#debug_console').removeClass('grouped');
            PMA_consoleDebug.configParam('groupQueries', false);
            PMA_consoleDebug.refresh();
            if (PMA_consoleDebug.configParam('orderBy') == 'count') {
                $('#debug_console').find('.button.order_by.sort_exec').addClass('active');
            }
        });
        $('#debug_console').find('.button.order_by').click(function () {
            var $this = $(this);
            $('#debug_console').find('.button.order_by').removeClass('active');
            $this.addClass('active');
            if ($this.hasClass('sort_time')) {
                PMA_consoleDebug.configParam('orderBy', 'time');
            } else if ($this.hasClass('sort_exec')) {
                PMA_consoleDebug.configParam('orderBy', 'exec');
            } else if ($this.hasClass('sort_count')) {
                PMA_consoleDebug.configParam('orderBy', 'count');
            }
            PMA_consoleDebug.refresh();
        });
        $('#debug_console').find('.button.order').click(function () {
            var $this = $(this);
            $('#debug_console').find('.button.order').removeClass('active');
            $this.addClass('active');
            if ($this.hasClass('order_asc')) {
                PMA_consoleDebug.configParam('order', 'asc');
            } else if ($this.hasClass('order_desc')) {
                PMA_consoleDebug.configParam('order', 'desc');
            }
            PMA_consoleDebug.refresh();
        });

        // Show SQL debug info for first page load
        if (typeof debugSQLInfo !== 'undefined' && debugSQLInfo !== 'null') {
            $('#pma_console').find('.button.debug').removeClass('hide');
        }
        else {
            return;
        }
        PMA_consoleDebug.showLog(debugSQLInfo);
    },
    _initConfig: function () {
        var config = JSON.parse($.cookie('pma_console_dbg_config'));
        if (config) {
            for (var name in config) {
                if (config.hasOwnProperty(name)) {
                    this._config[name] = config[name];
                }
            }
        }
    },
    configParam: function (name, value) {
        if (typeof value === 'undefined') {
            return this._config[name];
        }
        this._config[name] = value;
        $.cookie('pma_console_dbg_config', JSON.stringify(this._config));
        return value;
    },
    _formatFunctionCall: function (dbgStep) {
        var functionName = '';
        if ('class' in dbgStep) {
            functionName += dbgStep.class;
            functionName += dbgStep.type;
        }
        functionName += dbgStep.function;
        if (dbgStep.args && dbgStep.args.length) {
            functionName += '(...)';
        } else {
            functionName += '()';
        }
        return functionName;
    },
    _formatFunctionArgs: function (dbgStep) {
        var $args = $('<div>');
        if (dbgStep.args.length) {
            $args.append('<div class="message welcome">')
                .append(
                $('<div class="message welcome">')
                    .text(
                    PMA_sprintf(
                        PMA_messages.strConsoleDebugArgsSummary,
                        dbgStep.args.length
                    )
                )
            );
            for (var i = 0; i < dbgStep.args.length; i++) {
                $args.append(
                    $('<div class="message">')
                        .html(
                        '<pre>' +
                        escapeHtml(JSON.stringify(dbgStep.args[i], null, "  ")) +
                        '</pre>'
                    )
                );
            }
        }
        return $args;
    },
    _formatFileName: function (dbgStep) {
        var fileName = '';
        if ('file' in dbgStep) {
            fileName += dbgStep.file;
            fileName += '#' + dbgStep.line;
        }
        return fileName;
    },
    _formatBackTrace: function (dbgTrace) {
        var $traceElem = $('<div class="trace">');
        $traceElem.append(
            $('<div class="message welcome">')
        );
        var step, $stepElem;
        for (var stepId in dbgTrace) {
            if (dbgTrace.hasOwnProperty(stepId)) {
                step = dbgTrace[stepId];
                if (!Array.isArray(step) && typeof step !== 'object') {
                    $stepElem =
                        $('<div class="message traceStep collapsed hide_args">')
                            .append(
                            $('<span>').text(step)
                        );
                } else {
                    if (typeof step.args === 'string' && step.args) {
                        step.args = [step.args];
                    }
                    $stepElem =
                        $('<div class="message traceStep collapsed hide_args">')
                            .append(
                            $('<span class="function">').text(this._formatFunctionCall(step))
                        )
                            .append(
                            $('<span class="file">').text(this._formatFileName(step))
                        );
                    if (step.args && step.args.length) {
                        $stepElem
                            .append(
                            $('<span class="args">').html(this._formatFunctionArgs(step))
                        )
                            .prepend(
                            $('<div class="action_content">')
                                .append(
                                '<span class="action dbg_show_args">' +
                                PMA_messages.strConsoleDebugShowArgs +
                                '</span> '
                            )
                                .append(
                                '<span class="action dbg_hide_args">' +
                                PMA_messages.strConsoleDebugHideArgs +
                                '</span> '
                            )
                        );
                    }
                }
                $traceElem.append($stepElem);
            }
        }
        return $traceElem;
    },
    _formatQueryOrGroup: function (queryInfo, totalTime) {
        var grouped, queryText, queryTime, count, i;
        if (Array.isArray(queryInfo)) {
            // It is grouped
            grouped = true;

            queryText = queryInfo[0].query;

            queryTime = 0;
            for (i in queryInfo) {
                queryTime += queryInfo[i].time;
            }

            count = queryInfo.length;
        } else {
            queryText = queryInfo.query;
            queryTime = queryInfo.time;
        }

        var $query = $('<div class="message collapsed hide_trace">')
            .append(
            $('#debug_console').find('.templates .debug_query').clone()
        )
            .append(
            $('<div class="query">')
                .text(queryText)
        )
            .data('queryInfo', queryInfo)
            .data('totalTime', totalTime);
        if (grouped) {
            $query.find('.text.count').removeClass('hide');
            $query.find('.text.count span').text(count);
        }
        $query.find('.text.time span').text(queryTime + 's (' + ((queryTime * 100) / totalTime).toFixed(3) + '%)');

        return $query;
    },
    _appendQueryExtraInfo: function (query, $elem) {
        if ('error' in query) {
            $elem.append(
                $('<div>').html(query.error)
            );
        }
        $elem.append(this._formatBackTrace(query.trace));
    },
    getQueryDetails: function (queryInfo, totalTime, $query) {
        if (Array.isArray(queryInfo)) {
            var $singleQuery;
            for (var i in queryInfo) {
                $singleQuery = $('<div class="message welcome trace">')
                    .text((parseInt(i) + 1) + '.')
                    .append(
                    $('<span class="time">').text(
                        PMA_messages.strConsoleDebugTimeTaken +
                        ' ' + queryInfo[i].time + 's' +
                        ' (' + ((queryInfo[i].time * 100) / totalTime).toFixed(3) + '%)'
                    )
                );
                this._appendQueryExtraInfo(queryInfo[i], $singleQuery);
                $query
                    .append('<div class="message welcome trace">')
                    .append($singleQuery);
            }
        } else {
            this._appendQueryExtraInfo(queryInfo, $query);
        }
    },
    showLog: function (debugInfo, url) {
        this._lastDebugInfo.debugInfo = debugInfo;
        this._lastDebugInfo.url = url;

        $('#debug_console').find('.debugLog').empty();
        $("#debug_console").find(".debug>.welcome").empty();

        var debugJson = false, i;
        if (typeof debugInfo === "object" && 'queries' in debugInfo) {
            // Copy it to debugJson, so that it doesn't get changed
            if (!('queries' in debugInfo)) {
                debugJson = false;
            } else {
                debugJson = {queries: []};
                for (i in debugInfo.queries) {
                    debugJson.queries[i] = debugInfo.queries[i];
                }
            }
        } else if (typeof debugInfo === "string") {
            try {
                debugJson = JSON.parse(debugInfo);
            } catch (e) {
                debugJson = false;
            }
            if (debugJson && !('queries' in debugJson)) {
                debugJson = false;
            }
        }
        if (debugJson === false) {
            $("#debug_console").find(".debug>.welcome").text(
                PMA_messages.strConsoleDebugError
            );
            return;
        }
        var allQueries = debugJson.queries;
        var uniqueQueries = {};

        var totalExec = allQueries.length;

        // Calculate total time and make unique query array
        var totalTime = 0;
        for (i = 0; i < totalExec; ++i) {
            totalTime += allQueries[i].time;
            if (!(allQueries[i].hash in uniqueQueries)) {
                uniqueQueries[allQueries[i].hash] = [];
            }
            uniqueQueries[allQueries[i].hash].push(allQueries[i]);
        }
        // Count total unique queries, convert uniqueQueries to Array
        var totalUnique = 0, uniqueArray = [];
        for (var hash in uniqueQueries) {
            if (uniqueQueries.hasOwnProperty(hash)) {
                ++totalUnique;
                uniqueArray.push(uniqueQueries[hash]);
            }
        }
        uniqueQueries = uniqueArray;
        // Show summary
        $("#debug_console").find(".debug>.welcome").append(
            $('<span class="debug_summary">').text(
                PMA_sprintf(
                    PMA_messages.strConsoleDebugSummary,
                    totalUnique,
                    totalExec,
                    totalTime
                )
            )
        );
        if (url) {
            $("#debug_console").find(".debug>.welcome").append(
                $('<span class="script_name">').text(url.split('?')[0])
            );
        }

        // For sorting queries
        function sortByTime(a, b) {
            var order = ((PMA_consoleDebug.configParam('order') == 'asc') ? 1 : -1);
            if (Array.isArray(a) && Array.isArray(b)) {
                // It is grouped
                var timeA = 0, timeB = 0, i;
                for (i in a) {
                    timeA += a[i].time;
                }
                for (i in b) {
                    timeB += b[i].time;
                }
                return (timeA - timeB) * order;
            } else {
                return (a.time - b.time) * order;
            }
        }

        function sortByCount(a, b) {
            var order = ((PMA_consoleDebug.configParam('order') == 'asc') ? 1 : -1);
            return (a.length - b.length) * order;
        }

        var orderBy = this.configParam('orderBy');
        var order = PMA_consoleDebug.configParam('order');

        if (this.configParam('groupQueries')) {
            // Sort queries
            if (orderBy == 'time') {
                uniqueQueries.sort(sortByTime);
            } else if (orderBy == 'count') {
                uniqueQueries.sort(sortByCount);
            } else if (orderBy == 'exec' && order == 'desc') {
                uniqueQueries.reverse();
            }
            for (i in uniqueQueries) {
                if (orderBy == 'time') {
                    uniqueQueries[i].sort(sortByTime);
                } else if (orderBy == 'exec' && order == 'desc') {
                    uniqueQueries[i].reverse();
                }
                $('#debug_console').find('.debugLog').append(this._formatQueryOrGroup(uniqueQueries[i], totalTime));
            }
        } else {
            if (orderBy == 'time') {
                allQueries.sort(sortByTime);
            } else if (order == 'desc') {
                allQueries.reverse();
            }
            for (i = 0; i < totalExec; ++i) {
                $('#debug_console').find('.debugLog').append(this._formatQueryOrGroup(allQueries[i], totalTime));
            }
        }

        PMA_consoleMessages._msgEventBinds($('#debug_console').find('.message:not(.binded)'));
    },
    refresh: function () {
        var last = this._lastDebugInfo;
        PMA_consoleDebug.showLog(last.debugInfo, last.url);
    }
};

/**s
 * Executed on page load
 */
$(function () {
    PMA_console.initialize();
});

redpajama_set_name: RedPajamaGithub


Anyway, some stuff happened through January!
I managed to get to Washi Con (I almost didn't due to capacity reasons!), and I had a great time.
Overall, it was your general little bitty convention - it was a single day at Eastern Michigan University's campus. It took place at the "student union" hall thingy (I feel so old knowing that term, but I know they call it other things), and they had a cute little dealer hall and area for photos, a few rooms for panels and a maid cafe!
I didn't check out the cafe, but I was able to traverse around the show. I ended up schlopping together an outfit (due to fundage and time, I couldn't make a set for both dave and I, and I repurposed some old costume parts and made a couple of new parts to hack together a new one).
I went as Torchwick from RWBY!
I got lucky and found a few other RWBY cosplayers too!
I can go into a more detailed look at what went into the costume - it was a lot of "Found this Old Thing. Made it New", and the cane was made entirely by me!


text:
Home > Discover Magdalen > News > Farewell to The Last Supper
Farewell to The Last Supper
The College has been fortunate to host a copy of Leonardo Da Vinci's The Last Supper which has been on display in the Antechapel for the last 25 years. This beautiful painting is attributed to one of Da Vinci's followers Giampietrino and was painted in around 1520.
The work has been on loan from the Royal Academy of Arts to which it is being returned this week. To mark this event a lecture was given on Friday 8th September in the Antechapel by Martin Kemp, a leading expert on Leonardo. His lecture was entitled 'Leonardo's Last Supper: An Obituary'.
For more on the painting, please see here.
Remains reinterred at Magdalen College
On Thursday 20 June a ceremony took place at Magdalen College to reinter human remains which had been discovered during renovation work in the cloister...
Magdalen student wins Social Impact Award
Beth Plant (second from right) a second-year Human Sciences student has won the social enterprise category of this year's Vice-Chancellor's Social Impact Awards for her...
Professor Sir Guenter Treitel
The College is very sad to announce that Emeritus Fellow Professor Sir Guenter Treitel FBA has passed away at the age of 90. Sir Guenter was...

redpajama_set_name: RedPajamaCommonCrawl


text:
Africa Responding To Need For Dedicated Skills In The Fintech Space
Written by Tom Jackson
Finding skilled workers is a major barrier to the development of Africa's fintech space, but the market is slowly responding. The University of Cape Town recently became the first university in Africa to offer a specialized fintech degree.
Financial services CEOs across the world are already under serious pressure because of new competition proffered by fintech startups, and facing tough decisions about whether to fight or partner with such companies.
But what makes this issue even more testing is that, even if they wanted to focus more on innovative financial technologies, they face a serious shortage of skills.
Research suggests that CEOs of financial services companies are equally concerned about the lack of availability of skills as they are about technological change, according to a recent survey published by PwC.
Seventy per cent of the CEOs said these were their main challenges, putting them ahead of cyber threats (69 percent) as the major problems for established institutions. This was a global survey, but in Africa the problem is larger.
Fintech thriving where banking has failed
It is very clear that traditional banking models do not work on the continent, where more than 300 million people do not even have a bank account, let alone access to other formal financial services, such as credit, savings, or insurance.
Fintech is, as a result, a very big deal on the continent. Mobile money services like M-Pesa led the way, but increasingly we are seeing more and more innovative fintech services addressing various financial needs that traditional banks have failed to.
In fact, the continent is already home to more than 300 fintech startups, which have between them raised almost $100 million over the last two and a half years, according to the recent Finnovating for Africa report released by media and research company Disrupt Africa
Africa, therefore, is clearly a fertile ground for new fintech services, but just as more established financial services companies need the relevant skills, so do they.
From the biggest bank to the smallest startup, everyone is looking for people with skills in areas such as machine learning and big data. And these people are hard to come by. Even ordinary people could do with upskilling themselves in financial technologies.
"Have you ever used money? If you answered yes, then your life will be affected by fintech," says Chris Rawlinson, founder of South African company 42courses.
Launched last year, the digital learning startup uses gamification techniques to allow users to learn via short stories in courses provided by some of the world's top brands.
"Everything from paying for things with your phone, to buying bitcoin, to investing in part ownership of houses, or crowdsourcing your next loan is possible with fintech. By understanding this rapidly shifting industry you will be in a much better position to take advantage of the opportunities it presents. Now is golden age for the democratisation of finance. Trust me, you don't want to miss this one," Rawlinson says.
After offering courses in things like behavioural economics and social media, 42courses recently launched a fintech course in partnership with Barclays.
Fintech skills for all
Rawlinson says the material in the course, provided by various top banking and fintech companies around the world, will be of use to everyone from students to banking executives.
"The illiterates of the 21st century will not be those who cannot read and write, but those that cannot learn, unlearn, and relearn," he said.
"Alvin Toffler said this many years ago, but it's never been more applicable than in the world of finance and banking today."
The state of the global financial industry is partly responsible for this.
"In the last 10 years, consumer confidence in banking has plummeted and new fintech companies like Monzo and Transferwise have started to grow and chip away at the establishment's piece of the pie. Whether you are a financial veteran or a young student, understanding the fintech and its risks and opportunities is about to become crucial for success," Rawlinson said.
By offering this sort of course, Barclays and 42courses are venturing into territory that African universities have generally failed to.
The majority of students at African universities are studying subjects that do not support the need in business for science, technology, engineering and maths, or future-oriented skills.
This means that many organizations – as demonstrated by the PwC survey – face challenges in finding appropriately-trained graduates, which is emerging as a major barrier to the development of Africa's fintech space.
Progress has been slow, but things are moving in the right direction.
The University of Cape Town recently became the first university in Africa to offer a specialised fintech degree, designed to provide students with the necessary skills and knowledge to acquire or further a career within the modern financial services sector.
Partnerships between e-learning startups and universities are also happening, with the Saïd Business School at the University of Oxford recently partnering with South African ed-tech company GetSmarter to launch an online fintech programme, aimed at helping executives launch new fintech ventures and harness new technology to build better financial services firms.
All of these are only baby steps towards a goal of wider importance: ensuring Africa has people with the skills needed to allow fintech to fulfil its potential on the continent. But the process has at least begun, and for that we should be glad.
Tom Jackson is the co-founder of tech news and research platform Disrupt Africa and a journalist covering innovation on the continent from the Cape to Cairo.
August 28, 2017 September 19, 2017 by Tom Jackson
Category: AFK Insider, Business, Education, Entrepreneurship, Features, Google News, Tech.Tag: degree, fintech, fintech space, skills, skills shortage, university
Image Attribution: Online edtech startup GetSmarter was acquired by U.S. company U2 in 2017 Photo - Student Brands


text:
Kazakh tennis players win first round matches at US Open
By Diana Vassilenko in Sports on 29 August 2019
NUR-SULTAN – Kazakh tennis players Mikhail Kukushkin and Alexander Bublik won their Aug. 27 first round matches at the United States Open Tennis Championship.
Alexander Bublik. Photo credit: inform.kz.
Kukushkin defeated Roberto Bautista Agut of Spain in five sets 3:6, 6:1, 6:4, 3:6 and 6:3, Vesti.kz reported. The match lasted more than three hours. Bautista Agut is the sport's 10th ranked player.
Kukushkin's best performance at the U.S. Open has been reaching the third round in 2013, 2015, 2017 and 2018.
The ATP rankings were updated Aug. 26 and 31-year-old Kukushkin, Kazakhstan's number one player, dropped from the 44th to the 47th place. Novak Djokovic of Serbia, Rafael Nadal of Spain and Roger Federer of Switzerland remain the top players
Kukushkin has a 18-21 win-loss record in 2019 with 7-8 on hard courts. Kukushkin's best results of the year were reaching the finals in the Phoenix Challenger and Marseille.
Kukushkin will face 20-year-old Australian Alexei Popyrin in the second round. Popyrin is the 105th ATP ranked player.
Bublik, the Russian born tennis player who has represented Kazakhstan since 2016, defeated Santiago Giraldo of Columbia in the first round. Though Bublik lost the first set 2:6, he won the second set 6:0 and the remaining sets 7:5, 3:6 and 6:4. The match lasted three hours and 14 minutes.
In the ATP ranking, the 22-year-old Bublik is ranked 75. His career-high is 71. The 31-year-old Giraldo is ranked 232. It was their first match.
Bublik will face Italian player Thomas Fabbiano in the second round. Fabbiano is ranked 85th and defeated the world's fourth best tennis player Dominic Tim of Austria in the first round.
Most Recent Stories in Sports
Kazakh Capital To Host 2022 Asia Triathlon Junior and U23 Championships
Kazakh Team Wins AIGA International Grappling Tournament
Daniyar Yeleussinov Becomes Fifth Boxer to Take Home the Welterweight Title For Kazakhstan After Successful Return to Ring
Young Kazakh Tennis Player Ranks First in Tennis Europe Junior Masters Ladder
Young Kazakh Girl Wins World Championship – 2021 Grappling/Grappling-GI
FIDE World Rapid and Blitz Championships 2021 Set to Kick Off in Nur-Sultan This December
View More in Sports »


Part of the nationally recognized Nicklaus Children's Brain Institute®, the Brain development Network (BDN) provides coordinated, comprehensive care for children with neurodevelopmental disorders. The BDN program is unique as care planning is not based on a specific diagnosis label, but instead focuses on what each individual child needs to maximize his or her neurodevelopment.
Neurodevelopmental disorders affect a diverse group of children, creating challenges in brain function that may result in difficulties with social interaction and cognition (e.g., autism spectrum disorders), learning difficulties (ADHD and other learning disabilities) and challenges with global cognitive functions.
The comprehensive treatment of neurodevelopmental disorders includes coordination of care among physicians, allied health professionals and educators. Treatment protocols may include psychology assessment, behavioral interventions, and speech-language, occupational and physical therapies. Medications are often used to address specific symptoms that are interfering with the child's progress.


text:
Pont Mirabeau, Paris
Sir Herbert James Gunn (1893 - 1964)
Size (inches): 9 (h) x 12 (w) inches
Sir Herbert James Gunn was born in Glasgow and first studied art at the Glasgow School of Art. His talents as an artist were soon recognised and Gunn was fortunate to be sent to Académie Julian in Paris. It was during his time in France that Gunn developed his radical approach to compositional arrangements. His often stark palette of grey tones was used to heighten the dramatic placement of forms. As with this striking view of Pont Mirabeau in Paris, the physical location plays second fiddle to the technical structure of the composition, with only a brief visual reference to Le Trocadero on the horizon. Gunn was a member of the Royal Academy, and in 1953/4 he was invited to paint Queen Elizabeth II in her Coronation robes, a picture that hangs in the Royal Collection to this day.


what are you using fit, google translator?
yea those Q6600's are nice affordable crunchers.
its a great way to not let you CPU cycles go to waste and it's for a good cause. Check our WCG section there is many great threads on optimizing and setting up BOINC. Also check out the thread that "dustyshiv" made about a CC config file. Download that and put it in the specified directory. It really helps out to stabilize your scores.
i imagine trying to have a conversation with the translator and its all wrong but you don't know it. Total ownage!
hey cp are they going to add the 1 million above the badge?
This thread is updated daily by our very own co captain "bogmali". Throughout the day, DC stats which is where we get this info from posts a pie chart with the top ten crunchers so far for that day. That is posted in the thread to see who is getting "pie"
yeah, do they have a suggestion box?
Hey what do you think of the little guide I just gave erazer?
Hell yea! We are Cool!
Ion you still haven't beat me and i only have 1 core crunching and i have been benching the other X2 so that only leaves 2p4s 1 celly 1 core of the other x2 is something wrong bro?
Hey guys I just got another rig up and crunching, not much but its doing work.
Rig specs, P4 630 with HT @3.2GHZ, on a P45 board. It took a while to get it to work but it crunching away.
Hopefully I'll get it up to 3.6GHZ soon.


One off-grants for pet owners who are on a low income and cannot pay for vets' bills. Only grants for small pets and no horses.
Pet owners who are on low incomes and need help paying for vets' bills. Pet owners must be on benefits of some sort. Only small pets no horses. No grants for chronic illness, cosmetic surgery (such as teeth claw clipping), spaying, neutering, castrating etc.
Pet owners cannot apply directly. Applications must be made by a third party or the pet's vet. Write or email the charity.