text:
#region License

#endregion License

#region Original Credits / License
//-----------------------------------------------------------------------------
// File: starfield.cpp
// Desc: 3d opengl/glut starfield
//
// summer 2001 - Ge Wang & Adrenaline University c++ class
//-----------------------------------------------------------------------------
#endregion Original Credits / License

using System;
using Tao.FreeGlut;
using Tao.OpenGl;

namespace GeWangExamples
{
    #region Class Documentation
    /// <summary>
    ///     3D starfield.
    /// </summary>
    /// <remarks>
    ///     <para>
    ///         Original Author:    Ge Wang
    ///         http://www.gewang.com/projects/samples/opengl/starfield.cpp
    ///     </para>
    ///     <para>
    ///         C# Implementation:  Randy Ridge
    ///         http://www.taoframework.com
    ///     </para>
    /// </remarks>
    #endregion Class Documentation
    public sealed class Starfield
    {
        // --- Fields ---
        #region Private Constants
        private const int NUMBER_STARS = 400;
        private const float FAR_PLANE = -40.0f;
        private const float NEAR_PLANE = 3.0f;
        private const float GAP = 0.0f;
        private const float FIELD_WIDTH = 30.0f;
        private const float FIELD_HEIGHT = 25.0f;
        private const float RADIUS = 1.0f;
        private const float DEFAULT_SPEED = 0.2f;
        private const int RAND_MAX = 0x7fff;
        #endregion Private Constants

        #region Private Fields
        // width and height of the window
        private static int windowWidth = 640;
        private static int windowHeight = 480;

        // light position
        private static float[] lightPosition = { 0.0f, 0.0f, 3.0f, 1.0f };

        // the location
        private static float[][] xyz = new float[NUMBER_STARS][];
        // the colors
        private static float[][] colors = new float[NUMBER_STARS][];

        // the alpha and red components of polygon to blend
        private static float alpha = 0.3f;
        private static float red = 0.0f;
        private static float speed = DEFAULT_SPEED;
        private static float speedIncrement = 0.0f;
        private static float inc = 0.0f;
        private static Random rand = new Random();
        #endregion Private Fields

        // --- Entry Point ---
        #region Run()
        public static void Run()
        {
            // initialize GLUT
            Glut.glutInit();
            // double buffer, use rgb color, enable depth buffers
            Glut.glutInitDisplayMode(Glut.GLUT_DOUBLE | Glut.GLUT_RGB | Glut.GLUT_DEPTH);
            // initialize the window size
            Glut.glutInitWindowSize(windowWidth, windowHeight);
            // set the window postion
            Glut.glutInitWindowPosition(100, 100);
            // create the window
            Glut.glutCreateWindow("Starfield");

            // set the display function - called when redrawing
            Glut.glutDisplayFunc(new Glut.DisplayCallback(Display));
            // set the idle function - called when idle
            Glut.glutIdleFunc(new Glut.IdleCallback(Idle));
            // set the keyboard function - called on keyboard events
            Glut.glutKeyboardFunc(new Glut.KeyboardCallback(Keyboard));
            // set the mouse function - called on mouse stuff
            Glut.glutMouseFunc(new Glut.MouseCallback(Mouse));
            // set the reshape function - called when client area changes
            Glut.glutReshapeFunc(new Glut.ReshapeCallback(Reshape));

            // do our own initialization
            Init();

            // let GLUT handle the current thread from here
            Glut.glutMainLoop();
        }
        #endregion Run()

        // --- Application Methods ---
        #region Init()
        /// <summary>
        ///     Sets initial OpenGL states and initializes any application data.
        /// </summary>
        private static void Init()
        {
            // set the GL clear color - use when the color buffer is cleared
            Gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
            // set the shading model to 'smooth'
            Gl.glShadeModel(Gl.GL_SMOOTH);
            // enable depth
            Gl.glEnable(Gl.GL_DEPTH_TEST);
            // draw in fill
            Gl.glPolygonMode(Gl.GL_FRONT_AND_BACK, Gl.GL_FILL);
            // set the initial line width
            Gl.glLineWidth(1.0f);

            // enable lighting
            Gl.glEnable(Gl.GL_LIGHTING);
            // enable lighting for front
            Gl.glLightModeli(Gl.GL_FRONT, Gl.GL_TRUE);
            // material have diffuse and ambient lighting
            Gl.glColorMaterial(Gl.GL_FRONT, Gl.GL_AMBIENT_AND_DIFFUSE);
            // enable color
            Gl.glEnable(Gl.GL_COLOR_MATERIAL);
            // enable light 0
            Gl.glEnable(Gl.GL_LIGHT0);

            // set light attenuation
            Gl.glLightf(Gl.GL_LIGHT0, Gl.GL_CONSTANT_ATTENUATION, 0.01f);
            Gl.glLightf(Gl.GL_LIGHT0, Gl.GL_LINEAR_ATTENUATION, 0.2f);
            Gl.glLightf(Gl.GL_LIGHT0, Gl.GL_QUADRATIC_ATTENUATION, 0.001f);

            // clear the color buffer once
            Gl.glClear(Gl.GL_COLOR_BUFFER_BIT);

            // randomly generate
            for (int i = 0; i < NUMBER_STARS; i++)
            {
                xyz[i] = new float[3];
                xyz[i][0] = ((float)rand.Next(RAND_MAX) / RAND_MAX - 0.5f) * FIELD_WIDTH;
                xyz[i][1] = ((float)rand.Next(RAND_MAX) / RAND_MAX - 0.5f) * FIELD_HEIGHT;
                xyz[i][2] = ((float)rand.Next(RAND_MAX) / RAND_MAX) * (NEAR_PLANE - FAR_PLANE + GAP) + FAR_PLANE;

                colors[i] = new float[3];
                colors[i][0] = (float)rand.Next(RAND_MAX) / RAND_MAX;
                colors[i][1] = (float)rand.Next(RAND_MAX) / RAND_MAX;
                colors[i][2] = (float)rand.Next(RAND_MAX) / RAND_MAX;
            }

            Console.WriteLine("--------------------------------------------------");
            Console.WriteLine("OpenGL flying simulation");
            Console.WriteLine("--------------------------------------------------");
            Console.WriteLine("[L/R] mouse button - accelerate forward/backwards");
            Console.WriteLine("                     (try going backwards)");
            Console.WriteLine("middle mouse button - reset to default speed");
            Console.WriteLine("'=' or '+' - increase tail");
            Console.WriteLine("'-' - decrease tail");
            Console.WriteLine("'q' - quit progrqam");
            Console.WriteLine("--------------------------------------------------");
            Console.WriteLine();
        }
        #endregion Init()

        #region Render()
        private static void Render()
        {
            inc += 0.01f;
            Gl.glRotatef(50 * (float)(Math.Cos(inc)), 0.0f, 0.0f, 1.0f);

            speed += speedIncrement;
            for (int i = 0; i < NUMBER_STARS; i++)
            {
                Gl.glPushMatrix();
                Gl.glTranslatef(xyz[i][0], xyz[i][1], xyz[i][2]);
                Gl.glColor3fv(colors[i]);
                Glut.glutSolidSphere(0.1f, 5, 5);
                Gl.glPopMatrix();

                // increment z
                xyz[i][2] += speed;

                // check to see if passed view
                if (xyz[i][2] > NEAR_PLANE + GAP)
                {
                    float d;
                    if ((d = (float)(Math.Sqrt(xyz[i][0] * xyz[i][0] + xyz[i][1] * xyz[i][1]))) < RADIUS)
                    {
                        red += (RADIUS - d) / RADIUS;
                        if (red > 2.5f)
                        {
                            red = 2.5f;
                        }
                    }

                    xyz[i][0] = ((float)rand.Next(RAND_MAX) / RAND_MAX - 0.5f) * FIELD_WIDTH;
                    xyz[i][1] = ((float)rand.Next(RAND_MAX) / RAND_MAX - 0.5f) * FIELD_HEIGHT;
                    xyz[i][2] = FAR_PLANE;
                }
                else if (xyz[i][2] < FAR_PLANE)
                {
                    xyz[i][0] = ((float)rand.Next(RAND_MAX) / RAND_MAX - 0.5f) * FIELD_WIDTH;
                    xyz[i][1] = ((float)rand.Next(RAND_MAX) / RAND_MAX - 0.5f) * FIELD_HEIGHT;
                    xyz[i][2] = NEAR_PLANE;
                }
            }
        }
        #endregion Render()

        // --- Callbacks ---
        #region Display()
        /// <summary>
        ///     Called to draw the client area.
        /// </summary>
        private static void Display()
        {
            // clear the depth buffer
            Gl.glClear(Gl.GL_DEPTH_BUFFER_BIT);

            // enable blending
            Gl.glEnable(Gl.GL_BLEND);
            Gl.glBlendFunc(Gl.GL_SRC_ALPHA, Gl.GL_ONE_MINUS_SRC_ALPHA);

            // disable lighting
            Gl.glDisable(Gl.GL_LIGHTING);
            // disable depth test
            Gl.glDisable(Gl.GL_DEPTH_TEST);
            // blend in a polygon
            Gl.glColor4f(red, red, red, alpha);

            // reduce the red component
            red -= 0.02f;
            if (red < 0.0f)
            {
                red = 0.0f;
            }

            // draw the polygons
            Gl.glBegin(Gl.GL_QUADS);
            Gl.glVertex3f(-1.0f, -1.0f, 2.0f);
            Gl.glVertex3f(-1.0f, 1.0f, 2.0f);
            Gl.glVertex3f(1.0f, 1.0f, 2.0f);
            Gl.glVertex3f(1.0f, -1.0f, 2.0f);
            Gl.glEnd();

            // enable lighting
            Gl.glEnable(Gl.GL_LIGHTING);
            // enable depth test
            Gl.glEnable(Gl.GL_DEPTH_TEST);
            // disable blending
            Gl.glDisable(Gl.GL_BLEND);

            // save the current matrix state, so transformation will
            // not persist across displayFunc calls, since we
            // will do a glPopMatrix() at the end of this function
            Gl.glPushMatrix();
            // render the scene
            Render();
            // restore the matrix state
            Gl.glPopMatrix();

            // flush the buffer
            Gl.glFlush();
            // swap the double buffer
            Glut.glutSwapBuffers();
        }
        #endregion Display()

        #region Keyboard(byte key, int x, int y)
        /// <summary>
        ///     Called on a key event.
        /// </summary>
        private static void Keyboard(byte key, int x, int y)
        {
            switch (key)
            {
                case 27:
                case (byte)'Q':
                case (byte)'q':
                    Environment.Exit(0);
                    break;
                case (byte)'+':
                case (byte)'=':
                    alpha -= 0.02f;
                    if (alpha < 0.05f)
                    {
                        alpha = 0.05f;
                    }
                    break;
                case (byte)'-':
                    alpha += 0.02f;
                    if (alpha > 1.0f)
                    {
                        alpha = 1.0f;
                    }
                    break;
            }

            Glut.glutPostRedisplay();
        }
        #endregion Keyboard(byte key, int x, int y)

        #region Idle()
        private static void Idle()
        {
            // invalidates the current window, so GLUT will call display function
            Glut.glutPostRedisplay();
        }
        #endregion Idle()

        #region Mouse(int button, int state, int x, int y)
        /// <summary>
        ///     Called on a mouse event.
        /// </summary>
        private static void Mouse(int button, int state, int x, int y)
        {
            if (button == Glut.GLUT_LEFT_BUTTON)
            {
                // when left mouse button is down, go forward faster
                if (state == Glut.GLUT_DOWN)
                {
                    speedIncrement += 0.02f;
                }
                else if (state == Glut.GLUT_UP)
                {
                    speedIncrement -= 0.02f;
                }
            }
            else if (button == Glut.GLUT_RIGHT_BUTTON)
            {
                // when right mouse button down, go backwards faster
                if (state == Glut.GLUT_DOWN)
                {
                    speedIncrement -= 0.02f;
                }
                else if (state == Glut.GLUT_UP)
                {
                    speedIncrement += 0.02f;
                }
            }
            else if (button == Glut.GLUT_MIDDLE_BUTTON)
            {
                if (state == Glut.GLUT_DOWN)
                {
                    speed = DEFAULT_SPEED;
                    speedIncrement = 0;
                }
            }
        }
        #endregion Mouse(int button, int state, int x, int y)

