text:
using MVVM.ViewModel;
using System.Windows;

namespace MVVM.View
{
public partial class ScheduleView
{
    public ScheduleView()
    {
        InitializeComponent();
        string sdp = (string)Application.Current.Properties["sdp"];
        if (sdp.StartsWith("d"))
        {
            datePickerSched.Visibility = System.Windows.Visibility.Hidden;
            Datebox2.Visibility = System.Windows.Visibility.Visible;
            DateboxLbl2.Visibility = System.Windows.Visibility.Visible;
        }
    }

    // Kind of a drag that we have to put these next 2 methods in here, but PasswordBox is not a dependency property,
    // so we can't bind to the model.  Doing this for now -- should probably use an attached property later
    private ScheduleViewModel ViewModel {
        get { return DataContext as ScheduleViewModel; }
    }
    private void pb_DefPasswordChanged(object sender, RoutedEventArgs e)
    {
        ViewModel.DefaultPWD = ipwBox.Password;
    }
}
}


text:
using System;
using System.Linq;
using System.Reflection;
using Elasticsearch.Net;
using FluentAssertions;
using Nest;
using Tests.Framework;
using Newtonsoft.Json;
using System.Collections.Generic;

namespace Tests.CodeStandards.Serialization
{
	public class Converters
	{
		[U]
		public void CustomConvertersShouldBeInternal()
		{
			var converters = typeof(IElasticClient).Assembly().GetTypes()
				.Where(t => typeof(JsonConverter).IsAssignableFrom(t))
				.ToList();
			var visible = new List<string>();
			foreach (var converter in converters)
			{
				if (converter.IsVisible())
					visible.Add(converter.Name);
			}
			visible.Should().BeEmpty();
		}
	}
}

redpajama_set_name: RedPajamaGithub


text:
FROM alpine:edge
MAINTAINER iaroki
RUN apk --update --no-cache add speedtest-cli
RUN adduser -D iaroki
USER iaroki
ENTRYPOINT ["speedtest"]


text: export * from './components/index';


text:
<resources>
    <string name="app_name">Call Log Manager</string>
</resources>


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright 2015 TweetMap All Right Reserved.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:padding="0dp"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".StationSearchActivity" >

    <!-- ToolBar -->
    <android.support.v7.widget.Toolbar
        android:id="@+id/activity_search_tool_bar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:minHeight="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        android:elevation="2dp"
        android:textSize="14dp"
        app:theme="@style/toolbarTheme"
        app:popupTheme="@style/toolbarMenuTheme">

        <EditText
            android:id="@+id/edit_search"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@android:color/transparent"
            android:inputType="text"
            android:imeOptions="actionSearch"
            android:hint="@string/search_hint"
            android:textColorHint="@color/ghost_white">
            <requestFocus />
        </EditText>
    </android.support.v7.widget.Toolbar >

    <ListView
        android:id="@+id/station_list"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    </ListView>

</LinearLayout>


text:
```cpp
auto operator -=(const integer &v) -> integer &;
```

Subtracts `v` (right hand side of the operator) from the value of this object (left hand side of the operator).

### Return Value ###

A reference to this object (left hand side of the operator).

### Exceptions ###

* `std::bad_alloc` in the event of a memory allocation failure.

## See Also ##

* [class integer](c8_integer)
* [c8 library](c8)


text:
package commandevaluators

/**
ASSUMPTIONS:

a) there is only 1 DSP in a given room

b) microphones only have one port configuration and the DSP is the destination device

c) room-wide requests do not affect microphones

d) media devices connected to the DSP have the role "AudioOut"

**/

import (
	"errors"
	"fmt"

	"github.com/byuoitav/common/log"

	"github.com/byuoitav/av-api/base"
	"github.com/byuoitav/common/db"
	"github.com/byuoitav/common/structs"
	"github.com/byuoitav/common/v2/events"
)

// UnMuteDSP implements the CommandEvaluator struct/
type UnMuteDSP struct{}

// Evaluate generates a list of actions based on the given room information.
func (p *UnMuteDSP) Evaluate(dbRoom structs.Room, room base.PublicRoom, requestor string) ([]base.ActionStructure, int, error) {

	log.L.Info("[command_evaluators] Evaluating PUT body for UNMUTE command in DSP context...")

	var actions []base.ActionStructure

	eventInfo := events.Event{
		Key:   "muted",
		Value: "false",
		User:  requestor,
	}

	eventInfo.AddToTags(events.CoreState, events.UserGenerated)

	eventInfo.AffectedRoom = events.GenerateBasicRoomInfo(fmt.Sprintf("%s-%s", room.Building, room.Room))

	if room.Muted != nil && !(*room.Muted) {

		generalActions, err := GetGeneralUnMuteRequestActionsDSP(dbRoom, room, eventInfo)
		if err != nil {
			errorMessage := "[command_evaluators] Could not generate actions for room-wide \"UnMute\" request: " + err.Error()
			log.L.Error(errorMessage)
			return []base.ActionStructure{}, 0, errors.New(errorMessage)
		}

		actions = append(actions, generalActions...)
	}

	if len(room.AudioDevices) > 0 {

		for _, audioDevice := range room.AudioDevices {

			if audioDevice.Muted != nil && !(*audioDevice.Muted) {

				deviceID := fmt.Sprintf("%v-%v-%v", room.Building, room.Room, audioDevice.Name)
				device := FindDevice(dbRoom.Devices, deviceID)

				if structs.HasRole(device, "Microphone") {

					action, err := GetMicUnMuteAction(dbRoom, device, room, eventInfo)
					if err != nil {
						return []base.ActionStructure{}, 0, err
					}

					actions = append(actions, action)

				} else if structs.HasRole(device, "DSP") {

					action, err := GetDSPMediaUnMuteAction(dbRoom, device, room, eventInfo, true)
					if err != nil {
						return []base.ActionStructure{}, 0, err
					}

					actions = append(actions, action...)

				} else if structs.HasRole(device, "AudioOut") {

					action, err := GetDisplayUnMuteAction(device, room, eventInfo, true)
					if err != nil {
						return []base.ActionStructure{}, 0, err
					}

					actions = append(actions, action)

					////////////////////////
					///// MIRROR STUFF /////
					if structs.HasRole(device, "MirrorMaster") {
						for _, port := range device.Ports {
							if port.ID == "mirror" {
								DX, err := db.GetDB().GetDevice(port.DestinationDevice)
								if err != nil {
									return actions, len(actions), err
								}

								cmd := DX.GetCommandByID("UnMuteDSP")
								if len(cmd.ID) < 1 {
									continue
								}

								log.L.Info("[command_evaluators] Adding mirror device %+v", DX.Name)

								action, err := GetDisplayUnMuteAction(DX, room, eventInfo, true)
								if err != nil {
									return actions, len(actions), err
								}

								actions = append(actions, action)
							}
						}
					}
					///// MIRROR STUFF /////
					////////////////////////

				} else { //bad device
					errorMessage := "[command_evaluators] Cannot set volume of device " + device.Name
					log.L.Error(errorMessage)
					return []base.ActionStructure{}, 0, errors.New(errorMessage)
				}
			}
		}
	}

	log.L.Infof("[command_evaluators] %s actions generated.", len(actions))
	log.L.Info("[command_evaluators] Evaluation complete.")

	return actions, len(actions), nil
}

// Validate verified that the action information is correct.
func (p *UnMuteDSP) Validate(base.ActionStructure) error {
	//TODO make sure the device actually can be muted
	return nil
}

// GetIncompatibleCommands determines the list of incompatible commands for this evaluator.
func (p *UnMuteDSP) GetIncompatibleCommands() []string {
	return nil
}

// GetGeneralUnMuteRequestActionsDSP generates a list of actions based on the given room and event information.
//assumes only one DSP, but allows for the possiblity of multiple devices not routed through the DSP
//room-wide mute requests DO NOT include mics
func GetGeneralUnMuteRequestActionsDSP(dbRoom structs.Room, room base.PublicRoom, eventInfo events.Event) ([]base.ActionStructure, error) {

	log.L.Info("[command_evaluators] Generating actions for room-wide \"UnMute\" request")

	var actions []base.ActionStructure

	dsp := FilterDevicesByRole(dbRoom.Devices, "DSP")

	if len(dsp) != 1 {
		errorMessage := "[command_evaluators] Invalid number of DSP devices found in room: " + room.Room + " in building " + room.Building
		log.L.Error(errorMessage)
		return []base.ActionStructure{}, errors.New(errorMessage)
	}

	action, err := GetDSPMediaUnMuteAction(dbRoom, dsp[0], room, eventInfo, false)
	if err != nil {
		errorMessage := "[command_evaluators] Could not generate action corresponding to general mute request in room " + room.Room + ", building " + room.Building + ": " + err.Error()
		log.L.Error(errorMessage)
		return []base.ActionStructure{}, errors.New(errorMessage)
	}

	actions = append(actions, action...)

	audioDevices := FilterDevicesByRole(dbRoom.Devices, "AudioOut")

	for _, device := range audioDevices {
		if structs.HasRole(device, "DSP") {
			continue
		}

		action, err := GetDisplayUnMuteAction(device, room, eventInfo, false)
		if err != nil {
			errorMessage := "[command_evaluators] Could not generate mute action for display " + device.Name + " in room " + room.Room + ", building " + room.Building + ": " + err.Error()
			log.L.Error(errorMessage)
			return []base.ActionStructure{}, errors.New(errorMessage)
		}

		actions = append(actions, action)
	}

	return actions, nil
}

// GetMicUnMuteAction generates an action based on the room, microphone and event information.
//assumes the mic is only connected to a single DSP
func GetMicUnMuteAction(dbRoom structs.Room, mic structs.Device, room base.PublicRoom, eventInfo events.Event) (base.ActionStructure, error) {

	log.L.Infof("[command_evaluators] Generating action for command \"UnMute\" on microphone %s", mic.Name)

	destination := base.DestinationDevice{
		Device:      mic,
		AudioDevice: true,
	}

	//get DSP
	dsps := FilterDevicesByRole(dbRoom.Devices, "DSP")

	if len(dsps) != 1 {
		errorMessage := "[command_evaluators] Invalid DSP configuration detected."
		log.L.Error(errorMessage)
		return base.ActionStructure{}, errors.New(errorMessage)
	}

	dsp := dsps[0]

	parameters := make(map[string]string)
	for _, port := range dsp.Ports {

		if port.SourceDevice == mic.ID {
			parameters["input"] = port.ID

			eventInfo.AffectedRoom = events.GenerateBasicRoomInfo(dbRoom.ID)

			eventInfo.TargetDevice = events.GenerateBasicDeviceInfo(mic.ID)

			return base.ActionStructure{
				Action:              "UnMute",
				GeneratingEvaluator: "UnmuteDSP",
				Device:              dsp,
				DestinationDevice:   destination,
				DeviceSpecific:      true,
				EventLog:            []events.Event{eventInfo},
				Parameters:          parameters,
			}, nil
		}

	}

	return base.ActionStructure{}, errors.New("[command_evaluators] Couldn't find port configuration for mic " + mic.Name)
}