        #region Reshape(int w, int h)
        /// <summary>
        ///     Called when window size changes.
        /// </summary>
        private static void Reshape(int w, int h)
        {
            // save the new window size
            windowWidth = w;
            windowHeight = h;
            // map the view port to the client area
            Gl.glViewport(0, 0, w, h);
            // set the matrix mode to project
            Gl.glMatrixMode(Gl.GL_PROJECTION);
            // load the identity matrix
            Gl.glLoadIdentity();
            // create the viewing frustum
            Glu.gluPerspective(64.0, (float)w / (float)h, 0.1, 300.0);
            // set the matrix mode to modelview
            Gl.glMatrixMode(Gl.GL_MODELVIEW);
            // load the identity matrix
            Gl.glLoadIdentity();
            // position the view point
            Glu.gluLookAt(0.0f, 0.0, 3.0f, 0.0f, 0.0f, 0.0f, 0.0f, 2.0f, 3.0f);
            // set the position of the light
            Gl.glLightfv(Gl.GL_LIGHT0, Gl.GL_POSITION, lightPosition);
        }
        #endregion Reshape(int w, int h)
    }
}


text:
pimcore.registerNS("pimcore.settings.email.log");
pimcore.settings.email.log = Class.create({

    filterField: null,

    initialize: function(document) {
        this.document = document;

        this.filterField = new Ext.form.TextField({
            width: 200,
            style: "margin: 0 10px 0 0;",
            enableKeyEvents: true,
            value: this.preconfiguredFilter,
            listeners: {
                "keydown" : function (field, key) {
                    if (key.getKey() == key.ENTER) {
                        var input = field;
                        var proxy = this.store.getProxy();
                        proxy.extraParams.filter = input.getValue();
                        this.store.load();
                    }
                }.bind(this)
            }
        });

        if(!this.document) {
            var tabPanel = Ext.getCmp("pimcore_panel_tabs");
            tabPanel.add(this.getLayout());
            tabPanel.setActiveTab(this.getLayout());

            pimcore.layout.refresh();

            this.getLayout().on("destroy", function () {
                pimcore.globalmanager.remove("sent_emails");
            }.bind(this));
        }
    },

    activate: function () {
        // this is only for standalone mode (without document set)
        var tabPanel = Ext.getCmp("pimcore_panel_tabs");
        tabPanel.activate(this.getLayout());
    },

    load: function () {
    },

    getLayout: function () {

        if (this.layout == null) {

            this.grid = this.getGrid();

            this.layout = new Ext.Panel({
                title: t('email_logs'),
                border: false,
                layout: "fit",
                items: [this.grid],
                closable: this.document ? false : true,
                iconCls: "pimcore_icon_email_transfer",
                listeners: {
                    activate: function() {
                        this.store.load();
                        this.grid.getView().refresh();
                    }.bind(this)
                }
            });
        }

        return this.layout;
    },

    getGrid: function () {

        var iFrameSettings = { width : 700, height : 500};

        var itemsPerPage = 20;

        var gridColumns = [{
            header: "ID",
            dataIndex: "id",
            flex: 40,
            hidden: true
        },{
            header: "Document Id",
            dataIndex: "documentId",
            flex: 130,
            hidden: true
        },
        {
            header: t('email_log_sent_Date'),
            dataIndex: "sentDate",
            width: 130,
            flex: false,
            sortable: false,
            renderer: function (d) {
                var date = new Date(intval(d) * 1000);
                return Ext.Date.format(date, "Y-m-d H:i:s");
            }
        },
        {
            header: t('email_log_from'),
            sortable: false,
            dataIndex: "from",
            flex: 120
        },
        {
            header: t('email_log_to'),
            sortable: false,
            dataIndex: "to",
            flex: 120
        },
        {
            header: t('email_log_cc'),
            sortable: false,
            dataIndex: "cc",
            flex: 120
        },
        {
            header: t('email_log_bcc'),
            sortable: false,
            dataIndex: "bcc",
            flex: 120
        },
        {
            header: t('email_log_subject'),
            sortable: false,
            dataIndex: "subject",
            flex: 220
        },
        {
            xtype: 'actioncolumn',
            sortable: false,
            width: 50,
            dataIndex: "emailLogExistsHtml",
            header: t('email_log_html'),
            items : [{
                tooltip: t('email_log_show_html_email'),
                icon: "/pimcore/static6/img/icon/email_open.png",
                handler: function(grid, rowIndex){
                    var rec = grid.getStore().getAt(rowIndex);
                    var iframe = new Ext.Window({
                        title: t("email_log_iframe_title_html"),
                        width: iFrameSettings.width,
                        height: iFrameSettings.height,
                        layout: 'fit',
                        items : [{
                                xtype : "box",
                                autoEl: {tag: 'iframe', src: "/admin/email/show-email-log/?id=" + rec.get('id')
                                                                                + "&type=html"}
                            }]
                    });
                    iframe.show();
                }.bind(this),
                getClass: function(v, meta, rec) {
                    if(!rec.get('emailLogExistsHtml')){
                        return "pimcore_hidden";
                    }
                }
            }]
        },
        {
            xtype: 'actioncolumn',
            sortable: false,
            width: 50,
            dataIndex: "emailLogExistsText",
            header: t('email_log_text'),
            hidden: true,
            items : [{
                tooltip: t('email_log_show_text_email'),
                icon: "/pimcore/static6/img/icon/text_align_justify.png",
                handler: function(grid, rowIndex){
                    var rec = grid.getStore().getAt(rowIndex);
                    var iframe = new Ext.Window({
                        title: t("email_log_iframe_title_text"),
                        width: iFrameSettings.width,
                        height: iFrameSettings.height,
                        layout: 'fit',
                        items : [{
                                xtype : "box",
                                autoEl: {tag: 'iframe', src: "/admin/email/show-email-log/?id=" + rec.get('id')
                                                                    + "&type=text"}
                            }]
                    });
                    iframe.show();
                }.bind(this),
                getClass: function(v, meta, rec) {
                    if(!rec.get('emailLogExistsText')){
                        return "pimcore_hidden";
                    }
                }
            }]
        },
        {
            xtype: 'actioncolumn',
            sortable: false,
            width: 120,
            dataIndex: "params",
            hidden: true,
            header: t('email_log_params'),
            items : [{
                tooltip: t('email_log_show_text_params'),
                icon: "/pimcore/static6/img/icon/information.png",
                handler: function(grid, rowIndex){
                    var rec = grid.getStore().getAt(rowIndex);

                    this.tree = new Ext.ux.tree.TreeGrid({
                        width: 700,
                        height: 700,
                        renderTo: Ext.getBody(),
                        enableDD: true,

                        columns:[{
                            header: t('email_log_property'),
                            dataIndex: 'key',
                            width: 230
                        },{
                            header: t('email_log_data'),
                            width: 370,
                            dataIndex: 'data',
                            tpl: new Ext.XTemplate('{data:this.formatData}', {
                                formatData: function (data){
                                    if(data.type == 'simple'){
                                        return data.value;
                                    }else{
                                        //when the objectPath is set -> the object is still available otherwise it was
                                        // deleted in the meantime
                                        if(data.objectPath){
                                            var subtype = data.objectClassSubType.toLowerCase();
                                            return ''
                                                                + data.objectPath + '';
                                        }else{
                                            return '"' + data.objectClass + '" with Id: '
                                                + data.objectId + ' (deleted)';
                                        }
                                    }
                                }
                            })
                        }],

                        dataUrl: '/admin/email/show-email-log/?id=' + rec.get('id') + '&type=params'
                    });

                    this.window = new Ext.Window({
                         modal: true,
                         width: 620,
                         height: 700,
                         title: t('email_log_params'),
                         items: [this.tree],
                         layout: "fit"
                     });
                     this.window.show();

                }.bind(this)
            }]
        },
        {
            xtype:'actioncolumn',
            width:30,
            items:[
                {
                    tooltip:t('email_log_resend'),
                    icon:"/pimcore/static6/img/icon/email_start.png",
                    handler:function (grid, rowIndex) {
                        var rec = grid.getStore().getAt(rowIndex);
                            Ext.Msg.confirm(t('email_log_resend_window_title'), t('email_log_resend_window_msg'),
                                function(btn){
                                if (btn == 'yes'){
                                    Ext.Ajax.request({
                                        url: '/admin/email/resend-email/',
                                        success: function(response){
                                            var data = Ext.decode( response.responseText );
                                            if(data.success){
                                                Ext.Msg.alert(t('email_log_resend_window_title'),
                                                              t('email_log_resend_window_success_message'));
                                            }else{
                                                Ext.Msg.alert(t('email_log_resend_window_title'),
                                                              t('email_log_resend_window_error_message'));
                                            }
                                        },
                                        failure: function () {
                                            alert("Could not resend email");
                                        },
                                        params: { id : rec.get('id') }
                                    });
                                }
                            });
                    }.bind(this),
                    getClass: function(v, meta, rec) {
                        if(!rec.get('emailLogExistsHtml') && !rec.get('emailLogExistsText') ){
                            return "pimcore_hidden";
                        }
                    }
                }
            ]
        },
         {
            xtype: 'actioncolumn',
            width: 30,
            items: [{
                tooltip: t('delete'),
                icon: "/pimcore/static6/img/icon/cross.png",
                handler: function (grid, rowIndex) {
                    var rec = grid.getStore().getAt(rowIndex);
                    Ext.Ajax.request({
                        url: '/admin/email/delete-email-log/',
                        success: function(response){
                            var data = Ext.decode( response.responseText );
                            if(!data.success){
                                alert("Could not delete email log");
                            }
                        },
                        failure: function () {
                            alert("Could not delete email log");
                        },
                        params: { id : rec.get('id') }
                    });
                    grid.getStore().removeAt(rowIndex);
                }.bind(this)
            }]
        }

        ];

       var storeFields = ["id","documentId","subject","emailLogExistsHtml","params","sentDate","params",
                          "modificationDate","requestUri","from","to","cc","bcc","emailLogExistsHtml",
                          "emailLogExistsText"];

        this.store = pimcore.helpers.grid.buildDefaultStore(
            '/admin/email/email-logs?',
            storeFields,
            itemsPerPage
        );

        if(this.document) {
            var proxy = this.store.getProxy();
            proxy.extraParams["documentId"] = this.document.id;
        }

        this.pagingtoolbar = pimcore.helpers.grid.buildDefaultPagingToolbar(this.store, itemsPerPage);

        var toolbar = Ext.create('Ext.Toolbar', {
            cls: 'main-toolbar',
            items: [
                "->",
                {
                    text: t("filter") + "/" + t("search"),
                    xtype: "tbtext",
                    style: "margin: 0 10px 0 0;"
                },this.filterField
            ]
        });

        this.grid = new Ext.grid.GridPanel({
            frame: false,
            store: this.store,
            columns : gridColumns,
            columnLines: true,
            stripeRows: true,
            border: true,
            trackMouseOver: true,
            loadMask: true,
            viewConfig: {
                forceFit: true
            },
            tbar: toolbar,
            bbar: this.pagingtoolbar
        });

        return this.grid;
    },

    reload: function () {

        this.grid.store.reload();
        this.grid.getView().refresh();

    }
});

redpajama_set_name: RedPajamaGithub


text:
<?php
$this->load->view('vwHeader');
?>

<link href="<?php echo HTTP_CSS_PATH; ?>starter-template.css" rel="stylesheet">

Pengendalian Dini

Antisipasi saat terjadi gempa

Yang harus dilakukan pada saat gempa bumi terjadi :

			1.	Jika anda didalam ruangan, hindari dari benda-benda berat yang mudah jatuh, berlindunglah dikolong meja atau perabot lain yang dianggap kuat dan aman. Peganglah kaki meja atau perabot lain dimana anda berlindung dan waspada jika perabot tersebut bergeser. Tunggu sampai getaran berhenti, dan jika keadaan aman bergeraklah untuk pindah ketempat yang lebih aman dan waspada terhadap benda-benda yang mudah jatuh seperti kaca, perabot-perabot yang berat, dan lain-lain serta yang paling penting adalah anda harus tenang.

		2.	Jika anda diluar ruangan, cari tempat yang terbuka, hindari dari gedung-gedung, aliran listrik, pohon-pohon besar dan lain-lain.

		3.	Jika anda sedang mengemudi, berhentilah jika keadaan aman dan usahakan masi didalam kendaraan, hindari jembatan terowongan dan aliran listrik.

		4.	Jika anda digunung atau dilereng yang tidak stabil hindari jatuhan batu atau benda-benda lain yang mungkin bergerak atau jatuh akibat gempa.

		5.	Jika anda di pantai, waspadalah terhadap gelombang pasang larilah ketempat yang lebih tinggi dan jangan mendekat kearah laut.

Yang harus dilakukan setelah gempa bumi terjadi.

		a)	Terhadap orang yang luka berat, jangan ditinggalkan sendirian dan jangan dipindahkan kecuali kalau mereka dalam bahaya yang segera akan menambah luka lagi.

		b)	Waspada terhadap kebakaran.

		c)	Matikan kompor gas, segera putus aliran gas dan instalasinya atau lepaskan slang aliran gas dari tabungnya.

		d)	Matikan aliran lampu listrik dari sumbernya.

		e)	Turunkan benda-benda berat yang tergantung di tembok yang mungkin dapat menjatuhi orang.

		f)	Siapkan barang-barang ringan untuk kebutuhan pokok yang mudah dibawa dan obat-obatan ringan untuk keperluan paling tidak 3 hari jika anda pindah ketempat yang jauh.

		g)	Waspadai tsunami jika anda tinggal dekat pantai.

		h)	Waspadai gempa bumi susulan. Walaupun kekuatan gempa bumi susulan lebih kecil dari pada gempa utamanya, tetapi beberapa getaran bisa menambah kerusakan struktur bangunan. Tinggalkan rumah atau bangunan yang telah mengalami perubahan struktur karena gempa bumi utama.

Alur Jika Terjadi Gempa

Saran Jika Terjadi Gempa

Kerugian akibat Gempa

Animasi Gempa

        <object height="400" width="700" data="http://www.iptek.net.id/ind/animasi/TEWS1.swf"></object>

 Animasi TEWS

<?php
$this->load->view('vwFooter');
?>


text:
/*
 * NOTE:
 *   This file is plugin stub for main.js
 */

import Vue from "vue";
import plugin from "./index";
const { Quill, version } = plugin;

console.log("TCL: plugin", plugin);
console.log("TCL: version", version);
console.log("TCL: Quill", Quill);

Vue.use(plugin);

/*
 * NOTE:
 *   If you want Vue instance of main.js to import something in your plugin as a Vue option,
 *   you need to export it here.
 */
// export default plugin


text:
import {createSelector} from 'reselect'

import {computeSingleValuedSurface, computeIsochrone} from './isochrone'
import selectMaxTripDurationMinutes from './max-trip-duration-minutes'
import selectTravelTimePercentile from './travel-time-percentile'

const comparisonSingleValuedSurface = createSelector(
  (state) => state.analysis.comparisonTravelTimeSurface,
  selectTravelTimePercentile,
  computeSingleValuedSurface
)

/** Selector for the comparison project isochrone */
export default createSelector(
  comparisonSingleValuedSurface,
  selectMaxTripDurationMinutes,
  computeIsochrone
)


text:
<?xml version='1.0' encoding='utf-8'?>
<widget defaultlocale="en-US" id="io.cordova.myappe2785d518e9f4f6ea03055878dd7a400" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:vs="http://schemas.microsoft.com/appx/2014/htmlapps">
    <icon height="62" src="res/icons/wp8/ApplicationIcon.png" width="62" />
    <icon height="173" src="res/icons/wp8/Background.png" width="173" />
    <splash height="800" src="res/screens/wp8/SplashScreenImage.jpg" width="480" />
    <name>MobileApp</name>
    <description>A blank project that uses Apache Cordova to help you build an app that targets multiple mobile platforms: Android, iOS, Windows, and Windows Phone.</description>
    <author email="dev@cordova.apache.org" href="http://cordova.io">Apache Cordova Team </author>
    <content src="index.html" />
    <access origin="*" />
    <vs:features />
    <preference name="SplashScreen" value="screen" />
    <preference name="windows-target-version" value="8.1" />
    <preference name="windows-phone-target-version" value="8.1" />
</widget>


text:
name: Question
about: Ask a question about the extension
title: "[QUESTION] - "
labels: question
assignees: ''

---

<!-- Please take some time to read the README. It has a lot of information and your question could be already answered there. -->

<!-- Describe what you would like to know. -->


text:
title:  "Sourcelair"
date:   2016-12-20 15:04:23
categories: [jekyll]
tags: [jekyll]
---
You'll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve --watch`, which launches a web server and auto-regenerates your site when a file is updated.

To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.

Jekyll also offers powerful support for code snippets:


text:
package org.apache.carbondata.spark.testsuite.datamap

import java.io.File
import java.util

import scala.collection.JavaConverters._

import org.apache.spark.sql.test.util.QueryTest
import org.scalatest.BeforeAndAfterAll

import org.apache.carbondata.common.exceptions.sql.MalformedDataMapCommandException
import org.apache.carbondata.core.constants.CarbonCommonConstants
import org.apache.carbondata.core.datamap.{DataMapDistributable, DataMapMeta, Segment}
import org.apache.carbondata.core.datamap.dev.{DataMapBuilder, DataMapWriter}
import org.apache.carbondata.core.datamap.dev.cgdatamap.{CoarseGrainDataMap, CoarseGrainDataMapFactory}
import org.apache.carbondata.core.datamap.status.{DataMapStatus, DataMapStatusManager}
import org.apache.carbondata.core.datastore.block.SegmentProperties
import org.apache.carbondata.core.datastore.page.ColumnPage
import org.apache.carbondata.core.features.TableOperation
import org.apache.carbondata.core.indexstore.PartitionSpec
import org.apache.carbondata.core.metadata.schema.table.{CarbonTable, DataMapSchema}
import org.apache.carbondata.core.scan.filter.intf.ExpressionType
import org.apache.carbondata.core.util.CarbonProperties
import org.apache.carbondata.events.Event

class TestDataMapStatus extends QueryTest with BeforeAndAfterAll {

  val testData = s"$resourcesPath/sample.csv"

  override def beforeAll: Unit = {
    new File(CarbonProperties.getInstance().getSystemFolderLocation).delete()
    drop
  }

  test("datamap status enable for new datamap") {
    sql("DROP TABLE IF EXISTS datamapstatustest")
    sql(
      """
        | CREATE TABLE datamapstatustest(id int, name string, city string, age int)
        | STORED AS carbondata TBLPROPERTIES('sort_scope'='local_sort','sort_columns'='name,city')
      """.stripMargin)
    sql(
      s"""create datamap statusdatamap on table datamapstatustest
         |using '${classOf[TestDataMapFactory].getName}'
         |dmproperties('index_columns'='name')
         | """.stripMargin)

    val details = DataMapStatusManager.readDataMapStatusDetails()

    assert(details.length == 1)

    assert(details.exists(p => p.getDataMapName.equals("statusdatamap") && p.getStatus == DataMapStatus.ENABLED))
    sql("DROP TABLE IF EXISTS datamapstatustest")
  }

  test("datamap status disable for new datamap with deferred rebuild") {
    sql("DROP TABLE IF EXISTS datamapstatustest")
    sql(
      """
        | CREATE TABLE datamapstatustest(id int, name string, city string, age int)
        | STORED AS carbondata TBLPROPERTIES('sort_scope'='local_sort','sort_columns'='name,city')
      """.stripMargin)
    sql(
      s"""create datamap statusdatamap on table datamapstatustest
         |using '${classOf[TestDataMapFactory].getName}'
         |with deferred rebuild
         |dmproperties('index_columns'='name')
         | """.stripMargin)

    val details = DataMapStatusManager.readDataMapStatusDetails()

    assert(details.length == 1)

    assert(details.exists(p => p.getDataMapName.equals("statusdatamap") && p.getStatus == DataMapStatus.DISABLED))
    sql("DROP TABLE IF EXISTS datamapstatustest")
  }

  test("datamap status disable after new load  with deferred rebuild") {
    sql("DROP TABLE IF EXISTS datamapstatustest1")
    sql(
      """
        | CREATE TABLE datamapstatustest1(id int, name string, city string, age int)
        | STORED AS carbondata TBLPROPERTIES('sort_scope'='local_sort','sort_columns'='name,city')
      """.stripMargin)
    sql(
      s"""create datamap statusdatamap1 on table datamapstatustest1
         |using '${classOf[TestDataMapFactory].getName}'
         |with deferred rebuild
         |dmproperties('index_columns'='name')
         | """.stripMargin)

    var details = DataMapStatusManager.readDataMapStatusDetails()

    assert(details.length == 1)

    assert(details.exists(p => p.getDataMapName.equals("statusdatamap1") && p.getStatus == DataMapStatus.DISABLED))

    sql(s"LOAD DATA LOCAL INPATH '$testData' into table datamapstatustest1")
    details = DataMapStatusManager.readDataMapStatusDetails()
    assert(details.length == 1)
    assert(details.exists(p => p.getDataMapName.equals("statusdatamap1") && p.getStatus == DataMapStatus.DISABLED))
    sql("DROP TABLE IF EXISTS datamapstatustest1")
  }

  test("datamap status with REBUILD DATAMAP") {
    sql("DROP TABLE IF EXISTS datamapstatustest2")
    sql(
      """
        | CREATE TABLE datamapstatustest2(id int, name string, city string, age int)
        | STORED AS carbondata TBLPROPERTIES('sort_scope'='local_sort','sort_columns'='name,city')
      """.stripMargin)
    sql(
      s"""create datamap statusdatamap2 on table datamapstatustest2
         |using '${classOf[TestDataMapFactory].getName}'
         |with deferred rebuild
         |dmproperties('index_columns'='name')
         | """.stripMargin)

    var details = DataMapStatusManager.readDataMapStatusDetails()

    assert(details.length == 1)

    assert(details.exists(p => p.getDataMapName.equals("statusdatamap2") && p.getStatus == DataMapStatus.DISABLED))

    sql(s"LOAD DATA LOCAL INPATH '$testData' into table datamapstatustest2")
    details = DataMapStatusManager.readDataMapStatusDetails()
    assert(details.length == 1)
    assert(details.exists(p => p.getDataMapName.equals("statusdatamap2") && p.getStatus == DataMapStatus.DISABLED))

    sql(s"REBUILD DATAMAP statusdatamap2 on table datamapstatustest2")

    details = DataMapStatusManager.readDataMapStatusDetails()
    assert(details.length == 1)
    assert(details.exists(p => p.getDataMapName.equals("statusdatamap2") && p.getStatus == DataMapStatus.ENABLED))

    sql("DROP TABLE IF EXISTS datamapstatustest2")
  }

  test("datamap create without on table test") {
    sql("DROP TABLE IF EXISTS datamapstatustest3")
    sql(
      """
        | CREATE TABLE datamapstatustest3(id int, name string, city string, age int)
        | STORED AS carbondata TBLPROPERTIES('sort_scope'='local_sort','sort_columns'='name,city')
      """.stripMargin)
    intercept[MalformedDataMapCommandException] {
      sql(
        s"""create datamap statusdatamap3
           |using '${classOf[TestDataMapFactory].getName}'
           |dmproperties('index_columns'='name')
           | """.stripMargin)

    }
    sql("DROP TABLE IF EXISTS datamapstatustest3")
  }