// GetDSPMediaUnMuteAction generates a list of actions based on the room, DSP, and event information.
func GetDSPMediaUnMuteAction(dbRoom structs.Room, dsp structs.Device, room base.PublicRoom, eventInfo events.Event, deviceSpecific bool) ([]base.ActionStructure, error) {
	toReturn := []base.ActionStructure{}

	destination := base.DestinationDevice{
		Device:      dsp,
		AudioDevice: true,
	}

	log.L.Info("[command_evaluators] Generating action for command UnMute on media routed through DSP")

	for _, port := range dsp.Ports {
		parameters := make(map[string]string)

		deviceID := fmt.Sprintf("%v-%v-%v", room.Building, room.Room, port.SourceDevice)
		sourceDevice := FindDevice(dbRoom.Devices, deviceID)

		if structs.HasRole(sourceDevice, "Microphone") {
			continue
		}

		if structs.HasRole(sourceDevice, "AudioOut") || structs.HasRole(sourceDevice, "VideoSwitcher") {

			parameters["input"] = port.ID

			eventInfo.AffectedRoom = events.GenerateBasicRoomInfo(fmt.Sprintf("%s-%s", room.Building, room.Room))

			eventInfo.TargetDevice = events.GenerateBasicDeviceInfo(dsp.ID)

			toReturn = append(toReturn, base.ActionStructure{
				Action:              "UnMute",
				GeneratingEvaluator: "UnmuteDSP",
				Device:              dsp,
				DestinationDevice:   destination,
				DeviceSpecific:      deviceSpecific,
				EventLog:            []events.Event{eventInfo},
				Parameters:          parameters,
			})
		}
	}

	return toReturn, nil
}

// GetDisplayUnMuteAction generates an action based on the display, room, and event information.
func GetDisplayUnMuteAction(device structs.Device, room base.PublicRoom, eventInfo events.Event, deviceSpecific bool) (base.ActionStructure, error) {

	log.L.Infof("[command_evaluators] Generating action for command \"UnMute\" for device %s external to DSP", device.Name)

	eventInfo.AffectedRoom = events.GenerateBasicRoomInfo(fmt.Sprintf("%s-%s", room.Building, room.Room))

	eventInfo.TargetDevice = events.GenerateBasicDeviceInfo(device.ID)

	destination := base.DestinationDevice{
		Device:      device,
		AudioDevice: true,
	}

	if structs.HasRole(device, "VideoOut") {
		destination.Display = true
	}

	return base.ActionStructure{
		Action:              "UnMute",
		GeneratingEvaluator: "UnmuteDSP",
		Device:              device,
		DestinationDevice:   destination,
		DeviceSpecific:      deviceSpecific,
		EventLog:            []events.Event{eventInfo},
	}, nil
}


text:
suite('rb/views/ReviewDialogView', function() {
    var baseEmptyCommentListPayload = {
            stat: 'ok',
            total_results: 0,
            links: {}
        },
        emptyDiffCommentsPayload = _.defaults({
            diff_comments: []
        }, baseEmptyCommentListPayload),
        emptyFileAttachmentCommentsPayload = _.defaults({
            file_attachment_comments: []
        }, baseEmptyCommentListPayload),
        emptyGeneralCommentsPayload = _.defaults({
            general_comments: []
        }, baseEmptyCommentListPayload),
        emptyScreenshotCommentsPayload = _.defaults({
            screenshot_comments: []
        }, baseEmptyCommentListPayload),
        baseCommentPayload = {
            id: 1,
            issue_opened: true,
            issue_status: 'opened',
            text: 'My comment'
        },
        diffCommentPayload = _.defaults({
            first_line: 10,
            num_lines: 5,
            filediff: {
                id: 1,
                source_file: 'my-file',
                dest_file: 'my-file',
                source_revision: '1'
            },
            interfilediff: {
                id: 2,
                source_file: 'my-file',
                dest_file: 'my-file',
                source_revision: '2'
            }
        }, baseCommentPayload),
        fileAttachmentCommentPayload = _.defaults({
            extra_data: {},
            link_text: 'my-link-text',
            thumbnail_html: '<blink>Boo</blink>',
            review_url: '/review-ui/',
            file_attachment: {
                id: 10,
                filename: 'file.txt',
                icon_url: 'data:image/gif;base64,'
            }
        }, baseCommentPayload),
        generalCommentPayload = baseCommentPayload,
        screenshotCommentPayload = _.defaults({
            x: 10,
            y: 20,
            w: 30,
            h: 40,
            thumbnail_url: 'data:image/gif;base64,',
            screenshot: {
                id: 10,
                caption: 'My caption',
                filename: 'image.png',
                review_url: '/review-ui/'
            }
        }, baseCommentPayload),
        origGeneralCommentsEnabled = RB.EnabledFeatures.generalComments,
        reviewRequestEditor,
        review,
        dlg;

    function createReviewDialog() {
        return RB.ReviewDialogView.create({
            review: review,
            container: $testsScratch,
            reviewRequestEditor: reviewRequestEditor
        });
    }

    beforeEach(function() {
        var origMove = $.fn.move,
            reviewRequest = new RB.ReviewRequest({
                summary: 'My Review Request'
            });

        RB.DnDUploader.create();

        reviewRequestEditor = new RB.ReviewRequestEditor({
            reviewRequest: reviewRequest
        });

        review = new RB.Review({
            parentObject: reviewRequest
        });

        spyOn(review, 'ready').and.callFake(function(options, context) {
            options.ready.call(context);
        });

        /*
         * modalBox uses move(... 'fixed') for all positioning, which will
         * cause the box to flash on screen during tests. Override this to
         * disallow fixed.
         */
        spyOn($.fn, 'move').and.callFake(function(x, y, pos) {
            if (pos === 'fixed') {
                pos = 'absolute';
            }

            return origMove.call(this, x, y, pos);
        });

        /* Prevent these from being called. */
        spyOn(RB.DiffFragmentQueueView.prototype, 'queueLoad');
        spyOn(RB.DiffFragmentQueueView.prototype, 'loadFragments');

        /* By default, general comments should be enabled. */
        RB.EnabledFeatures.generalComments = true;
    });

    afterEach(function() {
        RB.DnDUploader.instance = null;
        RB.ReviewDialogView._instance = null;
        RB.EnabledFeatures.generalComments = origGeneralCommentsEnabled;
    });

    describe('Class methods', function() {
        describe('create', function() {
            it('Without a review', function() {
                expect(function() {
                    RB.ReviewDialogView.create({
                        container: $testsScratch,
                        reviewRequestEditor: reviewRequestEditor
                    });
                }).toThrow();

                expect(RB.ReviewDialogView._instance).toBeFalsy();
                expect($testsScratch.children().length).toBe(0);
            });

            it('With a review', function() {
                dlg = createReviewDialog();

                expect(dlg).toBeTruthy();
                expect(RB.ReviewDialogView._instance).toBe(dlg);

                /* One for the dialog, one for the background box. */
                expect($testsScratch.children().length).toBe(2);
            });

            it('With existing instance', function() {
                dlg = createReviewDialog();

                expect(createReviewDialog).toThrow();

                expect(RB.ReviewDialogView._instance).toBe(dlg);
                expect($testsScratch.children().length).toBe(2);
            });
        });
    });

    describe('Instances', function() {
        describe('Methods', function() {
            it('close', function() {
                dlg = createReviewDialog();
                expect($testsScratch.children().length).toBe(2);

                dlg.close();
                expect($testsScratch.children().length).toBe(0);
                expect(RB.ReviewDialogView._instance).toBe(null);
            });
        });

        describe('Loading', function() {
            it('With new review', function() {
                expect(review.isNew()).toBe(true);

                dlg = RB.ReviewDialogView.create({
                    review: review,
                    container: $testsScratch,
                    reviewRequestEditor: reviewRequestEditor
                });

                expect(dlg._bodyTopView.$editor.text()).toBe('');
                expect(dlg._bodyBottomView.$editor.text()).toBe('');
                expect(dlg._bodyBottomView.$el.is(':visible')).toBe(false);
                expect(dlg._$shipIt.prop('checked')).toBe(false);
                expect(dlg._$spinner).toBe(null);
            });

            describe('With body and top text', function() {
                var bodyTopText = 'My body top',
                    bodyBottomText = 'My body bottom';

                beforeEach(function() {
                    review.set({
                        bodyTop: bodyTopText,
                        bodyBottom: bodyBottomText,
                        loaded: true
                    });
                });

                it('Clearing body bottom hides footer', function() {
                    dlg = RB.ReviewDialogView.create({
                        review: review,
                        container: $testsScratch,
                        reviewRequestEditor: reviewRequestEditor
                    });

                    expect(dlg._bodyBottomView.$editor.text())
                        .toBe(bodyBottomText);
                    expect(dlg._bodyBottomView.$el.is(':visible')).toBe(true);

                    review.set('bodyBottom', '');

                    expect(dlg._bodyBottomView.$el.is(':visible')).toBe(false);
                });
            });

            describe('With existing review', function() {
                var bodyTopText = 'My body top',
                    bodyBottomText = 'My body bottom',
                    shipIt = true,
                    fileAttachmentCommentsPayload,
                    generalCommentsPayload,
                    diffCommentsPayload,
                    screenshotCommentsPayload,
                    commentView,
                    ajaxData;

                beforeEach(function() {
                    review.set({
                        bodyTop: bodyTopText,
                        bodyBottom: bodyBottomText,
                        shipIt: shipIt,
                        loaded: true,
                        id: 42,
                        links: {
                            diff_comments: {
                                href: '/diff-comments/'
                            },
                            file_attachment_comments: {
                                href: '/file-attachment-comments/'
                            },
                            general_comments: {
                               href: '/general-comments/'
                            },
                            screenshot_comments: {
                                href: '/screenshot-comments/'
                            }
                        }
                    });

                    diffCommentsPayload =
                        _.clone(emptyDiffCommentsPayload);
                    screenshotCommentsPayload =
                        _.clone(emptyScreenshotCommentsPayload);
                    fileAttachmentCommentsPayload =
                        _.clone(emptyFileAttachmentCommentsPayload);
                    generalCommentsPayload =
                        _.clone(emptyGeneralCommentsPayload);

                    spyOn($, 'ajax').and.callFake(function(options) {
                        if (options.type === 'DELETE') {
                            options.success({});
                        } else if (options.url ===
                                   '/file-attachment-comments/') {
                            options.success(fileAttachmentCommentsPayload);
                        } else if (options.url === '/diff-comments/') {
                            options.success(diffCommentsPayload);
                        } else if (options.url === '/screenshot-comments/') {
                            options.success(screenshotCommentsPayload);
                        } else if (options.url === '/general-comments/') {
                            options.success(generalCommentsPayload);
                        }
                    });
                });

                describe('Review properties', function() {
                    function testLoadReview() {
                        dlg = RB.ReviewDialogView.create({
                            review: review,
                            container: $testsScratch,
                            reviewRequestEditor: reviewRequestEditor
                        });

                        expect(dlg._bodyTopView.$editor.text())
                            .toBe(bodyTopText);
                        expect(dlg._bodyBottomView.$editor.text())
                            .toBe(bodyBottomText);
                        expect(dlg._bodyBottomView.$el.is(':visible'))
                            .toBe(true);
                        expect(dlg._$shipIt.prop('checked')).toBe(shipIt);
                        expect(dlg._$comments.children().length).toBe(2);
                        expect(dlg._$spinner).toBe(null);
                    }

                    it('With defaultUseRichText=true', function() {
                        RB.UserSession.instance.set('defaultUseRichText', true);

                        testLoadReview();

                        expect(review.ready.calls.argsFor(0)[0].data).toEqual({
                            'force-text-type': 'html',
                            'include-text-types': 'raw,markdown'
                        });
                    });

                    it('With defaultUseRichText=false', function() {
                        RB.UserSession.instance.set('defaultUseRichText',
                                                    false);

                        testLoadReview();

                        expect(review.ready.calls.argsFor(0)[0].data)
                            .toEqual({
                                'force-text-type': 'html',
                                'include-text-types': 'raw'
                            });
                    });
                });

                describe('General comments', function() {
                    it('Disabled', function() {
                        var $button;

                        RB.EnabledFeatures.generalComments = false;

                        dlg = RB.ReviewDialogView.create({
                            review: review,
                            container: $testsScratch,
                            reviewRequestEditor: reviewRequestEditor
                        });

                        $button = dlg._$buttons.find(
                            'input[value="Add Comment"]');
                        expect($button.length).toBe(0);

                        expect($.ajax).toHaveBeenCalled();
                        expect($.ajax.calls.argsFor(0)[0].url).not.toBe(
                            '/general-comments/');

                        expect(dlg._commentViews.length).toBe(0);
                    });

                    describe('Enabled', function() {
                        function testLoadGeneralComments(){
                            var $button;

                            generalCommentsPayload.total_results = 1;
                            generalCommentsPayload.general_comments = [
                                generalCommentPayload
                            ];

                            dlg = RB.ReviewDialogView.create({
                                review: review,
                                container: $testsScratch,
                                reviewRequestEditor: reviewRequestEditor
                            });

                            $button = dlg._$buttons.find(
                                'input[value="Add Comment"]');
                            expect($button.length).toBe(1);

                            expect($.ajax).toHaveBeenCalled();
                            expect($.ajax.calls.argsFor(0)[0].url).toBe(
                                '/general-comments/');
                            ajaxData = $.ajax.calls.argsFor(0)[0].data;

                            expect(dlg._commentViews.length).toBe(1);

                            commentView = dlg._commentViews[0];
                            expect(commentView.$editor.text())
                                .toBe(generalCommentPayload.text);
                            expect(commentView.$issueOpened.prop('checked'))
                                .toBe(
                            generalCommentPayload.issue_opened);

                            expect(dlg._bodyBottomView.$el.is(':visible'))
                                .toBe(true);
                            expect(dlg._$spinner).toBe(null);
                        }

                        it('With defaultUseRichText=true', function() {
                            RB.UserSession.instance.set('defaultUseRichText',
                                                        true);

                            testLoadGeneralComments();

                            expect(ajaxData).toEqual({
                                'api_format': 'json',
                                'max-results': 50,
                                'force-text-type': 'html',
                                'include-text-types': 'raw,markdown'
                            });
                        });

                        it('With defaultUseRichText=false', function() {
                            RB.UserSession.instance.set('defaultUseRichText',
                                                        false);

                            testLoadGeneralComments();

                            expect(ajaxData).toEqual({
                                'api_format': 'json',
                                'max-results': 50,
                                'force-text-type': 'html',
                                'include-text-types': 'raw'
                            });
                        });

                        it('Deleting comment', function() {
                            spyOn(window, 'confirm').and.callFake(function() {
                                return true;
                            });

                            testLoadGeneralComments();

                            expect(dlg._generalCommentsCollection.length)
                                .toBe(1);

                            dlg.$('.delete-comment').click();
                            expect(dlg._generalCommentsCollection.length)
                                .toBe(0);
                        });

                        it('Deleting comment and cancelling', function() {
                            spyOn(window, 'confirm').and.callFake(function() {
                                return false;
                            });

                            testLoadGeneralComments();

                            expect(dlg._generalCommentsCollection.length)
                                .toBe(1);

                            dlg.$('.delete-comment').click();
                            expect(dlg._generalCommentsCollection.length)
                                .toBe(1);
                        });
                    });
                });

                describe('Diff comments', function() {
                    function testLoadDiffComments() {
                        var diffQueueProto = RB.DiffFragmentQueueView.prototype;

                        diffCommentsPayload.total_results = 1;
                        diffCommentsPayload.diff_comments =
                            [diffCommentPayload];

                        dlg = RB.ReviewDialogView.create({
                            review: review,
                            container: $testsScratch,
                            reviewRequestEditor: reviewRequestEditor
                        });

                        expect($.ajax).toHaveBeenCalled();
                        expect($.ajax.calls.argsFor(3)[0].url).toBe(
                            '/diff-comments/');
                        ajaxData = $.ajax.calls.argsFor(3)[0].data;

                        expect(diffQueueProto.queueLoad.calls.count()).toBe(1);
                        expect(diffQueueProto.loadFragments).toHaveBeenCalled();
                        expect(dlg._commentViews.length).toBe(1);

                        commentView = dlg._commentViews[0];
                        expect(commentView.$editor.text())
                            .toBe(diffCommentPayload.text);
                        expect(commentView.$issueOpened.prop('checked'))
                            .toBe(diffCommentPayload.issue_opened);

                        expect(dlg._bodyBottomView.$el.is(':visible'))
                            .toBe(true);
                        expect(dlg._$spinner).toBe(null);
                    }

                    it('With defaultUseRichText=true', function() {
                        RB.UserSession.instance.set('defaultUseRichText', true);

                        testLoadDiffComments();

                        expect(ajaxData).toEqual({
                            'api_format': 'json',
                            'max-results': 50,
                            'expand': 'filediff,interfilediff',
                            'order-by': 'filediff,first_line',
                            'force-text-type': 'html',
                            'include-text-types': 'raw,markdown'
                        });
                    });

                    it('With defaultUseRichText=false', function() {
                        RB.UserSession.instance.set('defaultUseRichText',
                                                    false);

                        testLoadDiffComments();

                        expect(ajaxData).toEqual({
                            'api_format': 'json',
                            'max-results': 50,
                            'expand': 'filediff,interfilediff',
                            'order-by': 'filediff,first_line',
                            'force-text-type': 'html',
                            'include-text-types': 'raw'
                        });
                    });

                    it('Deleting comment', function() {
                        spyOn(window, 'confirm').and.callFake(function() {
                            return true;
                        });

                        testLoadDiffComments();

                        expect(dlg._diffCommentsCollection.length).toBe(1);
                        dlg.$('.delete-comment').click();
                        expect(dlg._diffCommentsCollection.length).toBe(0);
                    });

                    it('Deleting comment and cancelling', function() {
                        spyOn(window, 'confirm').and.callFake(function() {
                            return false;
                        });

                        testLoadDiffComments();

                        expect(dlg._diffCommentsCollection.length).toBe(1);
                        dlg.$('.delete-comment').click();
                        expect(dlg._diffCommentsCollection.length).toBe(1);
                    });
                });

                describe('File attachment comments', function() {
                    function testLoadFileAttachmentComments() {
                        fileAttachmentCommentsPayload.total_results = 1;
                        fileAttachmentCommentsPayload.file_attachment_comments =
                            [fileAttachmentCommentPayload];

                        dlg = RB.ReviewDialogView.create({
                            review: review,
                            container: $testsScratch,
                            reviewRequestEditor: reviewRequestEditor
                        });

                        expect($.ajax).toHaveBeenCalled();
                        expect($.ajax.calls.argsFor(2)[0].url).toBe(
                            '/file-attachment-comments/');
                        ajaxData = $.ajax.calls.argsFor(2)[0].data;

                        expect(dlg._commentViews.length).toBe(1);

                        commentView = dlg._commentViews[0];
                        expect(commentView.$editor.text())
                            .toBe(fileAttachmentCommentPayload.text);
                        expect(commentView.$issueOpened.prop('checked')).toBe(
                            fileAttachmentCommentPayload.issue_opened);
                        expect(commentView.$('.filename a').attr('href')).toBe(
                            fileAttachmentCommentPayload.review_url);
                        expect(commentView.$('.filename a').text()).toBe(
                            fileAttachmentCommentPayload.link_text);
                        expect(commentView.$('.thumbnail').html()).toBe(
                            fileAttachmentCommentPayload.thumbnail_html);

                        expect(dlg._bodyBottomView.$el.is(':visible'))
                            .toBe(true);
                        expect(dlg._$spinner).toBe(null);
                    }

                    it('With defaultUseRichText=true', function() {
                        RB.UserSession.instance.set('defaultUseRichText', true);

                        testLoadFileAttachmentComments();

                        expect(ajaxData).toEqual({
                            'api_format': 'json',
                            'max-results': 50,
                            'expand': 'diff_against_file_attachment,' +
                                      'file_attachment',
                            'force-text-type': 'html',
                            'include-text-types': 'raw,markdown'
                        });
                    });

                    it('With defaultUseRichText=false', function() {
                        RB.UserSession.instance.set('defaultUseRichText',
                                                    false);

                        testLoadFileAttachmentComments();

                        expect(ajaxData).toEqual({
                            'api_format': 'json',
                            'max-results': 50,
                            'expand': 'diff_against_file_attachment,' +
                                      'file_attachment',
                            'force-text-type': 'html',
                            'include-text-types': 'raw'
                        });
                    });

                    it('Deleting comment', function() {
                        spyOn(window, 'confirm').and.callFake(function() {
                            return true;
                        });

                        testLoadFileAttachmentComments();

                        expect(dlg._fileAttachmentCommentsCollection.length)
                            .toBe(1);
                        dlg.$('.delete-comment').click();
                        expect(dlg._fileAttachmentCommentsCollection.length)
                            .toBe(0);
                    });

                    it('Deleting comment and cancelling', function() {
                        spyOn(window, 'confirm').and.callFake(function() {
                            return false;
                        });

                        testLoadFileAttachmentComments();

                        expect(dlg._fileAttachmentCommentsCollection.length)
                            .toBe(1);

                        dlg.$('.delete-comment').click();
                        expect(dlg._fileAttachmentCommentsCollection.length)
                            .toBe(1);
                    });
                });

                describe('Screenshot comments', function() {
                    function testLoadScreenshotComments() {
                        var $img,
                            $filenameA;

                        screenshotCommentsPayload.total_results = 1;
                        screenshotCommentsPayload.screenshot_comments = [
                            screenshotCommentPayload
                        ];

                        dlg = createReviewDialog();

                        expect($.ajax).toHaveBeenCalled();
                        expect($.ajax.calls.argsFor(1)[0].url).toBe(
                            '/screenshot-comments/');
                        ajaxData = $.ajax.calls.argsFor(1)[0].data;

                        expect(dlg._commentViews.length).toBe(1);

                        commentView = dlg._commentViews[0];
                        expect(commentView.$editor.text())
                            .toBe(screenshotCommentPayload.text);
                        expect(commentView.$issueOpened.prop('checked')).toBe(
                            screenshotCommentPayload.issue_opened);

                        $img = commentView.$('img');
                        expect($img.attr('src')).toBe(
                            screenshotCommentPayload.thumbnail_url);
                        expect($img.attr('width')).toBe(
                            screenshotCommentPayload.w.toString());
                        expect($img.attr('height')).toBe(
                            screenshotCommentPayload.h.toString());
                        expect($img.attr('alt')).toBe(
                            screenshotCommentPayload.screenshot.caption);

                        $filenameA = commentView.$('.filename a');
                        expect($filenameA.attr('href')).toBe(
                            screenshotCommentPayload.screenshot.review_url);
                        expect($filenameA.text()).toBe(
                            screenshotCommentPayload.screenshot.caption);

                        expect(dlg._bodyBottomView.$el.is(':visible'))
                            .toBe(true);
                        expect(dlg._$spinner).toBe(null);
                    }

                    it('With defaultUseRichText=true', function() {
                        RB.UserSession.instance.set('defaultUseRichText', true);

                        testLoadScreenshotComments();

                        expect(ajaxData).toEqual({
                            'api_format': 'json',
                            'max-results': 50,
                            'expand': 'screenshot',
                            'force-text-type': 'html',
                            'include-text-types': 'raw,markdown'
                        });
                    });

                    it('With defaultUseRichText=false', function() {
                        RB.UserSession.instance.set('defaultUseRichText',
                                                    false);

                        testLoadScreenshotComments();

                        expect(ajaxData).toEqual({
                            'api_format': 'json',
                            'max-results': 50,
                            'expand': 'screenshot',
                            'force-text-type': 'html',
                            'include-text-types': 'raw'
                        });
                    });

                    it('Deleting comment', function() {
                        spyOn(window, 'confirm').and.callFake(function() {
                            return true;
                        });

                        testLoadScreenshotComments();

                        expect(dlg._screenshotCommentsCollection.length)
                            .toBe(1);

                        dlg.$('.delete-comment').click();
                        expect(dlg._screenshotCommentsCollection.length)
                            .toBe(0);
                    });

                    it('Deleting comment and cancelling', function() {
                        spyOn(window, 'confirm').and.callFake(function() {
                            return false;
                        });

                        testLoadScreenshotComments();

                        expect(dlg._screenshotCommentsCollection.length)
                            .toBe(1);

                        dlg.$('.delete-comment').click();
                        expect(dlg._screenshotCommentsCollection.length)
                            .toBe(1);
                    });
                });
            });
        });

        describe('Saving', function() {
            var fileAttachmentCommentsPayload,
                generalCommentsPayload,
                diffCommentsPayload,
                screenshotCommentsPayload,
                commentView,
                comment;

            function testSaveComment(richText) {
                var newCommentText = 'New comment text';

                dlg = createReviewDialog();

                expect(dlg._commentViews.length).toBe(1);

                commentView = dlg._commentViews[0];
                comment = commentView.model;

                spyOn(comment, 'save');

                /* Set some new state for the comment. */
                commentView.$editor
                    .inlineEditor('startEdit')
                    .inlineEditor('setValue', newCommentText);
                commentView.textEditor.setRichText(richText);
                commentView.save();

                expect(comment.save).toHaveBeenCalled();
                expect(comment.get('text')).toBe(newCommentText);
                expect(comment.get('richText')).toBe(richText);
            }

            function testSaveCommentPreventsXSS(richText) {
                var newCommentText =
                    '"><script>window.rbTestFoundXSS = true;</script>';

                delete window.rbTestFoundXSS;

                dlg = createReviewDialog();

                expect(dlg._commentViews.length).toBe(1);

                commentView = dlg._commentViews[0];
                comment = commentView.model;

                spyOn(comment, 'save');

                /* Set some new state for the comment. */
                commentView.$editor
                    .inlineEditor('startEdit')
                    .inlineEditor('setValue', newCommentText);
                commentView.textEditor.setRichText(true);
                commentView.save();

                expect(comment.save).toHaveBeenCalled();
                expect(comment.get('text')).toBe(newCommentText);
                expect(window.rbTestFoundXSS).toBe(undefined);
            }

            beforeEach(function() {
                review.set({
                    loaded: true,
                    id: 42,
                    links: {
                        diff_comments: {
                            href: '/diff-comments/'
                        },
                        file_attachment_comments: {
                            href: '/file-attachment-comments/'
                        },
                        general_comments: {
                            href: '/general-comments/'
                        },
                        screenshot_comments: {
                            href: '/screenshot-comments/'
                        }
                    }
                });

                diffCommentsPayload =
                    _.clone(emptyDiffCommentsPayload);
                screenshotCommentsPayload =
                    _.clone(emptyScreenshotCommentsPayload);
                fileAttachmentCommentsPayload =
                    _.clone(emptyFileAttachmentCommentsPayload);
                generalCommentsPayload =
                    _.clone(emptyGeneralCommentsPayload);

                spyOn(review, 'save').and.callFake(
                    function(options, context) {
                        if (options && options.success) {
                            options.success.call(context);
                        }
                    });

                spyOn($, 'ajax').and.callFake(function(options) {
                    if (options.url === '/file-attachment-comments/') {
                        options.success(fileAttachmentCommentsPayload);
                    } else if (options.url === '/diff-comments/') {
                        options.success(diffCommentsPayload);
                    } else if (options.url === '/screenshot-comments/') {
                        options.success(screenshotCommentsPayload);
                    } else if (options.url === '/general-comments/') {
                        options.success(generalCommentsPayload);
                    }
                });
            });

            describe('Review properties', function() {
                function testSelfXSS(bodyView, attrName) {
                    var text = '"><script>window.rbTestFoundXSS = true;' +
                               '</script>',
                        editor = bodyView.textEditor;

                    delete window.rbTestFoundXSS;

                    bodyView.openEditor();
                    editor.setText(text);
                    editor.setRichText(true);
                    bodyView.save();

                    expect(editor.getText()).toBe(text);
                    expect(review.save).toHaveBeenCalled();
                    expect(review.get(attrName)).toBe(text);
                    expect(window.rbTestFoundXSS).toBe(undefined);
                }

                beforeEach(function() {
                    dlg = createReviewDialog();
                });

                describe('Body Top', function() {
                    function runTest(richText) {
                        var text = 'My new text',
                            bodyTopEditor = dlg._bodyTopView.textEditor;

                        dlg._bodyTopView.openEditor();
                        bodyTopEditor.setText(text);
                        bodyTopEditor.setRichText(richText);
                        dlg._bodyTopView.save();

                        expect(bodyTopEditor.getText()).toBe(text);
                        expect(review.save).toHaveBeenCalled();
                        expect(review.get('bodyTop')).toBe(text);
                        expect(review.get('bodyTopRichText')).toBe(richText);
                    }

                    it('For Markdown', function() {
                        runTest(true);
                    });

                    it('For plain text', function() {
                        runTest(false);
                    });

                    it('Prevents Self-XSS', function() {
                        testSelfXSS(dlg._bodyTopView, 'bodyTop');
                    });
                });

                describe('Body Bottom', function() {
                    function runTest(richText) {
                        var text = 'My new text',
                            bodyBottomEditor = dlg._bodyBottomView.textEditor;

                        dlg._bodyBottomView.openEditor();
                        bodyBottomEditor.setText(text);
                        bodyBottomEditor.setRichText(richText);
                        dlg._bodyBottomView.save();

                        expect(bodyBottomEditor.getText()).toBe(text);
                        expect(review.save).toHaveBeenCalled();
                        expect(review.get('bodyBottom')).toBe(text);
                        expect(review.get('bodyBottomRichText')).toBe(richText);
                    }

                    it('For Markdown', function() {
                        runTest(true);
                    });

                    it('For plain text', function() {
                        runTest(false);
                    });

                    it('Prevents Self-XSS', function() {
                        testSelfXSS(dlg._bodyBottomView, 'bodyBottom');
                    });
                });

                describe('Ship It', function() {
                    function runTest(shipIt) {
                        dlg._$shipIt.prop('checked', shipIt);
                        dlg._saveReview();

                        expect(dlg._$shipIt.prop('checked')).toBe(shipIt);
                    }

                    it('Checked', function() {
                        runTest(true);
                    });

                    it('Unchecked', function() {
                        runTest(false);
                    });
                });
            });

            describe('Diff comments', function() {
                beforeEach(function() {
                    diffCommentsPayload.total_results = 1;
                    diffCommentsPayload.diff_comments = [diffCommentPayload];
                });

                it('For Markdown', function() {
                    testSaveComment(true);
                });

                it('For plain text', function() {
                    testSaveComment(false);
                });

                it('Prevents Self-XSS', function() {
                    testSaveCommentPreventsXSS();
                });
            });

            describe('File attachment comments', function() {
                beforeEach(function() {
                    fileAttachmentCommentsPayload.total_results = 1;
                    fileAttachmentCommentsPayload.file_attachment_comments = [
                        fileAttachmentCommentPayload
                    ];
                });

                it('For Markdown', function() {
                    testSaveComment(true);
                });

                it('For plain text', function() {
                    testSaveComment(false);
                });

                it('Prevents Self-XSS', function() {
                    testSaveCommentPreventsXSS();
                });
            });

            describe('General comments', function() {
                beforeEach(function() {
                    generalCommentsPayload.total_results = 1;
                    generalCommentsPayload.general_comments = [
                        generalCommentPayload
                    ];
                });

                it('For Markdown', function() {
                    testSaveComment(true);
                });

                it('For plain text', function() {
                    testSaveComment(false);
                });
            });

            describe('Screenshot comments', function() {
                beforeEach(function() {
                    screenshotCommentsPayload.total_results = 1;
                    screenshotCommentsPayload.screenshot_comments = [
                        screenshotCommentPayload
                    ];
                });

                it('For Markdown', function() {
                    testSaveComment(true);
                });

                it('For plain text', function() {
                    testSaveComment(false);
                });

                it('Prevents Self-XSS', function() {
                    testSaveCommentPreventsXSS();
                });
            });
        });
    });
});