  test("rebuild datamap status") {
    sql("DROP TABLE IF EXISTS datamapstatustest3")
    sql(
      """
        | CREATE TABLE datamapstatustest3(id int, name string, city string, age int)
        | STORED AS carbondata TBLPROPERTIES('sort_scope'='local_sort','sort_columns'='name,city')
      """.stripMargin)
    sql(
      s"""create datamap statusdatamap3 on table datamapstatustest3
         |using '${classOf[TestDataMapFactory].getName}'
         |with deferred rebuild
         |dmproperties('index_columns'='name')
         | """.stripMargin)

    var details = DataMapStatusManager.readDataMapStatusDetails()

    assert(details.length == 1)

    assert(details.exists(p => p.getDataMapName.equals("statusdatamap3") && p.getStatus == DataMapStatus.DISABLED))

    sql(s"LOAD DATA LOCAL INPATH '$testData' into table datamapstatustest3")
    details = DataMapStatusManager.readDataMapStatusDetails()
    assert(details.length == 1)
    assert(details.exists(p => p.getDataMapName.equals("statusdatamap3") && p.getStatus == DataMapStatus.DISABLED))

    sql(s"REBUILD DATAMAP statusdatamap3")

    details = DataMapStatusManager.readDataMapStatusDetails()
    assert(details.length == 1)
    assert(details.exists(p => p.getDataMapName.equals("statusdatamap3") && p.getStatus == DataMapStatus.ENABLED))

    checkExistence(sql(s"show datamap"), true, "statusdatamap3")

    sql("DROP TABLE IF EXISTS datamapstatustest3")
  }

  override def afterAll {
    CarbonProperties.getInstance().addProperty(CarbonCommonConstants.ENABLE_HIVE_SCHEMA_META_STORE,
      CarbonCommonConstants.ENABLE_HIVE_SCHEMA_META_STORE_DEFAULT)
    drop
  }

  private def drop = {
    sql("drop table if exists datamapstatustest")
    sql("drop table if exists datamapshowtest")
    sql("drop table if exists datamapstatustest1")
    sql("drop table if exists datamapstatustest2")
  }
}

class TestDataMapFactory(
    carbonTable: CarbonTable,
    dataMapSchema: DataMapSchema) extends CoarseGrainDataMapFactory(carbonTable, dataMapSchema) {

  override def fireEvent(event: Event): Unit = ???

  override def clear(): Unit = {}

  override def getDataMaps(distributable: DataMapDistributable): util.List[CoarseGrainDataMap] = {
    ???
  }

  override def getDataMaps(segment: Segment): util.List[CoarseGrainDataMap] = {
    ???
  }

  override def createWriter(segment: Segment, shardName: String, segmentProperties: SegmentProperties): DataMapWriter = {
    new DataMapWriter(carbonTable.getTablePath, "testdm", carbonTable.getIndexedColumns(dataMapSchema),
      segment, shardName) {
      override def onPageAdded(blockletId: Int, pageId: Int, pageSize: Int, pages: Array[ColumnPage]): Unit = { }

      override def onBlockletEnd(blockletId: Int): Unit = { }

      override def onBlockEnd(blockId: String): Unit = { }

      override def onBlockletStart(blockletId: Int): Unit = { }

      override def onBlockStart(blockId: String): Unit = {
        // trigger the second SQL to execute
      }

      override def finish(): Unit = {

      }
    }
  }

  override def getMeta: DataMapMeta = new DataMapMeta(carbonTable.getIndexedColumns(dataMapSchema),
    Seq(ExpressionType.EQUALS).asJava)

  override def toDistributable(segmentId: Segment): util.List[DataMapDistributable] = {
    util.Collections.emptyList()
  }

  /**
   * delete datamap of the segment
   */
  override def deleteDatamapData(segment: Segment): Unit = {

  }

  /**
   * delete datamap data if any
   */
  override def deleteDatamapData(): Unit = {

  }

  /**
   * defines the features scopes for the datamap
   */
  override def willBecomeStale(operation: TableOperation): Boolean = {
    false
  }

  override def createBuilder(segment: Segment,
      shardName: String, segmentProperties: SegmentProperties): DataMapBuilder = {
    return new DataMapBuilder {
      override def initialize(): Unit = { }

      override def addRow(blockletId: Int,
          pageId: Int,
          rowId: Int,
          values: Array[AnyRef]): Unit = { }

      override def finish(): Unit = { }

      override def close(): Unit = { }

      /**
       * whether create index on internal carbon bytes (such as dictionary encoded) or original
       * value
       */
      override def isIndexForCarbonRawBytes: Boolean = {
        false
      }
    }
  }

  override def supportRebuild(): Boolean = true

  /**
   * Get the datamap for segmentId and partitionSpecs
   */
  override def getDataMaps(segment: Segment,
      partitions: util.List[PartitionSpec]): util.List[CoarseGrainDataMap] = {
    ???
  }
}


text:
namespace media {
namespace {

constexpr mojom::RemotingSinkCapabilities kAllCapabilities =
    mojom::RemotingSinkCapabilities::CONTENT_DECRYPTION_AND_RENDERING;

PipelineMetadata DefaultMetadata() {
  PipelineMetadata data;
  data.has_audio = true;
  data.has_video = true;
  data.video_decoder_config = TestVideoConfig::Normal();
  return data;
}

PipelineMetadata EncryptedMetadata() {
  PipelineMetadata data;
  data.has_audio = true;
  data.has_video = true;
  data.video_decoder_config = TestVideoConfig::NormalEncrypted();
  return data;
}

}  // namespace

class RemotingRendererControllerTest : public ::testing::Test {
 public:
  RemotingRendererControllerTest() {}
  ~RemotingRendererControllerTest() override {}

  void TearDown() final { RunUntilIdle(); }

  static void RunUntilIdle() { base::RunLoop().RunUntilIdle(); }

  void ToggleRenderer() {
    is_rendering_remotely_ =
        remoting_renderer_controller_->remote_rendering_started();
  }

  void CreateCdm(bool is_remoting) { is_remoting_cdm_ = is_remoting; }

  base::MessageLoop message_loop_;

 protected:
  std::unique_ptr<RemotingRendererController> remoting_renderer_controller_;
  bool is_rendering_remotely_ = false;
  bool is_remoting_cdm_ = false;

 private:
  DISALLOW_COPY_AND_ASSIGN(RemotingRendererControllerTest);
};

TEST_F(RemotingRendererControllerTest, ToggleRendererOnFullscreenChange) {
  EXPECT_FALSE(is_rendering_remotely_);
  scoped_refptr<RemotingSourceImpl> remoting_source_impl =
      CreateRemotingSourceImpl(false);
  remoting_renderer_controller_ =
      base::MakeUnique<RemotingRendererController>(remoting_source_impl);
  remoting_renderer_controller_->SetSwitchRendererCallback(base::Bind(
      &RemotingRendererControllerTest::ToggleRenderer, base::Unretained(this)));
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
  remoting_source_impl->OnSinkAvailable(kAllCapabilities);
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
  remoting_renderer_controller_->OnEnteredFullscreen();
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
  remoting_renderer_controller_->OnMetadataChanged(DefaultMetadata());
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
  remoting_renderer_controller_->OnRemotePlaybackDisabled(false);
  RunUntilIdle();
  EXPECT_TRUE(is_rendering_remotely_);  // All requirements now satisfied.

  // Leaving fullscreen should shut down remoting.
  remoting_renderer_controller_->OnExitedFullscreen();
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
}

TEST_F(RemotingRendererControllerTest, ToggleRendererOnSinkCapabilities) {
  EXPECT_FALSE(is_rendering_remotely_);
  scoped_refptr<RemotingSourceImpl> remoting_source_impl =
      CreateRemotingSourceImpl(false);
  remoting_renderer_controller_ =
      base::MakeUnique<RemotingRendererController>(remoting_source_impl);
  remoting_renderer_controller_->SetSwitchRendererCallback(base::Bind(
      &RemotingRendererControllerTest::ToggleRenderer, base::Unretained(this)));
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
  remoting_renderer_controller_->OnMetadataChanged(DefaultMetadata());
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
  remoting_renderer_controller_->OnRemotePlaybackDisabled(false);
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
  remoting_renderer_controller_->OnEnteredFullscreen();
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
  // An available sink that does not support remote rendering should not cause
  // the controller to toggle remote rendering on.
  remoting_source_impl->OnSinkAvailable(mojom::RemotingSinkCapabilities::NONE);
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
  remoting_source_impl->OnSinkGone();  // Bye-bye useless sink!
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
  // A sink that *does* support remote rendering *does* cause the controller to
  // toggle remote rendering on.
  remoting_source_impl->OnSinkAvailable(kAllCapabilities);
  RunUntilIdle();
  EXPECT_TRUE(is_rendering_remotely_);
  remoting_renderer_controller_->OnExitedFullscreen();
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
}

TEST_F(RemotingRendererControllerTest, ToggleRendererOnDisableChange) {
  EXPECT_FALSE(is_rendering_remotely_);
  scoped_refptr<RemotingSourceImpl> remoting_source_impl =
      CreateRemotingSourceImpl(false);
  remoting_renderer_controller_ =
      base::MakeUnique<RemotingRendererController>(remoting_source_impl);
  remoting_renderer_controller_->SetSwitchRendererCallback(base::Bind(
      &RemotingRendererControllerTest::ToggleRenderer, base::Unretained(this)));
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
  remoting_renderer_controller_->OnRemotePlaybackDisabled(true);
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
  remoting_source_impl->OnSinkAvailable(kAllCapabilities);
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
  remoting_renderer_controller_->OnMetadataChanged(DefaultMetadata());
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
  remoting_renderer_controller_->OnEnteredFullscreen();
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
  remoting_renderer_controller_->OnRemotePlaybackDisabled(false);
  RunUntilIdle();
  EXPECT_TRUE(is_rendering_remotely_);  // All requirements now satisfied.

  // If the page disables remote playback (e.g., by setting the
  // disableRemotePlayback attribute), this should shut down remoting.
  remoting_renderer_controller_->OnRemotePlaybackDisabled(true);
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
}

TEST_F(RemotingRendererControllerTest, StartFailed) {
  EXPECT_FALSE(is_rendering_remotely_);
  scoped_refptr<RemotingSourceImpl> remoting_source_impl =
      CreateRemotingSourceImpl(true);
  remoting_renderer_controller_ =
      base::MakeUnique<RemotingRendererController>(remoting_source_impl);
  remoting_renderer_controller_->SetSwitchRendererCallback(base::Bind(
      &RemotingRendererControllerTest::ToggleRenderer, base::Unretained(this)));
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
  remoting_source_impl->OnSinkAvailable(kAllCapabilities);
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
  remoting_renderer_controller_->OnEnteredFullscreen();
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
  remoting_renderer_controller_->OnMetadataChanged(DefaultMetadata());
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
  remoting_renderer_controller_->OnRemotePlaybackDisabled(false);
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
}

TEST_F(RemotingRendererControllerTest, EncryptedWithRemotingCdm) {
  EXPECT_FALSE(is_rendering_remotely_);
  remoting_renderer_controller_ = base::MakeUnique<RemotingRendererController>(
      CreateRemotingSourceImpl(false));
  remoting_renderer_controller_->SetSwitchRendererCallback(base::Bind(
      &RemotingRendererControllerTest::ToggleRenderer, base::Unretained(this)));
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
  remoting_renderer_controller_->OnMetadataChanged(EncryptedMetadata());
  remoting_renderer_controller_->OnRemotePlaybackDisabled(false);
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
  scoped_refptr<RemotingSourceImpl> cdm_remoting_source_impl =
      CreateRemotingSourceImpl(false);
  std::unique_ptr<RemotingCdmController> remoting_cdm_controller =
      base::MakeUnique<RemotingCdmController>(cdm_remoting_source_impl);
  cdm_remoting_source_impl->OnSinkAvailable(kAllCapabilities);
  remoting_cdm_controller->ShouldCreateRemotingCdm(base::Bind(
      &RemotingRendererControllerTest::CreateCdm, base::Unretained(this)));
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
  EXPECT_TRUE(is_remoting_cdm_);

  // Create a RemotingCdm with |remoting_cdm_controller|.
  scoped_refptr<RemotingCdm> remoting_cdm = new RemotingCdm(
      std::string(), GURL(), CdmConfig(), SessionMessageCB(), SessionClosedCB(),
      SessionKeysChangeCB(), SessionExpirationUpdateCB(), CdmCreatedCB(),
      std::move(remoting_cdm_controller));
  std::unique_ptr<RemotingCdmContext> remoting_cdm_context =
      base::MakeUnique<RemotingCdmContext>(remoting_cdm.get());
  remoting_renderer_controller_->OnSetCdm(remoting_cdm_context.get());
  RunUntilIdle();
  EXPECT_TRUE(is_rendering_remotely_);

  // For encrypted contents, entering/exiting full screen has no effect.
  remoting_renderer_controller_->OnEnteredFullscreen();
  RunUntilIdle();
  EXPECT_TRUE(is_rendering_remotely_);
  remoting_renderer_controller_->OnExitedFullscreen();
  RunUntilIdle();
  EXPECT_TRUE(is_rendering_remotely_);

  EXPECT_NE(RemotingSessionState::SESSION_PERMANENTLY_STOPPED,
            remoting_renderer_controller_->remoting_source()->state());
  cdm_remoting_source_impl->OnSinkGone();
  RunUntilIdle();
  EXPECT_EQ(RemotingSessionState::SESSION_PERMANENTLY_STOPPED,
            remoting_renderer_controller_->remoting_source()->state());
  // Don't switch renderer in this case. Still using the remoting renderer to
  // show the failure interstitial.
  EXPECT_TRUE(is_rendering_remotely_);
}

TEST_F(RemotingRendererControllerTest, EncryptedWithLocalCdm) {
  EXPECT_FALSE(is_rendering_remotely_);
  scoped_refptr<RemotingSourceImpl> renderer_remoting_source_impl =
      CreateRemotingSourceImpl(false);
  remoting_renderer_controller_ = base::MakeUnique<RemotingRendererController>(
      renderer_remoting_source_impl);
  remoting_renderer_controller_->SetSwitchRendererCallback(base::Bind(
      &RemotingRendererControllerTest::ToggleRenderer, base::Unretained(this)));
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
  renderer_remoting_source_impl->OnSinkAvailable(kAllCapabilities);
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
  remoting_renderer_controller_->OnEnteredFullscreen();
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
  remoting_renderer_controller_->OnMetadataChanged(EncryptedMetadata());
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
  remoting_renderer_controller_->OnRemotePlaybackDisabled(false);
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);

  scoped_refptr<RemotingSourceImpl> cdm_remoting_source_impl =
      CreateRemotingSourceImpl(true);
  std::unique_ptr<RemotingCdmController> remoting_cdm_controller =
      base::MakeUnique<RemotingCdmController>(cdm_remoting_source_impl);
  cdm_remoting_source_impl->OnSinkAvailable(kAllCapabilities);
  remoting_cdm_controller->ShouldCreateRemotingCdm(base::Bind(
      &RemotingRendererControllerTest::CreateCdm, base::Unretained(this)));
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
  EXPECT_FALSE(is_remoting_cdm_);
}

TEST_F(RemotingRendererControllerTest, EncryptedWithFailedRemotingCdm) {
  EXPECT_FALSE(is_rendering_remotely_);
  remoting_renderer_controller_ = base::MakeUnique<RemotingRendererController>(
      CreateRemotingSourceImpl(false));
  remoting_renderer_controller_->SetSwitchRendererCallback(base::Bind(
      &RemotingRendererControllerTest::ToggleRenderer, base::Unretained(this)));
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
  remoting_renderer_controller_->OnEnteredFullscreen();
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
  remoting_renderer_controller_->OnMetadataChanged(EncryptedMetadata());
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
  remoting_renderer_controller_->OnRemotePlaybackDisabled(false);
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);

  scoped_refptr<RemotingSourceImpl> cdm_remoting_source_impl =
      CreateRemotingSourceImpl(false);
  std::unique_ptr<RemotingCdmController> remoting_cdm_controller =
      base::MakeUnique<RemotingCdmController>(cdm_remoting_source_impl);
  cdm_remoting_source_impl->OnSinkAvailable(kAllCapabilities);
  remoting_cdm_controller->ShouldCreateRemotingCdm(base::Bind(
      &RemotingRendererControllerTest::CreateCdm, base::Unretained(this)));
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
  EXPECT_TRUE(is_remoting_cdm_);

  cdm_remoting_source_impl->OnSinkGone();
  RunUntilIdle();
  EXPECT_FALSE(is_rendering_remotely_);
  EXPECT_NE(RemotingSessionState::SESSION_PERMANENTLY_STOPPED,
            remoting_renderer_controller_->remoting_source()->state());

  scoped_refptr<RemotingCdm> remoting_cdm = new RemotingCdm(
      std::string(), GURL(), CdmConfig(), SessionMessageCB(), SessionClosedCB(),
      SessionKeysChangeCB(), SessionExpirationUpdateCB(), CdmCreatedCB(),
      std::move(remoting_cdm_controller));
  std::unique_ptr<RemotingCdmContext> remoting_cdm_context =
      base::MakeUnique<RemotingCdmContext>(remoting_cdm.get());
  remoting_renderer_controller_->OnSetCdm(remoting_cdm_context.get());
  RunUntilIdle();
  // Switch to using the remoting renderer, even when the remoting CDM session
  // was already terminated, to show the failure interstitial.
  EXPECT_TRUE(is_rendering_remotely_);
  EXPECT_EQ(RemotingSessionState::SESSION_PERMANENTLY_STOPPED,
            remoting_renderer_controller_->remoting_source()->state());
}

}  // namespace media


text:
    <link href="/stylesheets/master.css" rel="stylesheet" type="text/css"/>

Dynomite

Replication for

Health

Load

Replication

Partitioning

    <canvas id="canvas" width="800" height="600"></canvas>


text:
#ifndef __glut_h__
#define __glut_h__

/* This program is freely distributable without licensing fees  and is
   provided without guarantee or warrantee expressed or  implied. This
   program is -not- in the public domain. */

#if defined(WIN32)
#include <windows.h>
#pragma warning (disable:4244)        /* disable bogus conversion warnings */
#endif

#ifdef __APPLE__
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#else
#include <GL/glu.h>
#include <GL/gl.h>
#endif

/* define APIENTRY and CALLBACK to null string if we aren't on Win32 */
#if !defined(WIN32)
#define APIENTRY
#define CALLBACK
#endif