text:
form {
	padding:0;
	display:inline;
	position:relative;
}
.second-level-menu > li
{
	position: relative;
	height: 30px;
	background: #26343F;
}
.second-level-menu > li:hover { background: #00B299; }

.top-level-menu
{
	list-style: none;
	padding: 0;
	margin: 0;
}

.top-level-menu > li
{
	position: relative;
	float: left;
	height: 30px;
	width: 150px;
	background: #26343F;
}
.top-level-menu > li:hover { background: #00B299; }

.top-level-menu li:hover > ul
{
	/* On hover, display the next level's menu */
	display: inline;
}

/* Menu Link Styles */

.top-level-menu a /* Apply to all links inside the multi-level menu */
{
	font: bold 14px Arial, Helvetica, sans-serif;
	color: #FFFFFF;
	text-decoration: none;
	padding: 0 0 0 10px;

	/* Make the link cover the entire list item-container */
	display: block;
	line-height: 30px;
}
.top-level-menu a:hover { color: #000000; }

.menubar {
	width: 100%;
	height: 30px;
	background: #26343F;
}

div.optionsdiv {
	width:75%;
	border:1px solid #ccc;
	margin-left: auto;
	margin-right: auto;
	padding: 50px 50px 50px 50px;
}
div.option {
	position:relative;
	height:30px;
	margin-left:auto;
	margin-right:auto;
}
div.description {
	position:relative;
	color: grey;
	font-size: 8pt;
	width: 100px;
	margin-left:auto;
	margin-right:auto;
}

div.selbox {
	margin-right: auto;
	margin-left: auto;
}


text:
#include <stdio.h>
#include <sys/time.h>
#include <math.h>
#include <getopt.h>

#include <SDL2/SDL_image.h>
#include <SDL2/SDL_mixer.h>
#include <SDL2/SDL_ttf.h>

#include "common.h"
#include "util.h"
#include "entity.h"
#include "level.h"
#include "main.h"
#include "player.h"

std::string FIRSTLEVEL = "worldmap";
int quit = 0;
std::string nextlevel = "";

void initVariables(int w, int h) {
	camera.w = WIDTH;
	camera.h = HEIGHT;
}

int main(int argc, char *argv[]) {
	static SDL_Window *window;
	if(initWindow(&window, &renderer, argc, argv)) return 1;
	initVariables(WIDTH, HEIGHT);
	initTextures();
	initFonts();
	initInput();
	//initHUD();

	generateLevel(FIRSTLEVEL);

	hud = new Hud();

	/*==============*/
	/*  Test Stuff  */
	/*==============*/

	/*PhysicsEntity *goomba = new PhysicsEntity(getTexture("goomba"), 500, 50);
	goomba->patrolling = 1;

	Interactable *healthUp = new Interactable(getTexture("concrete"), 800, 500);
	healthUp->target = ply;
	healthUp->action = HEALTH_UP;

	Interactable *scrapUp = new Interactable(getTexture("sand"), 850, 500);
	scrapUp->target = ply;
	scrapUp->action = SCRAP_UP;*/

	/*=================*/
	/*End of Test Stuff*/
	/*=================*/

	int lastFrame = curtime_u() - 1;
	double dt;
	while(!quit) {
		if(DEBUG) fpsCounter();

		// Calculate dt
		int curFrame = curtime_u();
		if(lastFrame > curFrame) {dt = ((1000000 - lastFrame) + curFrame) / 1000000.0;}
		else {dt = (curFrame - lastFrame) / 1000000.0;}
		if(dt > 0.05) {dt = 0.05;} // Clamp dt so objects don't have collision issues
		lastFrame = curFrame;

		// ===================
		// Update
		if(nextlevel != "") {
			printf("Switching to level %s\n", nextlevel.c_str());
			generateLevel(nextlevel);
			nextlevel = "";
		}
		TimerRun();
		for(int enti=0; enti<entsC; enti++) {
			if(ents[enti] == NULL) continue;
			ents[enti]->Update(dt);
			if(ents[enti]->isKilled) delete ents[enti];
		}

		// ====================
		// Drawing
		for(int rli=0; rli<RL_MAX; rli++){
			if(rli == RL_BACKGROUND) {
				drawBackground(renderer, dt);
				continue; // Done in drawBackground
			}
			Drawable** layer = renderLayers[rli];
			for(int enti=0; enti<renderLayersC[rli]; enti++) {
				if(layer[enti] == NULL) continue;
				layer[enti]->Draw(dt);
			}
		}

		// Flip render buffer
		SDL_RenderPresent(renderer);

		// Frame limiting, not needed if we're using vsync
		//SDL_Delay((1000 / 66) - (curtime_u() - lastFrame)/1000);
	}
	printf("\nShutting down...\n");

	cleanLevel();
	// Destroy old textures
	for(std::map<std::string, TextureData>::iterator it = blockTDs.begin(); it != blockTDs.end(); ++it) {
		SDL_DestroyTexture(it->second.texture);
	}
	blockTDs.clear();

	SDL_DestroyRenderer(renderer);
	SDL_DestroyWindow(window);

	Mix_CloseAudio();
	Mix_Quit();

	IMG_Quit();
	SDL_Quit();
	return 0;
}

int initWindow(SDL_Window **window, SDL_Renderer **renderer, int argc, char *argv[]) {
	if(SDL_Init(SDL_INIT_EVERYTHING) == -1) {
		fprintf(stderr, "SDL Init failed: %s\n", SDL_GetError());
		return 1;
	}

	int flags=IMG_INIT_JPG|IMG_INIT_PNG;
	if(IMG_Init(flags) != flags) {
		fprintf(stderr, "IMG_Init failed: %s\n", IMG_GetError());
		return 1;
	}

	if(Mix_OpenAudio( MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT, 2, 1024 ) == -1) {
		fprintf(stderr, "Audio Init failed: %s\n", Mix_GetError());
		return 1;
	}
	int mixFlags = MIX_INIT_OGG;
	if(Mix_Init(mixFlags) != mixFlags) {
		fprintf(stderr, "Audio Init2 failed: %s\n", Mix_GetError());
		return 1;
	}

	if(TTF_Init()==-1) {
		printf("TTF_Init: %s\n", TTF_GetError());
		return 1;
	}

	WIDTH = 800;
	HEIGHT = 600;

	int useSoftwareAccel = 0;
	int useFullscreen = 0;
	int optionIndex = 0;
	int c;
	struct option longOptions[] = {
		{"software", no_argument, &useSoftwareAccel, 1},
		{"hardware", no_argument, &useSoftwareAccel, 0},
		{"fullscreen", no_argument, &useFullscreen, 1},
		{"level", required_argument, 0, 'l'}
	};

	while((c = getopt_long(argc, argv, "l", longOptions, &optionIndex)) != -1) {
		switch(c) {
			case 'l':
				FIRSTLEVEL = optarg;
				break;
		}
	}

	if(useFullscreen) {
		SDL_DisplayMode displayInfo;
		SDL_GetCurrentDisplayMode(0, &displayInfo);
		WINDOW_WIDTH = displayInfo.w;
		WINDOW_HEIGHT = displayInfo.h;
	} else {
		WINDOW_WIDTH = WIDTH;
		WINDOW_HEIGHT = HEIGHT;
	}
	WIDTH_OFFSET = (WINDOW_WIDTH - WIDTH)/2;
	HEIGHT_OFFSET = (WINDOW_HEIGHT - HEIGHT)/2;

	for(int i=0;i<SDL_GetNumRenderDrivers();i++) {
		SDL_RendererInfo info;
		SDL_GetRenderDriverInfo(i, &info);
		printf("Video Driver %d (%s): flags(%d) %s,%s,%s,%s - %d\n", i, info.name, info.flags,
			(info.flags & SDL_RENDERER_SOFTWARE) ? "Software" : "",
			(info.flags & SDL_RENDERER_ACCELERATED) ? "Hardware Accelerated" : "",
			(info.flags & SDL_RENDERER_PRESENTVSYNC) ? "VSync" : "",
			(info.flags & SDL_RENDERER_TARGETTEXTURE) ? "TextureRender" : "",
			info.num_texture_formats
		);
		/*for(int texN=0; texN<info.num_texture_formats; texN++) {
			printf("%d ", info.texture_formats[texN]);
		}
		printf("\n");*/
	}

	*window = SDL_CreateWindow("Terracer", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, WINDOW_WIDTH, WINDOW_HEIGHT, (useFullscreen ? SDL_WINDOW_BORDERLESS : 0));
											//  -1 for first rendering driver that fits the flags
	if(useSoftwareAccel || (*renderer = SDL_CreateRenderer(*window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC)) == NULL) {
		fprintf(stderr, "Loading hardware acceleration failed. Using software fallback...\n");
		if((*renderer = SDL_CreateRenderer(*window, -1, SDL_RENDERER_SOFTWARE)) == NULL) {
			fprintf(stderr, "Loading software fallback renderer failed! Error: %s\n", SDL_GetError());
			return 1;
		}
	}

	SDL_RenderSetLogicalSize(*renderer, WIDTH, HEIGHT);

	return 0;
}


text:
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.policy;

import android.annotation.TargetApi;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.os.UserManager;

/**
 * Retrieves app restrictions and provides them to a {@link Delegate} object as Bundles.
 * Retrieving the restrictions is done asynchronously.
 */
public class AppRestrictionsProvider {
    /** Delegate to notify when restrictions have been received. */
    public interface Delegate {
        /** Called when new restrictions are available. */
        public void notifyNewAppRestrictionsAvailable(Bundle newAppRestrictions);
    }

    private final UserManager mUserManager;
    private final Context mContext;
    private final Delegate mDelegate;
    private final BroadcastReceiver mAppRestrictionsChangedReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            refreshRestrictions();
        }
    };

    /**
     * @param context The application context.
     * @param appRestrictionsProviderDelegate Object to be notified when new restrictions
     *  are available.
     */
    public AppRestrictionsProvider(Context context, Delegate appRestrictionsProviderDelegate) {
        mContext = context;
        mDelegate = appRestrictionsProviderDelegate;
        mUserManager = getUserManager();
    }

    /**
     * Start listening for restrictions changes. Does nothing if this is not supported by the
     * platform.
     */
    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
    public void startListening() {
        if (!isChangeIntentSupported()) return;
        mContext.registerReceiver(mAppRestrictionsChangedReceiver,
                new IntentFilter(Intent.ACTION_APPLICATION_RESTRICTIONS_CHANGED));
    }

    /**
     * Asynchronously retrieve the restrictions.
     * {@link Delegate#notifyNewAppRestrictionsAvailable(Bundle)} will be called as a result.
     */
    public void refreshRestrictions() {
        if (!isRestrictionsSupported()) {
            mDelegate.notifyNewAppRestrictionsAvailable(new Bundle());
            return;
        }

        new AsyncTask<Void, Void, Bundle>() {
            @Override
            protected Bundle doInBackground(Void... params) {
                return getApplicationRestrictions();
            }

            @Override
            protected void onPostExecute(Bundle result) {
                mDelegate.notifyNewAppRestrictionsAvailable(result);
            }
        }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
    }

    /**
     * Stop listening for restrictions changes. Does nothing if this is not supported by the
     * platform.
     */
    public void stopListening() {
        if (isChangeIntentSupported()) {
            mContext.unregisterReceiver(mAppRestrictionsChangedReceiver);
        }
    }

    /**
     * getApplicationRestrictions method of UserManger was introduced in JELLY_BEAN_MR2.
     */
    private boolean isRestrictionsSupported() {
        return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2;
    }

    /**
     * Intent.ACTION_APPLICATION_RESTRICTIONS_CHANGED was introduced in LOLLIPOP.
     */
    private boolean isChangeIntentSupported() {
        return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;
    }

    /**
     * Wrap access to the Android UserManager to allow being swapped out in environments where it
     * is not available yet.
     */
    @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
    private Bundle getApplicationRestrictions() {
        return mUserManager.getApplicationRestrictions(mContext.getPackageName());
    }

    /**
     * Wrap access to the Android UserManager to allow being swapped out in environments where it
     * is not available yet.
     */
    @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
    private UserManager getUserManager() {
        if (!isRestrictionsSupported()) return null;
        return (UserManager) mContext.getSystemService(Context.USER_SERVICE);
    }
}


text:
using namespace foundation;

namespace renderer
{

APPLESEED_DEFINE_APIARRAY(LightPathArray);

struct LightPathRecorder::Impl
{
    const Project&                                m_project;

    boost::mutex                                  m_mutex;
    std::vector<std::unique_ptr<LightPathStream>> m_streams;

    // One entry in the index = one pixel in the frame.
    struct IndexEntry
    {
        size_t  m_begin_path;           // index of the first path
        size_t  m_end_path;             // index of one path past the last one
    };

    size_t                                   m_render_width;
    size_t                                   m_render_height;
    std::vector<IndexEntry>                  m_index;

    explicit Impl(const Project& project)
      : m_project(project)
    {
    }
};

LightPathRecorder::LightPathRecorder(const Project& project)
  : impl(new Impl(project))
{
}

LightPathRecorder::~LightPathRecorder()
{
    delete impl;
}

void LightPathRecorder::clear()
{
    for (auto& stream : impl->m_streams)
        stream->clear();

    clear_release_memory(impl->m_index);
}

size_t LightPathRecorder::get_light_path_count() const
{
    size_t count = 0;

    for (const auto& stream : impl->m_streams)
        count += stream->m_paths.size();

    return count;
}

size_t LightPathRecorder::get_vertex_count() const
{
    assert(impl->m_streams.size() == 1);
    const LightPathStream* stream = impl->m_streams[0].get();

    return stream->m_vertices.size();
}

LightPathStream* LightPathRecorder::create_stream()
{
    boost::mutex::scoped_lock lock(impl->m_mutex);

    auto stream = new LightPathStream(impl->m_project);
    impl->m_streams.push_back(std::unique_ptr<LightPathStream>(stream));

    return stream;
}

void LightPathRecorder::finalize(
    const size_t        render_width,
    const size_t        render_height)
{
    impl->m_render_width = render_width;
    impl->m_render_height = render_height;

    if (impl->m_streams.empty())
        return;

    // Merge all streams into the first one.
    if (impl->m_streams.size() > 1)
    {
        const size_t light_path_count = get_light_path_count();

        RENDERER_LOG_INFO("merging %s light path streams (%s light path%s)...",
            pretty_uint(impl->m_streams.size()).c_str(),
            pretty_uint(light_path_count).c_str(),
            light_path_count > 1 ? "s" : "");

        for (size_t i = 1, e = impl->m_streams.size(); i < e; ++i)
        {
            merge_streams(
                *impl->m_streams[0],
                *impl->m_streams[i]);
        }

        impl->m_streams.resize(1);
    }

    // Retrieve the first and only stream.
    LightPathStream* stream = impl->m_streams[0].get();

    // Remove paths that end outside of the frame.
    RENDERER_LOG_INFO("filtering light path%s...", stream->m_paths.size() > 1 ? "s" : "");
    stream->m_paths.erase(
        remove_if(
            stream->m_paths.begin(),
            stream->m_paths.end(),
            [render_width, render_height](const LightPathStream::StoredPath& p)
            {
                return
                    p.m_pixel_coords.x >= render_width ||
                    p.m_pixel_coords.y >= render_height;
            }),
        stream->m_paths.end());
    const auto light_path_count = stream->m_paths.size();

    // Sort paths by pixel coordinates.
    RENDERER_LOG_INFO("sorting light path%s...", light_path_count > 1 ? "s" : "");
    sort(
        stream->m_paths.begin(),
        stream->m_paths.end(),
        [](const LightPathStream::StoredPath& lhs,
           const LightPathStream::StoredPath& rhs)
        {
            return lhs.m_pixel_coords.y < rhs.m_pixel_coords.y ? true :
                   lhs.m_pixel_coords.y > rhs.m_pixel_coords.y ? false :
                   lhs.m_pixel_coords.x < rhs.m_pixel_coords.x;
        });

    // Build index.
    RENDERER_LOG_INFO("indexing light path%s...", light_path_count > 1 ? "s" : "");
    impl->m_index.resize(render_width * render_height);
    for (auto& index_entry : impl->m_index)
    {
        index_entry.m_begin_path = ~size_t(0);
        index_entry.m_end_path = ~size_t(0);
    }
    for (size_t i = 0, e = stream->m_paths.size(); i < e; ++i)
    {
        // Retrieve index entry.
        const auto& path = stream->m_paths[i];
        const auto x = path.m_pixel_coords.x;
        const auto y = path.m_pixel_coords.y;
        auto& index_entry = impl->m_index[y * render_width + x];

        // Initialize index entry if this is the first path for that pixel.
        if (index_entry.m_begin_path == ~std::uint64_t(0))
        {
            index_entry.m_begin_path = i;
            index_entry.m_end_path = i;
        }

        // One more path for that pixel.
        ++index_entry.m_end_path;
    }
}

void LightPathRecorder::query(
    const size_t        x0,
    const size_t        y0,
    const size_t        x1,
    const size_t        y1,
    LightPathArray&     result) const
{
    assert(impl->m_streams.size() == 1);
    const LightPathStream* stream = impl->m_streams[0].get();

    for (size_t y = y0; y <= y1; ++y)
    {
        for (size_t x = x0; x <= x1; ++x)
        {
            const auto& index_entry = impl->m_index[y * impl->m_render_width + x];

            for (size_t p = index_entry.m_begin_path; p < index_entry.m_end_path; ++p)
            {
                const auto& source_path = stream->m_paths[p];

                LightPath path;
                path.m_pixel_coords[0] = source_path.m_pixel_coords[0];
                path.m_pixel_coords[1] = source_path.m_pixel_coords[1];
                path.m_sample_position[0] = source_path.m_sample_position[0];
                path.m_sample_position[1] = source_path.m_sample_position[1];
                path.m_vertex_begin_index = source_path.m_vertex_begin_index;
                path.m_vertex_end_index = source_path.m_vertex_end_index;

                result.push_back(path);
            }
        }
    }
}

void LightPathRecorder::get_light_path_vertex(
    const size_t        index,
    LightPathVertex&    result) const
{
    assert(impl->m_streams.size() == 1);
    const LightPathStream* stream = impl->m_streams[0].get();

    assert(index < stream->m_vertices.size());
    const auto& source_vertex = stream->m_vertices[index];

    result.m_entity = source_vertex.m_entity;

    result.m_position[0] = source_vertex.m_position[0];
    result.m_position[1] = source_vertex.m_position[1];
    result.m_position[2] = source_vertex.m_position[2];

    result.m_radiance[0] = source_vertex.m_radiance[0];
    result.m_radiance[1] = source_vertex.m_radiance[1];
    result.m_radiance[2] = source_vertex.m_radiance[2];
}

bool LightPathRecorder::write(const char* filename) const
{
    //
    // The format of Light Paths files (*.aspaths) is documented at
    //
    //   https://github.com/appleseedhq/appleseed/wiki/Light-Paths-File-Format
    //

    Stopwatch<DefaultWallclockTimer> stopwatch;
    stopwatch.start();

    // Retrieve the first and only stream.
    assert(impl->m_streams.size() == 1);
    const LightPathStream* stream = impl->m_streams[0].get();
    const size_t light_path_count = stream->m_paths.size();

    try
    {
        RENDERER_LOG_INFO(
            "writing path%s to %s...",
            light_path_count > 1 ? "s" : "",
            filename);

        // Open file.
        BufferedFile file;
        if (!file.open(filename, BufferedFile::BinaryType, BufferedFile::WriteMode))
        {
            RENDERER_LOG_ERROR("failed to open %s for writing.", filename);
            return false;
        }

        // Signature.
        static const char Signature[7] = { 'A', 'S', 'P', 'A', 'T', 'H', 'S' };
        checked_write(file, Signature, sizeof(Signature));

        // Version.
        const std::uint16_t Version = 1;
        checked_write(file, Version);

        // Number of paths.
        assert(light_path_count < 4294967296ULL);
        checked_write(file, static_cast<std::uint32_t>(light_path_count));

        // On-disk variant of Impl::IndexEntry.
        struct StoredIndexEntry
        {
            std::uint64_t  m_start_offset;     // byte offset in the file of the first path
            std::uint16_t  m_path_count;       // number of paths for that pixel
        };

        // Initialize index.
        std::vector<StoredIndexEntry> stored_index(impl->m_render_width * impl->m_render_height);
        for (auto& index_entry : stored_index)
        {
            index_entry.m_start_offset = ~std::uint64_t(0);
            index_entry.m_path_count = 0;
        }

        // Write index dimensions.
        checked_write(file, static_cast<std::uint16_t>(impl->m_render_width));
        checked_write(file, static_cast<std::uint16_t>(impl->m_render_height));

        // Write index placeholder.
        const auto index_location = file.tell();
        for (const auto& index_entry : stored_index)
        {
            checked_write(file, index_entry.m_start_offset);
            checked_write(file, index_entry.m_path_count);
        }

        // Collect entity names and build (entity name -> name index) dictionary.
        std::vector<std::string> entity_names;
        std::map<const Entity*, std::uint16_t> entity_name_to_index;
        for (const auto& vertex : stream->m_vertices)
        {
            if (entity_name_to_index.find(vertex.m_entity) == entity_name_to_index.end())
            {
                // Insert a new (entity name -> name index) entry into the dictionary.
                assert(entity_names.size() < 65536);
                entity_name_to_index.insert(
                    std::make_pair(
                        vertex.m_entity,
                        static_cast<std::uint16_t>(entity_names.size())));

                // Insert the entity name into the vector.
                entity_names.push_back(
                    to_string(vertex.m_entity->get_path()));
            }
        }

        // Write entity names.
        assert(entity_names.size() < 65536);
        checked_write(file, static_cast<std::uint16_t>(entity_names.size()));
        for (const auto& name : entity_names)
        {
            assert(name.size() < 65536);
            checked_write(file, static_cast<std::uint16_t>(name.size()));
            checked_write(file, name.c_str(), name.size());
        }

        // Write paths.
        for (const auto& path : stream->m_paths)
        {
            // Retrieve index entry.
            const auto x = path.m_pixel_coords.x;
            const auto y = path.m_pixel_coords.y;
            auto& index_entry = stored_index[y * impl->m_render_width + x];

            // Initialize index entry if this is the first path for that pixel.
            if (index_entry.m_start_offset == ~std::uint64_t(0))
                index_entry.m_start_offset = static_cast<std::uint64_t>(file.tell());

            // One more path for that pixel.
            assert(index_entry.m_path_count < 65535);
            ++index_entry.m_path_count;

            // Write path info.
            checked_write(file, path.m_sample_position[0]);
            checked_write(file, path.m_sample_position[1]);

            // Write number of vertices for this path.
            const auto vertex_count = path.m_vertex_end_index - path.m_vertex_begin_index;
            assert(vertex_count < 65536);
            checked_write(file, static_cast<std::uint16_t>(vertex_count));

            // Write path vertices.
            for (auto i = path.m_vertex_begin_index; i < path.m_vertex_end_index; ++i)
            {
                const auto& vertex = stream->m_vertices[i];

                // Entity name index.
                const auto it = entity_name_to_index.find(vertex.m_entity);
                assert(it != entity_name_to_index.end());
                checked_write(file, it->second);

                // Write world space position of this vertex.
                checked_write(file, vertex.m_position[0]);
                checked_write(file, vertex.m_position[1]);
                checked_write(file, vertex.m_position[2]);

                // Write radiance at this vertex.
                checked_write(file, vertex.m_radiance[0]);
                checked_write(file, vertex.m_radiance[1]);
                checked_write(file, vertex.m_radiance[2]);
            }
        }

        // Go back and write final index.
        file.seek(index_location, BufferedFile::SeekFromBeginning);
        for (const auto& index_entry : stored_index)
        {
            checked_write(file, index_entry.m_start_offset);
            checked_write(file, index_entry.m_path_count);
        }

        // Close file.
        file.close();

        stopwatch.measure();

        RENDERER_LOG_INFO(
            "wrote %s path%s to %s in %s.",
            pretty_uint(light_path_count).c_str(),
            light_path_count > 1 ? "s" : "",
            filename,
            pretty_time(stopwatch.get_seconds()).c_str());

        return true;
    }
    catch (const ExceptionIOError& e)
    {
        RENDERER_LOG_ERROR("failed to write paths to %s: %s", filename, e.what());
        return false;
    }
}

void LightPathRecorder::merge_streams(
    LightPathStream&    dest,
    LightPathStream&    source)
{
    const size_t old_size = dest.m_paths.size();

    dest.m_paths.insert(
        dest.m_paths.end(),
        source.m_paths.begin(),
        source.m_paths.end());

    clear_release_memory(source.m_paths);

    const auto vertex_index_shift = static_cast<std::uint32_t>(dest.m_vertices.size());

    for (size_t i = old_size, e = dest.m_paths.size(); i < e; ++i)
    {
        dest.m_paths[i].m_vertex_begin_index += vertex_index_shift;
        dest.m_paths[i].m_vertex_end_index += vertex_index_shift;
    }

    dest.m_vertices.insert(
        dest.m_vertices.end(),
        source.m_vertices.begin(),
        source.m_vertices.end());

    clear_release_memory(source.m_vertices);
}

}   // namespace renderer


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Antonio's Bootstrap</title>

    <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <link href="css/freelancer.min.css" rel="stylesheet">

    <link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css">

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation Menu
                </button>
                ITE3

                        Portfolio

                        About Me

                        Information

                        Robles, Antonio Felipe II A.

                        Web Developer - Graphic Artist - User Experience Designer

Portfolio

Foods Delight

Resume

The Coffee Shop

The Cordillera

Blogs

FAST Food

About

I am 21 years of age and a student of the University of the Cordilleras.  I am currently studying the course of IT (Information Technology) with a major of Web Technologies.

I came from the US and stayed there for 5 years.  I stayed in the county of Dallas, TX and the city of Garland, TX.

Contact Me

                    <form name="sentMessage" id="contactForm" novalidate>

                                Name
                                <input type="text" class="form-control" placeholder="Name" id="name" required data-validation-required-message="Please enter your name.">

Robles, Antonio Felipe II A.

                                Email Address
                                <input type="email" class="form-control" placeholder="Email Address" id="email" required data-validation-required-message="Please enter your email address.">

antonio112695@gmail.com

                                Phone Number
                                <input type="tel" class="form-control" placeholder="Phone Number" id="phone" required data-validation-required-message="Please enter your phone number.">

09955990063

                    </form>

Location

Bakakeng, Baguio City

Benguet, Philippines

Around the Web

                        Copyright © Your Website 2016

Foods Delight

Our project are mainly for students or people that are interested in cooking.  Our website will help them achieve this goal.

                Food Delights

Client:
                                    Start Bootstrap

Date:
                                    April 2014

Service:
                                    Web Development

                            <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

Resume

This is my resume.

                Resume

Client:
                                    Start Bootstrap

Date:
                                    April 2014

Service:
                                    Web Development

                            <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

Theme 1

The Coffee Shop

                Theme 1

Client:
                                    Start Bootstrap

Date:
                                    April 2014

Service:
                                    Web Development

                            <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

Theme 2

The Cordillera

                Theme 2

Client:
                                    Start Bootstrap

Date:
                                    April 2014

Service:
                                    Web Development

                            <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

Theme 3

Blogs

                Theme 3

Client:
                                    Start Bootstrap

Date:
                                    April 2014

Service:
                                    Web Development

                            <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>

Theme 4

FAST Food

                Theme 4

Client:
                                    Start Bootstrap

Date:
                                    April 2014

Service:
                                    Web Development

                            <button type="button" class="btn btn-default" data-dismiss="modal"> Close</button>


text:
using Rssdp.Infrastructure;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Rssdp
{
	public class SocketFactory : ISocketFactory
	{
		public IUdpSocket CreateUdpMulticastSocket(string ipAddress, int multicastTimeToLive, int localPort)
		{
			return new UwaUdpSocket(ipAddress, multicastTimeToLive, localPort);
		}

		public IUdpSocket CreateUdpSocket(int localPort)
		{
			return new UwaUdpSocket(localPort);
		}
	}
}


text:
{% extends "checkout/layout.html" %}
{% load currency_filters %}
{% load thumbnail %}
{% load i18n %}
{% load staticfiles %}

{% block title %}
    {% blocktrans with number=order.number %}
        Sipariş {{ number }}: onay
    {% endblocktrans %} | {{ block.super }}
{% endblock title %}

{% block checkout_nav %}
    {% include 'checkout/nav.html' with step=5 %}
{% endblock %}

{% block checkout_title %}
    {% blocktrans with number=order.number %}
        Sipariş #{{ number }}: onay
    {% endblocktrans %}
{% endblock %}

{% block content %}

        {% blocktrans with number=order.number %}
        Siparişiniz alındı. Sipariş numaranız:
        {{ number }}.
        {% endblocktrans %}
        {% trans "Please make a note of this reference or print this page and quote it in any communication with us regarding your order." %}

            {% block shipping_info %}

{% trans "Shipping" %}

{% trans "Address" %}

                    {% if order.shipping_address %}
                        <address>
                            {% for field in order.shipping_address.active_address_fields %}
                                {{ field }}

                            {% endfor %}
                        </address>

                        {% if order.shipping_address.phone_number %}

{% trans "Contact" %}

                                {% trans "Phone" %}: {{ order.shipping_address.phone_number }}
                                {% if order.guest_email %}

{% trans "Email" %}: {{ order.guest_email }}
                                {% endif %}

                        {% endif %}

                        {% if order.shipping_address.notes %}

{% trans "Instructions" %}

{{ order.shipping_address.notes|linebreaks }}

                        {% endif %}
                    {% else %}

{% trans "No shipping address required." %}

                    {% endif %}

{% trans "Shipping method" %}

{{ order.shipping_method }}

            {% endblock %}

            {% block payment_info %}

{% trans "Payment" %}

{% trans "Payment" %}

                    {% for source in order.sources.all %}

                        {% if source.reference %}
                            {% blocktrans with amount=source.amount_allocated|currency:source.currency type=source.source_type.name reference=source.reference %}
                                Allocation of {{ amount }} from type {{ type }} (reference: {{ reference }})
                            {% endblocktrans %}
                        {% else %}
                            {% blocktrans with amount=source.amount_allocated|currency:source.currency type=source.source_type.name %}
                                Allocation of {{ amount }} from type {{ type }}
                            {% endblocktrans %}
                        {% endif %}

                    {% empty %}

                        {% trans "No payment was required for this order." %}

                    {% endfor %}

                    {% if order.billing_address %}

{% trans "Billing address" %}

                        <address>
                            {% for field in order.billing_address.active_address_fields %}
                                {{ field }}

                            {% endfor %}
                        </address>
                    {% endif %}

            {% endblock %}

{% trans "Order contents" %}

{% trans "Items purchased" %}

{% trans "Quantity" %}

{% trans "Total" %}

    {% for line in order.lines.all %}

                        {% with image=line.product.primary_image %}
                            {% thumbnail image.original "200x200" upscale=False as thumb %}

                            {% endthumbnail %}
                        {% endwith %}

{{ line.description }}

                    {% if line.upc %}{{ line.upc }}
{% endif %}
                    {% if line.est_dispatch_date %}
                        {% blocktrans with date=line.est_dispatch_date %}
                            Estimated dispatch: {{ date }}
                        {% endblocktrans %}
                    {% endif %}

                    {{ line.quantity }}

                        {% if show_tax_separately %}
                            {{ line.line_price_before_discounts_excl_tax|currency:order.currency }}
                        {% else %}
                            {{ line.line_price_before_discounts_incl_tax|currency:order.currency }}
                        {% endif %}

    {% endfor %}

    {% block basket_totals %}

{% trans 'Totals' %}

{% trans "Basket" %}

                        {% with discounts=order.basket_discounts %}
                            {% block discount_totals %}
                                {% if discounts %}

                                        {% trans "Basket total (before discounts)" %}
                                        {{ order.basket_total_before_discounts_incl_tax|currency:order.currency }}

                                    {% for discount in discounts %}

                                            {% trans "Discount" %} {{ discount.offer }}
                                            - {{ discount.amount|currency:order.currency }}

                                    {% endfor %}
                                {% endif %}
                            {% endblock discount_totals %}

                            {% block basket_total %}
                                {% if discounts %}

                                        {% trans "Basket total (after discounts)" %}
                                        {{ order.basket_total_incl_tax|currency:order.currency }}

                                {% else %}

                                        {% trans "Basket total" %}

                                            {% if show_tax_separately %}
                                                {{ order.basket_total_excl_tax|currency:order.currency }}
                                            {% else %}
                                                {{ order.basket_total_incl_tax|currency:order.currency }}
                                            {% endif %}

                                {% endif %}
                            {% endblock basket_total %}
                        {% endwith %}

                        {% block shipping_total %}

{% trans "Shipping" %}

                                {% trans "Shipping method" %}
                                {{ order.shipping_method }}

                            {% if order.has_shipping_discounts %}

                                    {% trans "Shipping charge (before discounts)" %}
                                    {{ order.shipping_before_discounts_incl_tax|currency:order.currency }}

                                {% for discount in order.shipping_discounts %}

                                        {% trans "Discount" %} {{ discount.offer }}
                                        - {{ discount.amount|currency:order.currency }}

                                {% endfor %}

                                    {% trans "Shipping charge (after discounts)" %}
                                    {{ order.shipping_incl_tax|currency:order.currency }}

                            {% else %}

                                    {% trans "Shipping charge" %}

                                        {% if show_tax_separately %}
                                            {{ order.shipping_excl_tax|currency:order.currency }}
                                        {% else %}
                                            {{ order.shipping_incl_tax|currency:order.currency }}
                                        {% endif %}

                            {% endif %}
                        {% endblock shipping_total %}

                        {% if show_tax_separately %}

                                {% trans "Order tax" %}

                                    {{ order.total_tax|currency:order.currency }}

                        {% endif %}

                      {% comment %}  {% block post_order_action_totals %}
                            {% with actions=order.post_order_actions %}
                                {% if actions %}

{% trans "Post order actions" %}

                                    {% for action in order.post_order_actions %}

{{ action.message }}

                                    {% endfor %}
                                {% endif %}
                            {% endwith %}
                        {% endblock post_order_action_totals %} {% endcomment %}

                        {% block order_total %}

{% trans "Order total" %}

{{ order.total_incl_tax|currency:order.currency }}

                        {% endblock order_total %}

    {% endblock basket_totals %}

   {% comment %} {% block order_tracking %}
        {% if not order.user %}

{% trans "Tracking your order" %}

{% trans "You can track the status of your order" %}

            {% trans "View order status" %}.
        {% endif %}
    {% endblock %} {% endcomment %}

    {% block order_actions %}

{% trans "Print this page" %}

{% trans "Continue shopping" %}

    {% endblock order_actions %}
{% endblock content %}

{% block tracking %}
    {% include "partials/google_analytics_transaction.html" %}
{% endblock %}


text:
import React from 'react';
import { connect } from 'react-redux';

import { MainContentUi } from '../components';

import {
  fetchCustomerWithDetails,
  fetchCustomersWithDetails
} from '../redux/modules/customers';

import { fetchServicesIfNeeded } from '../redux/modules/services';

// The main content container (the whole page under authentication).
const MainContent = React.createClass({
  propTypes: {
    services: React.PropTypes.array.isRequired
  },
  componentDidMount: function() {
    this.props.dispatch(fetchServicesIfNeeded());
  },
  render: function() {
    return (
      <MainContentUi
        fetchCustomer={fetchCustomerWithDetails}
        fetchCustomers={fetchCustomersWithDetails}
        services={this.props.services}>
        {this.props.children}
      </MainContentUi>
    );
  }
});

function mapStateToProps(state) {
  const services = state.services;

  return {
    services: services.get('serviceList').toJS().map(el => el.name)
  };
}

export default connect(mapStateToProps)(MainContent);


text:
import * as React from 'react';
import { StandardProps } from '..';
import { Padding, Size } from '../Table';

export { Padding, Size };

/**
 * `<TableCell>` will be rendered as an `<th>`or `<td>` depending
 * on the context it is used in. Where context literally is the
 * React `context`.
 *
 * Since it is not decided via prop, we have create loose typings
 * here.
 */
export interface TableCellProps
  extends StandardProps<TableCellBaseProps, TableCellClassKey, 'align'> {
  /**
   * Set the text-align on the table cell content.
   *
   * Monetary or generally number fields **should be right aligned** as that allows
   * you to add them up quickly in your head without having to worry about decimals.
   */
  align?: 'inherit' | 'left' | 'center' | 'right' | 'justify';
  /**
   * The table cell contents.
   */
  children?: React.ReactNode;
  /**
   * The component used for the root node.
   * Either a string to use a HTML element or a component.
   */
  component?: React.ElementType<TableCellBaseProps>;
  /**
   * Sets the padding applied to the cell.
   * By default, the Table parent component set the value (`normal`).
   * `default` is deprecated, use `normal` instead.
   */
  padding?: Padding;
  /**
   * Set scope attribute.
   */
  scope?: TableCellBaseProps['scope'];
  /**
   * Specify the size of the cell.
   * By default, the Table parent component set the value (`medium`).
   */
  size?: Size;
  /**
   * Set aria-sort direction.
   */
  sortDirection?: SortDirection;
  /**
   * Specify the cell type.
   * By default, the TableHead, TableBody or TableFooter parent component set the value.
   */
  variant?: 'head' | 'body' | 'footer';
}

export type TableCellBaseProps = React.ThHTMLAttributes<HTMLTableHeaderCellElement> &
  React.TdHTMLAttributes<HTMLTableDataCellElement>;

export type SortDirection = 'asc' | 'desc' | false;

export type TableCellClassKey =
  | 'root'
  | 'head'
  | 'body'
  | 'footer'
  | 'alignLeft'
  | 'alignCenter'
  | 'alignRight'
  | 'alignJustify'
  | 'sizeSmall'
  | 'paddingCheckbox'
  | 'paddingNone'
  | 'stickyHeader';

/**
 * The component renders a `<th>` element when the parent context is a header
 * or otherwise a `<td>` element.
 * Demos:
 *
 * - [Tables](https://mui.com/components/tables/)
 *
 * API:
 *
 * - [TableCell API](https://mui.com/api/table-cell/)
 */
export default function TableCell(props: TableCellProps): JSX.Element;