#ifdef __cplusplus
extern "C" {
#endif

/**
 GLUT API revision history:

 GLUT_API_VERSION is updated to reflect incompatible GLUT
 API changes (interface changes, semantic changes, deletions,
 or additions).

 GLUT_API_VERSION=1  First public release of GLUT.  11/29/94

 GLUT_API_VERSION=2  Added support for OpenGL/GLX multisampling,
 extension.  Supports new input devices like tablet, dial and button
 box, and Spaceball.  Easy to query OpenGL extensions.

 GLUT_API_VERSION=3  glutMenuStatus added.

 GLUT_API_VERSION=4  glutInitDisplayString, glutWarpPointer,
 glutBitmapLength, glutStrokeLength, glutWindowStatusFunc, dynamic
 video resize subAPI, glutPostWindowRedisplay (NOT FINALIZED!).
**/
#ifndef GLUT_API_VERSION  /* allow this to be overriden */
#define GLUT_API_VERSION        3
#endif

/**
 GLUT implementation revision history:

 GLUT_XLIB_IMPLEMENTATION is updated to reflect both GLUT
 API revisions and implementation revisions (ie, bug fixes).

 GLUT_XLIB_IMPLEMENTATION=1  mjk's first public release of
 GLUT Xlib-based implementation.  11/29/94

 GLUT_XLIB_IMPLEMENTATION=2  mjk's second public release of
 GLUT Xlib-based implementation providing GLUT version 2
 interfaces.

 GLUT_XLIB_IMPLEMENTATION=3  mjk's GLUT 2.2 images. 4/17/95

 GLUT_XLIB_IMPLEMENTATION=4  mjk's GLUT 2.3 images. 6/?/95

 GLUT_XLIB_IMPLEMENTATION=5  mjk's GLUT 3.0 images. 10/?/95

 GLUT_XLIB_IMPLEMENTATION=7  mjk's GLUT 3.1+ with glutWarpPoitner.  7/24/96

 GLUT_XLIB_IMPLEMENTATION=8  mjk's GLUT 3.1+ with glutWarpPoitner
 and video resize.  1/3/97

 GLUT_XLIB_IMPLEMENTATION=9 mjk's GLUT 3.4 release with early GLUT 4 routines.

 GLUT_XLIB_IMPLEMENTATION=11 Mesa 2.5's GLUT 3.6 release.

 GLUT_XLIB_IMPLEMENTATION=12 mjk's GLUT 3.6 release with early GLUT 4 routines + signal handling.
**/
#ifndef GLUT_XLIB_IMPLEMENTATION  /* Allow this to be overriden. */
#define GLUT_XLIB_IMPLEMENTATION    12
#endif

/* Display mode bit masks. */
#define GLUT_RGB            0
#define GLUT_RGBA            GLUT_RGB
#define GLUT_INDEX            1
#define GLUT_SINGLE            0
#define GLUT_DOUBLE            2
#define GLUT_ACCUM            4
#define GLUT_ALPHA            8
#define GLUT_DEPTH            16
#define GLUT_STENCIL            32
#if (GLUT_API_VERSION >= 2)
#define GLUT_MULTISAMPLE        128
#define GLUT_STEREO            256
#endif
#if (GLUT_API_VERSION >= 3)
#define GLUT_LUMINANCE            512
#endif

/* Mouse buttons. */
#define GLUT_LEFT_BUTTON        0
#define GLUT_MIDDLE_BUTTON        1
#define GLUT_RIGHT_BUTTON        2

/* Mouse button  state. */
#define GLUT_DOWN            0
#define GLUT_UP                1

#if (GLUT_API_VERSION >= 2)
/* function keys */
#define GLUT_KEY_F1            1
#define GLUT_KEY_F2            2
#define GLUT_KEY_F3            3
#define GLUT_KEY_F4            4
#define GLUT_KEY_F5            5
#define GLUT_KEY_F6            6
#define GLUT_KEY_F7            7
#define GLUT_KEY_F8            8
#define GLUT_KEY_F9            9
#define GLUT_KEY_F10            10
#define GLUT_KEY_F11            11
#define GLUT_KEY_F12            12
/* directional keys */
#define GLUT_KEY_LEFT            100
#define GLUT_KEY_UP            101
#define GLUT_KEY_RIGHT            102
#define GLUT_KEY_DOWN            103
#define GLUT_KEY_PAGE_UP        104
#define GLUT_KEY_PAGE_DOWN        105
#define GLUT_KEY_HOME            106
#define GLUT_KEY_END            107
#define GLUT_KEY_INSERT            108
#endif

/* Entry/exit  state. */
#define GLUT_LEFT            0
#define GLUT_ENTERED            1

/* Menu usage  state. */
#define GLUT_MENU_NOT_IN_USE        0
#define GLUT_MENU_IN_USE        1

/* Visibility  state. */
#define GLUT_NOT_VISIBLE        0
#define GLUT_VISIBLE            1

/* Window status  state. */
#define GLUT_HIDDEN            0
#define GLUT_FULLY_RETAINED        1
#define GLUT_PARTIALLY_RETAINED        2
#define GLUT_FULLY_COVERED        3

/* Color index component selection values. */
#define GLUT_RED            0
#define GLUT_GREEN            1
#define GLUT_BLUE            2

/* Layers for use. */
#define GLUT_NORMAL            0
#define GLUT_OVERLAY            1

#if defined(WIN32)
/* Stroke font constants (use these in GLUT program). */
#define GLUT_STROKE_ROMAN        ((void*)0)
#define GLUT_STROKE_MONO_ROMAN        ((void*)1)

/* Bitmap font constants (use these in GLUT program). */
#define GLUT_BITMAP_9_BY_15        ((void*)2)
#define GLUT_BITMAP_8_BY_13        ((void*)3)
#define GLUT_BITMAP_TIMES_ROMAN_10    ((void*)4)
#define GLUT_BITMAP_TIMES_ROMAN_24    ((void*)5)
#if (GLUT_API_VERSION >= 3)
#define GLUT_BITMAP_HELVETICA_10    ((void*)6)
#define GLUT_BITMAP_HELVETICA_12    ((void*)7)
#define GLUT_BITMAP_HELVETICA_18    ((void*)8)
#endif
#else
/* Stroke font opaque addresses (use constants instead in source code). */
extern void *glutStrokeRoman;
extern void *glutStrokeMonoRoman;

/* Stroke font constants (use these in GLUT program). */
#define GLUT_STROKE_ROMAN        (&glutStrokeRoman)
#define GLUT_STROKE_MONO_ROMAN        (&glutStrokeMonoRoman)

/* Bitmap font opaque addresses (use constants instead in source code). */
extern void *glutBitmap9By15;
extern void *glutBitmap8By13;
extern void *glutBitmapTimesRoman10;
extern void *glutBitmapTimesRoman24;
extern void *glutBitmapHelvetica10;
extern void *glutBitmapHelvetica12;
extern void *glutBitmapHelvetica18;

/* Bitmap font constants (use these in GLUT program). */
#define GLUT_BITMAP_9_BY_15        (&glutBitmap9By15)
#define GLUT_BITMAP_8_BY_13        (&glutBitmap8By13)
#define GLUT_BITMAP_TIMES_ROMAN_10    (&glutBitmapTimesRoman10)
#define GLUT_BITMAP_TIMES_ROMAN_24    (&glutBitmapTimesRoman24)
#if (GLUT_API_VERSION >= 3)
#define GLUT_BITMAP_HELVETICA_10    (&glutBitmapHelvetica10)
#define GLUT_BITMAP_HELVETICA_12    (&glutBitmapHelvetica12)
#define GLUT_BITMAP_HELVETICA_18    (&glutBitmapHelvetica18)
#endif
#endif

/* glutGet parameters. */
#define GLUT_WINDOW_X            100
#define GLUT_WINDOW_Y            101
#define GLUT_WINDOW_WIDTH        102
#define GLUT_WINDOW_HEIGHT        103
#define GLUT_WINDOW_BUFFER_SIZE        104
#define GLUT_WINDOW_STENCIL_SIZE    105
#define GLUT_WINDOW_DEPTH_SIZE        106
#define GLUT_WINDOW_RED_SIZE        107
#define GLUT_WINDOW_GREEN_SIZE        108
#define GLUT_WINDOW_BLUE_SIZE        109
#define GLUT_WINDOW_ALPHA_SIZE        110
#define GLUT_WINDOW_ACCUM_RED_SIZE    111
#define GLUT_WINDOW_ACCUM_GREEN_SIZE    112
#define GLUT_WINDOW_ACCUM_BLUE_SIZE    113
#define GLUT_WINDOW_ACCUM_ALPHA_SIZE    114
#define GLUT_WINDOW_DOUBLEBUFFER    115
#define GLUT_WINDOW_RGBA        116
#define GLUT_WINDOW_PARENT        117
#define GLUT_WINDOW_NUM_CHILDREN    118
#define GLUT_WINDOW_COLORMAP_SIZE    119
#if (GLUT_API_VERSION >= 2)
#define GLUT_WINDOW_NUM_SAMPLES        120
#define GLUT_WINDOW_STEREO        121
#endif
#if (GLUT_API_VERSION >= 3)
#define GLUT_WINDOW_CURSOR        122
#endif
#define GLUT_SCREEN_WIDTH        200
#define GLUT_SCREEN_HEIGHT        201
#define GLUT_SCREEN_WIDTH_MM        202
#define GLUT_SCREEN_HEIGHT_MM        203
#define GLUT_MENU_NUM_ITEMS        300
#define GLUT_DISPLAY_MODE_POSSIBLE    400
#define GLUT_INIT_WINDOW_X        500
#define GLUT_INIT_WINDOW_Y        501
#define GLUT_INIT_WINDOW_WIDTH        502
#define GLUT_INIT_WINDOW_HEIGHT        503
#define GLUT_INIT_DISPLAY_MODE        504
#if (GLUT_API_VERSION >= 2)
#define GLUT_ELAPSED_TIME        700
#endif

#if (GLUT_API_VERSION >= 2)
/* glutDeviceGet parameters. */
#define GLUT_HAS_KEYBOARD        600
#define GLUT_HAS_MOUSE            601
#define GLUT_HAS_SPACEBALL        602
#define GLUT_HAS_DIAL_AND_BUTTON_BOX    603
#define GLUT_HAS_TABLET            604
#define GLUT_NUM_MOUSE_BUTTONS        605
#define GLUT_NUM_SPACEBALL_BUTTONS    606
#define GLUT_NUM_BUTTON_BOX_BUTTONS    607
#define GLUT_NUM_DIALS            608
#define GLUT_NUM_TABLET_BUTTONS        609
#endif

#if (GLUT_API_VERSION >= 3)
/* glutLayerGet parameters. */
#define GLUT_OVERLAY_POSSIBLE           800
#define GLUT_LAYER_IN_USE        801
#define GLUT_HAS_OVERLAY        802
#define GLUT_TRANSPARENT_INDEX        803
#define GLUT_NORMAL_DAMAGED        804
#define GLUT_OVERLAY_DAMAGED        805

#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
/* glutVideoResizeGet parameters. */
#define GLUT_VIDEO_RESIZE_POSSIBLE    900
#define GLUT_VIDEO_RESIZE_IN_USE    901
#define GLUT_VIDEO_RESIZE_X_DELTA    902
#define GLUT_VIDEO_RESIZE_Y_DELTA    903
#define GLUT_VIDEO_RESIZE_WIDTH_DELTA    904
#define GLUT_VIDEO_RESIZE_HEIGHT_DELTA    905
#define GLUT_VIDEO_RESIZE_X        906
#define GLUT_VIDEO_RESIZE_Y        907
#define GLUT_VIDEO_RESIZE_WIDTH        908
#define GLUT_VIDEO_RESIZE_HEIGHT    909
#endif

/* glutUseLayer parameters. */
#define GLUT_NORMAL            0
#define GLUT_OVERLAY            1

/* glutGetModifiers return mask. */
#define GLUT_ACTIVE_SHIFT               1
#define GLUT_ACTIVE_CTRL                2
#define GLUT_ACTIVE_ALT                 4

/* glutSetCursor parameters. */
/* Basic arrows. */
#define GLUT_CURSOR_RIGHT_ARROW        0
#define GLUT_CURSOR_LEFT_ARROW        1
/* Symbolic cursor shapes. */
#define GLUT_CURSOR_INFO        2
#define GLUT_CURSOR_DESTROY        3
#define GLUT_CURSOR_HELP        4
#define GLUT_CURSOR_CYCLE        5
#define GLUT_CURSOR_SPRAY        6
#define GLUT_CURSOR_WAIT        7
#define GLUT_CURSOR_TEXT        8
#define GLUT_CURSOR_CROSSHAIR        9
/* Directional cursors. */
#define GLUT_CURSOR_UP_DOWN        10
#define GLUT_CURSOR_LEFT_RIGHT        11
/* Sizing cursors. */
#define GLUT_CURSOR_TOP_SIDE        12
#define GLUT_CURSOR_BOTTOM_SIDE        13
#define GLUT_CURSOR_LEFT_SIDE        14
#define GLUT_CURSOR_RIGHT_SIDE        15
#define GLUT_CURSOR_TOP_LEFT_CORNER    16
#define GLUT_CURSOR_TOP_RIGHT_CORNER    17
#define GLUT_CURSOR_BOTTOM_RIGHT_CORNER    18
#define GLUT_CURSOR_BOTTOM_LEFT_CORNER    19
/* Inherit from parent window. */
#define GLUT_CURSOR_INHERIT        100
/* Blank cursor. */
#define GLUT_CURSOR_NONE        101
/* Fullscreen crosshair (if available). */
#define GLUT_CURSOR_FULL_CROSSHAIR    102
#endif

/* GLUT initialization sub-API. */
extern void APIENTRY glutInit(int *argcp, char **argv);
extern void APIENTRY glutInitDisplayMode(unsigned int mode);
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
extern void APIENTRY glutInitDisplayString(const char *string);
#endif
extern void APIENTRY glutInitWindowPosition(int x, int y);
extern void APIENTRY glutInitWindowSize(int width, int height);
extern void APIENTRY glutMainLoop(void);

/* GLUT window sub-API. */
extern int APIENTRY glutCreateWindow(const char *title);
extern int APIENTRY glutCreateSubWindow(int win, int x, int y, int width, int height);
extern void APIENTRY glutDestroyWindow(int win);
extern void APIENTRY glutPostRedisplay(void);
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
extern void APIENTRY glutPostWindowRedisplay(int win);
#endif
extern void APIENTRY glutSwapBuffers(void);
extern int APIENTRY glutGetWindow(void);
extern void APIENTRY glutSetWindow(int win);
extern void APIENTRY glutSetWindowTitle(const char *title);
extern void APIENTRY glutSetIconTitle(const char *title);
extern void APIENTRY glutPositionWindow(int x, int y);
extern void APIENTRY glutReshapeWindow(int width, int height);
extern void APIENTRY glutPopWindow(void);
extern void APIENTRY glutPushWindow(void);
extern void APIENTRY glutIconifyWindow(void);
extern void APIENTRY glutShowWindow(void);
extern void APIENTRY glutHideWindow(void);
#if (GLUT_API_VERSION >= 3)
extern void APIENTRY glutFullScreen(void);
extern void APIENTRY glutSetCursor(int cursor);
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
extern void APIENTRY glutWarpPointer(int x, int y);
#endif

/* GLUT overlay sub-API. */
extern void APIENTRY glutEstablishOverlay(void);
extern void APIENTRY glutRemoveOverlay(void);
extern void APIENTRY glutUseLayer(GLenum layer);
extern void APIENTRY glutPostOverlayRedisplay(void);
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
extern void APIENTRY glutPostWindowOverlayRedisplay(int win);
#endif
extern void APIENTRY glutShowOverlay(void);
extern void APIENTRY glutHideOverlay(void);
#endif

/* GLUT menu sub-API. */
extern int APIENTRY glutCreateMenu(void (*)(int));
extern void APIENTRY glutDestroyMenu(int menu);
extern int APIENTRY glutGetMenu(void);
extern void APIENTRY glutSetMenu(int menu);
extern void APIENTRY glutAddMenuEntry(const char *label, int value);
extern void APIENTRY glutAddSubMenu(const char *label, int submenu);
extern void APIENTRY glutChangeToMenuEntry(int item, const char *label, int value);
extern void APIENTRY glutChangeToSubMenu(int item, const char *label, int submenu);
extern void APIENTRY glutRemoveMenuItem(int item);
extern void APIENTRY glutAttachMenu(int button);
extern void APIENTRY glutDetachMenu(int button);

/* GLUT  sub-API. */
extern void APIENTRY glutDisplayFunc(void (*)(void));
extern void APIENTRY glutReshapeFunc(void (*)(int width, int height));
extern void APIENTRY glutKeyboardFunc(void (*)(unsigned char key, int x, int y));
extern void APIENTRY glutMouseFunc(void (*)(int button, int state, int x, int y));
extern void APIENTRY glutMotionFunc(void (*)(int x, int y));
extern void APIENTRY glutPassiveMotionFunc(void (*)(int x, int y));
extern void APIENTRY glutEntryFunc(void (*)(int state));
extern void APIENTRY glutVisibilityFunc(void (*)(int state));
extern void APIENTRY glutIdleFunc(void (*)(void));
extern void APIENTRY glutTimerFunc(unsigned int millis, void (*)(int value), int value);
extern void APIENTRY glutMenuStateFunc(void (*)(int state));
#if (GLUT_API_VERSION >= 2)
extern void APIENTRY glutSpecialFunc(void (*)(int key, int x, int y));
extern void APIENTRY glutSpaceballMotionFunc(void (*)(int x, int y, int z));
extern void APIENTRY glutSpaceballRotateFunc(void (*)(int x, int y, int z));
extern void APIENTRY glutSpaceballButtonFunc(void (*)(int button, int state));
extern void APIENTRY glutButtonBoxFunc(void (*)(int button, int state));
extern void APIENTRY glutDialsFunc(void (*)(int dial, int value));
extern void APIENTRY glutTabletMotionFunc(void (*)(int x, int y));
extern void APIENTRY glutTabletButtonFunc(void (*)(int button, int state, int x, int y));
#if (GLUT_API_VERSION >= 3)
extern void APIENTRY glutMenuStatusFunc(void (*)(int status, int x, int y));
extern void APIENTRY glutOverlayDisplayFunc(void (*)(void));
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
extern void APIENTRY glutWindowStatusFunc(void (*)(int state));
#endif
#endif
#endif

/* GLUT color index sub-API. */
extern void APIENTRY glutSetColor(int, GLfloat red, GLfloat green, GLfloat blue);
extern GLfloat APIENTRY glutGetColor(int ndx, int component);
extern void APIENTRY glutCopyColormap(int win);

/* GLUT state retrieval sub-API. */
extern int APIENTRY glutGet(GLenum type);
extern int APIENTRY glutDeviceGet(GLenum type);
#if (GLUT_API_VERSION >= 2)
/* GLUT extension support sub-API */
extern int APIENTRY glutExtensionSupported(const char *name);
#endif
#if (GLUT_API_VERSION >= 3)
extern int APIENTRY glutGetModifiers(void);
extern int APIENTRY glutLayerGet(GLenum type);
#endif

/* GLUT font sub-API */
extern void APIENTRY glutBitmapCharacter(void *font, int character);
extern int APIENTRY glutBitmapWidth(void *font, int character);
extern void APIENTRY glutStrokeCharacter(void *font, int character);
extern int APIENTRY glutStrokeWidth(void *font, int character);
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
extern int APIENTRY glutBitmapLength(void *font, const unsigned char *string);
extern int APIENTRY glutStrokeLength(void *font, const unsigned char *string);
#endif

/* GLUT pre-built models sub-API */
extern void APIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks);
extern void APIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks);
extern void APIENTRY glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
extern void APIENTRY glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
extern void APIENTRY glutWireCube(GLdouble size);
extern void APIENTRY glutSolidCube(GLdouble size);
extern void APIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
extern void APIENTRY glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
extern void APIENTRY glutWireDodecahedron(void);
extern void APIENTRY glutSolidDodecahedron(void);
extern void APIENTRY glutWireTeapot(GLdouble size);
extern void APIENTRY glutSolidTeapot(GLdouble size);
extern void APIENTRY glutWireOctahedron(void);
extern void APIENTRY glutSolidOctahedron(void);
extern void APIENTRY glutWireTetrahedron(void);
extern void APIENTRY glutSolidTetrahedron(void);
extern void APIENTRY glutWireIcosahedron(void);
extern void APIENTRY glutSolidIcosahedron(void);

#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
/* GLUT video resize sub-API. */
extern int APIENTRY glutVideoResizeGet(GLenum param);
extern void APIENTRY glutSetupVideoResizing(void);
extern void APIENTRY glutStopVideoResizing(void);
extern void APIENTRY glutVideoResize(int x, int y, int width, int height);
extern void APIENTRY glutVideoPan(int x, int y, int width, int height);

/* GLUT debugging sub-API. */
extern void APIENTRY glutReportErrors(void);
#endif

#ifdef __cplusplus
}

#endif
#endif                  /* __glut_h__ */


text:
echo "INTEGER REGRESSION"
python examples/integer_regression.py
echo "LEAKY RELU"
python examples/leaky_relu.py
echo "ODD"
python examples/odd.py
echo "POINT DISTANCE"
python examples/point_distance.py
echo "STRING DEMO (GA)"
python examples/string_demo.py
echo "STRING DEMO (SA)"
python examples/string_demo_annealing.py


text:
[Back to Overview](https://github.com/BRO-FHV/docs/blob/master/README.md)
## The Client
Below you can find an overview over the basic workflow of a client/application program. The client program uses the api_* methods of the library which itself calls the syscall method and results in a software interrupt in our OS.

![alt tag](https://raw.github.com/BRO-FHV/docs/master/images/Cilent_Library_Kernel_Interaction.png)

### Software Interrupt
The processes loaded by elf use software interrupts to communicate with the operating system. Therefore we implemented a small library for our so called client. This library provides a console output and access/control to the onboard LEDs, GPIO and Ethernet (limited to UDP). Below you can find an example for printing text onto the console.

```C
/**
 * Print function alias for standard printf
 */
void lib_print(const char* format, ...) {
	char parsed[API_PRINTF_MAXLENGTH];
	va_list args;
	va_start(args, format);
	vsprintf(parsed, format, args);
	va_end(args);

	SyscallArgData data;
	data.swiNumber = SYSCALL_PRINTF;
	data.arg1 = (uint32_t) & parsed;

	Syscall(&data);
}
```

The abstraction layer provided by the library uses the following struct to communicate with the OS and supports five arguments and two return values.

```C
typedef struct SyscallArg
{
    uint32_t swiNumber;
    uint32_t arg1;
    uint32_t arg2;
    uint32_t arg3;
    uint32_t arg4;
    uint32_t arg5;
    uint32_t result;
    uint32_t result2;
} SyscallArgData;

#pragma SWI_ALIAS(Syscall, 1)
extern void Syscall(SyscallArgData* data);
```

The software handler of the operating system processes the incomming syscalls caused by the software interrupts and forwards them to the target components of the os.

```C
void SwiForward(SyscallArgData* data) {

	uint32_t result = -1;
	void* resultPointer=NULL;

	switch (data->swiNumber) {

	case SYSCALL_PRINTF:
		SwiStdioPrintf((const char*) data->arg1);
		break;
	case SYSCALL_LED_ON_0:
		SwiLed0On();
		break;
		...
```


text:
package com.akexorcist.deviceinformation.collector.hardwaresoftware.model;

import com.akexorcist.deviceinformation.common.BaseInfo;
import com.google.gson.annotations.SerializedName;

/**
 * Created by Akexorcist on 11/22/2016 AD.
 */

public class BuildInfo extends BaseInfo {
    @SerializedName("Board")
    private String board;
    @SerializedName("Bootloader")
    private String bootloader;
    @SerializedName("Brand")
    private String brand;
    @SerializedName("Characteristic")
    private String characteristic;
    @SerializedName("CPU ABI")
    private String cpuAbi;
    @SerializedName("CPU ABI 2")
    private String cpuAbi2;
    @SerializedName("Device")
    private String device;
    @SerializedName("Display")
    private String display;
    @SerializedName("Fingerprint")
    private String fingerprint;
    @SerializedName("Hardware")
    private String hardware;
    @SerializedName("Host")
    private String host;
    @SerializedName("ID")
    private String id;
    @SerializedName("Manufacturer")
    private String manufacturer;
    @SerializedName("Model")
    private String model;
    @SerializedName("Product")
    private String product;
    @SerializedName("Radio")
    private String radio;
    @SerializedName("Serial")
    private String serial;
    @SerializedName("Supported ABIS")
    private String supportedAbis;
    @SerializedName("Supported 32-bit ABIS")
    private String supported32BitAbis;
    @SerializedName("Supported 64-bit ABIS")
    private String supported64BitAbis;
    @SerializedName("Tags")
    private String tags;
    @SerializedName("Time")
    private String time;
    @SerializedName("Type")
    private String type;
    @SerializedName("User")
    private String user;

    public BuildInfo() {
    }

    public String getBoard() {
        return board;
    }

    public BuildInfo setBoard(String board) {
        this.board = board;
        return this;
    }

    public String getBootloader() {
        return bootloader;
    }

    public BuildInfo setBootloader(String bootloader) {
        this.bootloader = bootloader;
        return this;
    }

    public String getBrand() {
        return brand;
    }

    public BuildInfo setBrand(String brand) {
        this.brand = brand;
        return this;
    }

    public String getCharacteristic() {
        return characteristic;
    }

    public BuildInfo setCharacteristic(String characteristic) {
        this.characteristic = characteristic;
        return this;
    }

    public String getCpuAbi() {
        return cpuAbi;
    }

    public BuildInfo setCpuAbi(String cpuAbi) {
        this.cpuAbi = cpuAbi;
        return this;
    }

    public String getCpuAbi2() {
        return cpuAbi2;
    }

    public BuildInfo setCpuAbi2(String cpuAbi2) {
        this.cpuAbi2 = cpuAbi2;
        return this;
    }

    public String getDevice() {
        return device;
    }

    public BuildInfo setDevice(String device) {
        this.device = device;
        return this;
    }

    public String getDisplay() {
        return display;
    }

    public BuildInfo setDisplay(String display) {
        this.display = display;
        return this;
    }

    public String getFingerprint() {
        return fingerprint;
    }

    public BuildInfo setFingerprint(String fingerprint) {
        this.fingerprint = fingerprint;
        return this;
    }

    public String getHardware() {
        return hardware;
    }

    public BuildInfo setHardware(String hardware) {
        this.hardware = hardware;
        return this;
    }

    public String getHost() {
        return host;
    }

    public BuildInfo setHost(String host) {
        this.host = host;
        return this;
    }

    public String getId() {
        return id;
    }

    public BuildInfo setId(String id) {
        this.id = id;
        return this;
    }

    public String getManufacturer() {
        return manufacturer;
    }

    public BuildInfo setManufacturer(String manufacturer) {
        this.manufacturer = manufacturer;
        return this;
    }

    public String getModel() {
        return model;
    }

    public BuildInfo setModel(String model) {
        this.model = model;
        return this;
    }

    public String getProduct() {
        return product;
    }

    public BuildInfo setProduct(String product) {
        this.product = product;
        return this;
    }

    public String getRadio() {
        return radio;
    }

    public BuildInfo setRadio(String radio) {
        this.radio = radio;
        return this;
    }

    public String getSerial() {
        return serial;
    }

    public BuildInfo setSerial(String serial) {
        this.serial = serial;
        return this;
    }

    public String getSupportedAbis() {
        return supportedAbis;
    }

    public BuildInfo setSupportedAbis(String supportedAbis) {
        this.supportedAbis = supportedAbis;
        return this;
    }

    public String getSupported32BitAbis() {
        return supported32BitAbis;
    }

    public BuildInfo setSupported32BitAbis(String supported32BitAbis) {
        this.supported32BitAbis = supported32BitAbis;
        return this;
    }

    public String getSupported64BitAbis() {
        return supported64BitAbis;
    }

    public BuildInfo setSupported64BitAbis(String supported64BitAbis) {
        this.supported64BitAbis = supported64BitAbis;
        return this;
    }

    public String getTags() {
        return tags;
    }

    public BuildInfo setTags(String tags) {
        this.tags = tags;
        return this;
    }

    public String getTime() {
        return time;
    }

    public BuildInfo setTime(String time) {
        this.time = time;
        return this;
    }

    public String getType() {
        return type;
    }

    public BuildInfo setType(String type) {
        this.type = type;
        return this;
    }

    public String getUser() {
        return user;
    }

    public BuildInfo setUser(String user) {
        this.user = user;
        return this;
    }
}


text:
#region S# License

#endregion S# License
namespace StockSharp.Algo.Indicators
{
	using System.ComponentModel;

	using Ecng.Serialization;

	using StockSharp.Localization;

	/// <summary>
	/// The full class of linear regression, calculates LinearReg, LinearRegSlope, RSquared and StandardError at the same time.
	/// </summary>
	[DisplayName("LinearRegression")]
	[DescriptionLoc(LocalizedStrings.Str735Key)]
	public class LinearRegression : BaseComplexIndicator
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="LinearRegression"/>.
		/// </summary>
		public LinearRegression()
			: this(new LinearReg(), new RSquared(), new LinearRegSlope(), new StandardError())
		{
			Length = 11;
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="LinearRegression"/>.
		/// </summary>
		/// <param name="linearReg">Linear regression.</param>
		/// <param name="rSquared">Regression R-squared.</param>
		/// <param name="regSlope">Coefficient with independent variable, slope of a straight line.</param>
		/// <param name="standardError">Standard error.</param>
		public LinearRegression(LinearReg linearReg, RSquared rSquared, LinearRegSlope regSlope, StandardError standardError)
			: base(linearReg, rSquared, regSlope, standardError)
		{
			LinearReg = linearReg;
			RSquared = rSquared;
			LinearRegSlope = regSlope;
			StandardError = standardError;

			Mode = ComplexIndicatorModes.Parallel;
		}

		/// <summary>
		/// Period length.
		/// </summary>
		[DisplayNameLoc(LocalizedStrings.Str736Key)]
		[DescriptionLoc(LocalizedStrings.Str737Key)]
		[CategoryLoc(LocalizedStrings.GeneralKey)]
		public int Length
		{
			get { return LinearReg.Length; }
			set
			{
				LinearReg.Length = RSquared.Length = LinearRegSlope.Length = StandardError.Length = value;
				Reset();
			}
		}

		/// <summary>
		/// Linear regression.
		/// </summary>
		[TypeConverter(typeof(ExpandableObjectConverter))]
		[DisplayName("LinearReg")]
		[DescriptionLoc(LocalizedStrings.Str738Key)]
		[CategoryLoc(LocalizedStrings.GeneralKey)]
		public LinearReg LinearReg { get; }

		/// <summary>
		/// Regression R-squared.
		/// </summary>
		[TypeConverter(typeof(ExpandableObjectConverter))]
		[DisplayName("RSquared")]
		[DescriptionLoc(LocalizedStrings.Str739Key)]
		[CategoryLoc(LocalizedStrings.GeneralKey)]
		public RSquared RSquared { get; }

		/// <summary>
		/// Standard error.
		/// </summary>
		[TypeConverter(typeof(ExpandableObjectConverter))]
		[DisplayName("StdErr")]
		[DescriptionLoc(LocalizedStrings.Str740Key)]
		[CategoryLoc(LocalizedStrings.GeneralKey)]
		public StandardError StandardError { get; }

		/// <summary>
		/// Coefficient with independent variable, slope of a straight line.
		/// </summary>
		[TypeConverter(typeof(ExpandableObjectConverter))]
		[DisplayName("LinearRegSlope")]
		[DescriptionLoc(LocalizedStrings.Str741Key)]
		[CategoryLoc(LocalizedStrings.GeneralKey)]
		public LinearRegSlope LinearRegSlope { get; }

		/// <summary>
		/// Load settings.
		/// </summary>
		/// <param name="settings">Settings storage.</param>
		public override void Load(SettingsStorage settings)
		{
			base.Load(settings);
			Length = settings.GetValue<int>(nameof(Length));
		}

		/// <summary>
		/// Save settings.
		/// </summary>
		/// <param name="settings">Settings storage.</param>
		public override void Save(SettingsStorage settings)
		{
			base.Save(settings);
			settings.SetValue(nameof(Length), Length);
		}
	}
}


text:
Person::Person(float health, float speed, float damage, int width, int height, unsigned int textureID, b2World * world) : B2Entity::B2Entity(width, height, textureID, world)
{
	// Initialze variables
	this->currentHealth = health;
	this->maxHealth = health;
	this->speed = speed;
	this->damage = damage;
}

Person::~Person()
{
}

void Person::Damage(float damage)
{
	if (currentHealth - damage > 0.0f) {
		currentHealth -= damage;
	}
	else {
		currentHealth = 0.0f;
	}
}

bool Person::IsAlive()
{
	if (currentHealth > 0.0f) {
		return true;
	}
	return false;
}


text:
<?php

/*
 * GENERATED CODE WARNING
 * Generated by gapic-generator-php from the file
 * https://github.com/googleapis/googleapis/blob/master/google/ads/googleads/v10/services/ad_group_customizer_service.proto
 * Updates to the above are reflected here through a refresh process.
 */

namespace Google\Ads\GoogleAds\V10\Services;

use Google\Ads\GoogleAds\Lib\V10\GoogleAdsGapicClientTrait;
use Google\Ads\GoogleAds\V10\Services\Gapic\AdGroupCustomizerServiceGapicClient;

/** {@inheritdoc} */
class AdGroupCustomizerServiceClient extends AdGroupCustomizerServiceGapicClient
{
    use GoogleAdsGapicClientTrait;
}


text:
<!DOCTYPE html>

  <title>story.js</title>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
  <link rel="stylesheet" media="all" href="docco.css" />

          Jump To …
          +

                friends.js

                init.js

                notifications.js

                setMsg.js

                story.js

                trip.js

                liftapp.js

                locate.js

                marker.js

                directions.js

                initialise.js

                styles.js

                helper.js

                plugins.js

                coordinates.js

                friends.js

                invitees.js

                marker.js

                message.js

                notifications.js

                trip.js

                ui.js

                jquery.mobile-1.4.2.js

                jquery.mobile-1.4.2.min.js

                modernizr-2.6.2.min.js

                zepto.min.js

story.js

                ¶

                ¶

LiftApp

App control methods

if (typeof LA === "undefined" || !LA )
	window.LA = {};

if (typeof LA.controller === "undefined" || !LA.controller)
	window.LA.controller = {};

                ¶

Initialise the application

                ¶

LA.controller.story = {

                ¶

Get the starting point of the trip

                ¶

1) Set your starting location

		askForStartLocation : function () {

			var
			startLocationListener,
			UI = LA.store.ui;

                ¶

Set the user messages

			$( UI.instruct_panel ).html( '<h4>' + LA.store.message.story.step1 + '</h4>' );
			$.mobile.resetActivePageHeight();

                ¶

Add map listener to get the location requested

			startLocationListener = google.maps.event.addListener( LA.map, 'click', function(event) {
				google.maps.event.removeListener( startLocationListener );

				$( '<div data-role="navbar"><ul><li><a href="#" class="Y">Confirm</a></li><li><a href="#" class="N">Cancel</a></li></ul></div>' )
					.prependTo( UI.instruct_panel )
					.navbar();

                ¶

Update the page height and padding

				$.mobile.resetActivePageHeight();

				setTriggers( $( UI.instruct_panel ).find('.Y'), $( UI.instruct_panel ).find('.N') );

                ¶

Clear any saved marker for this

				if ( LA.store.coordinates.startLocation !== null)
					LA.store.coordinates.startLocation.setMap(null);

                ¶

Add marker for the last clicked/tapped location

				LA.store.coordinates.startLocation = LA.locations.marker.placeMarker( event.latLng, LA.store.marker.icon.startPoint );

				LA.store.coordinates.startLocation.lat = event.latLng.lat();
				LA.store.coordinates.startLocation.lon = event.latLng.lng();
			});

			function setTriggers ( yes_btn, no_btn ) {

                ¶

Location is confirmed, move to next step

				yes_btn.one('click', function(event) {
					event.preventDefault();

					if ( LA.store.coordinates.startLocation !== null){

						window.setTimeout(function() {
							LA.controller.story.askForDestinationLocation();
						}, 20);

					}

				});

                ¶

Location is cancelled, remove the marker and wait for new selection

				no_btn.one('click', function(event) {
					event.preventDefault();

					LA.store.coordinates.startLocation.setMap(null);

					LA.controller.story.askForStartLocation();

				});
			}

		},

                ¶

Get the destination point of the trip

                ¶

		askForDestinationLocation : function () {

			var
			destinationLocationListener,
			UI = LA.store.ui;

                ¶

Set the user messages

			$( UI.instruct_panel ).html( '<h4>' + LA.store.message.story.step2 + '</h4>' );
			$( UI.instruct_panel ).toolbar( "refresh" );

                ¶

Add map listener to get the location requested

			destinationLocationListener = google.maps.event.addListener( LA.map, 'click', function(event) {
				google.maps.event.removeListener( destinationLocationListener );

				$( '<div data-role="navbar"><ul><li><a href="#" class="Y">Confirm</a></li><li><a href="#" class="N">Cancel</a></li></ul></div>' )
					.prependTo( UI.instruct_panel )
					.navbar();

                ¶

Update the page height and padding

				$.mobile.resetActivePageHeight();

                ¶

These are added dynamically so we need to find them

				setTriggers( $( UI.instruct_panel ).find('.Y'), $( UI.instruct_panel ).find('.N') );

                ¶

Clear any saved marker for this

				if ( LA.store.coordinates.endLocation !== null)
					LA.store.coordinates.endLocation.setMap(null);

                ¶

Add marker for the last clicked/tapped location

				LA.store.coordinates.endLocation = LA.locations.marker.placeMarker( event.latLng, LA.store.marker.icon.endPoint );
				LA.store.coordinates.endLocation.lat = event.latLng.lat();
				LA.store.coordinates.endLocation.lon = event.latLng.lng();

			});

			function setTriggers ( yes_btn, no_btn ) {

                ¶

Destination is confirmed, move to next step

				yes_btn.one('click', function(event) {
					event.preventDefault();

					if ( LA.store.coordinates.endLocation !== null){

						window.setTimeout(function() {
							LA.controller.story.getARoute( LA.store.coordinates.startLocation, LA.store.coordinates.endLocation );
						}, 300);

					}

				});

                ¶

Location is cancelled, remove the marker and wait for new selection

				no_btn.one('click', function(event) {
					event.preventDefault();

					LA.store.coordinates.endLocation.setMap(null);

					LA.controller.story.askForDestinationLocation();

				});
			}

		},

                ¶

Find a route from A to B

                ¶

		getARoute : function ( pointA, pointB ) {

			var
			UI = LA.store.ui,
			directionsService = new google.maps.DirectionsService(),
			directionsDisplay = new google.maps.DirectionsRenderer({ polylineOptions: LA.maps.directions.style.polylineOpts });
			directionRequest = {
				origin: pointA.position,
				destination: pointB.position,
				travelMode: google.maps.TravelMode.DRIVING,
				provideRouteAlternatives: true
			};

                ¶

Set the user messages

			$( UI.instruct_panel ).html( '<h4>' + LA.store.message.directions.getting + '</h4>' );
			$( UI.instruct_panel ).toolbar( "refresh" );

			directionsDisplay.setMap(LA.map);

			directionsService.route(directionRequest, function(response, status) {

                ¶

Set the user messages

				$( UI.instruct_panel ).html( '<h4>' + LA.store.message.friends.pick + '</h4>' )
					.prepend('<a href="#" id="submit" class="ui-btn-right ui-btn ui-btn-inline ui-mini ui-corner-all ui-btn-icon-right ui-icon-check">Save Trip</a>')
					.toolbar( "refresh" );

                ¶

Update the page height and padding

				$.mobile.resetActivePageHeight();

				if ( status == google.maps.DirectionsStatus.OK )
					directionsDisplay.setDirections( response );

				if ( typeof response.routes[0].overview_polyline.points !== 'undefined' )
					LA.store.trip.polyline = response.routes[0].overview_polyline.points;

                ¶

Put friends on the map

				LA.controller.friends.showFriends();

                ¶

TODO - move this

				LA.controller.story.doTripSubmit();

			});

		},

                ¶

ToDo - get date and time

                ¶

Get the name of the destination

                ¶

Get the message to send with the invitation

                ¶

Get the number of free seats

		doTripSubmit : function () {

			$('#submit').on( "click", function( event ) {
				event.preventDefault();

                ¶

Put the JS objects in the hidden form fields

				LA.controller.trip.updateTripForm();

				$( "form" ).submit();
			});

		},

                ¶

Start the story

                ¶

		init : function () {
			LA.controller.story.askForStartLocation();
		}

};


text:
class Foo {

    public String toString() {
        Foo bar;
        String f = bar.toString();<caret>
    }

}


text:
class AddColumnToSites < ActiveRecord::Migration
  def up
  	add_column :sites, :room_type_id, :integer, :null => false, :default => 0
  end

  def down
  	remove_column :sites, :room_type_id
  end
end


text:
using System;
using OrgChart.Annotations;

namespace OrgChart.Layout
{
    /// <summary>
    /// A visual connector between two or more objects.
    /// </summary>
    public class Connector
    {
        /// <summary>
        /// Ctr.
        /// </summary>
        public Connector([NotNull]Edge[] segments)
        {
            if (segments.Length == 0)
            {
                throw new ArgumentException("Need at least one segment", nameof(Segments));
            }
            Segments = segments;
        }

        /// <summary>
        /// All individual segments of a connector, sorted from beginning to end.
        /// </summary>
        [NotNull]
        public Edge[] Segments { get; }
    }
}