text:
package com.hetekivi.rasian.Activities;

import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.*;
import com.hetekivi.rasian.Data.Global;
import com.hetekivi.rasian.Data.RSS.FeedCollection;
import com.hetekivi.rasian.Interfaces.Storable;
import com.hetekivi.rasian.R;
import com.hetekivi.rasian.Tasks.LoadTask;
import com.hetekivi.rasian.Tasks.SaveTask;
import com.hetekivi.rasian.Tasks.UpdateTask;
import net.rdrei.android.dirchooser.DirectoryChooserActivity;
import net.rdrei.android.dirchooser.DirectoryChooserConfig;
import org.joda.time.DateTime;

import java.io.File;

import static com.hetekivi.rasian.Data.Global.*;

/**
 * Activity Settings
 * for managing settings.
 */
public class SettingsActivity extends AppCompatActivity implements Storable {

    private static final String TAG = "SettingsActivity";
    public static Context context;
    public static final int REQUEST_DIRECTORY = 1;

    /**
     * Activity's own UI elements.
     */
    private EditText delay;
    private EditText limit;
    private Button selectDownloadDir;
    private TextView downloadDir;
    private Toolbar toolbar;
    private TextView nextUpdate;
    private Button save;

    private TableRow downloadDirTitleRow;
    private TableRow downloadDirRow;

    /**
     * Background colors for fields.
     */
    private int colorDefault;
    private int colorError;

    /**
     * Function onCreate
     * gets called when activity is created.
     * @param savedInstanceState Bundle containing saved instance state.
     */
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        context = this;
        setContentView(R.layout.activity_settings);
        this.colorError = ContextCompat.getColor(this, R.color.colorError);
        this.colorDefault = Color.TRANSPARENT;
        this.UIMake();
    }

    /**
     * Function firstTime
     * gets run on first time when app starts.
     */
    @Override
    protected void onResume()
    {
        super.onResume();
        Message.UpdateContext(context);
        int downloadVisibility = (WRITE_EXTERNAL_STORAGE())?View.VISIBLE:View.GONE;
        this.downloadDirTitleRow.setVisibility(downloadVisibility);
        this.downloadDirRow.setVisibility(downloadVisibility);
    }

    /**
     * Function UIMake
     * for making and linking
     * UI elements.
     */
    private void UIMake()
    {
        this.UIMakeSelect();
        this.UIMakeSetValues();
        this.UIMakeSetActions();
    }

    /**
     * Function UIReset
     * for resetting UI
     * element values.
     */
    private void UIReset()
    {
        this.UIMakeSetValues();
    }

    /**
     * Function UIMakeSelect
     * for linking UI elements to
     * class methods.
     */
    private void UIMakeSelect()
    {
        this.delay                  = (EditText) findViewById(R.id.ActivitySettingDelay);
        this.limit                  = (EditText) findViewById(R.id.ActivitySettingLimit);
        this.toolbar                = (Toolbar) findViewById(R.id.ActivitySettingsToolbar);
        this.nextUpdate             = (TextView) findViewById(R.id.ActivitySettingNextUpdate);
        this.save                   = (Button) findViewById(R.id.ActivitySettingSave);
        this.downloadDir            = (TextView) findViewById(R.id.ActivitySettingDownloadDir);
        this.selectDownloadDir      = (Button) findViewById(R.id.ActivitySettingsDownloadDirButton);
        this.downloadDirTitleRow    = (TableRow) findViewById(R.id.ActivitySettingDownloadDirTitleRow);
        this.downloadDirRow         = (TableRow) findViewById(R.id.ActivitySettingDownloadDirRow);
    }

    /**
     * Function UIMakeSetValues
     * for setting UI element's values.
     * (titles, images...)
     */
    private void UIMakeSetValues()
    {
        new LoadTask(this).execute();
    }

    /**
     * Function UIMakeSetActions
     * for setting actions and listeners
     * to UI elements.
     */
    private void UIMakeSetActions()
    {
        setSupportActionBar(this.toolbar);
        ActionBar actionBar = getSupportActionBar();
        if (actionBar != null) {
            // Show the Up button in the action bar.
            actionBar.setDisplayHomeAsUpEnabled(true);
        }
        this.selectDownloadDir.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                selectDirectory();
            }
        });
        this.save.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                onSaveClick();
            }
        });

    }

    /**
     * Function selectDirectory
     * for starting activity for selecting directory.
     */
    private void selectDirectory()
    {
        final Intent chooserIntent = new Intent(this, DirectoryChooserActivity.class);

        final DirectoryChooserConfig config = DirectoryChooserConfig.builder()
                .newDirectoryName(Resource.String(R.string.DownloadDirectory))
                .allowReadOnlyDirectory(true)
                .allowNewDirectoryNameModification(true)
                .build();
        chooserIntent.putExtra(DirectoryChooserActivity.EXTRA_CONFIG, config);
        startActivityForResult(chooserIntent, REQUEST_DIRECTORY);
    }

    /**
     * Function onActivityResult
     * as listener for when activity returns with result.
     * @param requestCode Code for request.
     * @param resultCode Code for result.
     * @param data Data for activity.
     */
    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);

        if (requestCode == REQUEST_DIRECTORY) {
            if (resultCode == DirectoryChooserActivity.RESULT_CODE_DIR_SELECTED) {
                setDirectory(data.getStringExtra(DirectoryChooserActivity.RESULT_SELECTED_DIR));
            }
        }
    }

    /**
     * Function setDirectory
     * for setting given string as download directory if it is path to directory.
     * @param directory Path to directory.
     */
    private void setDirectory(String directory) {
        if(directory != null)
        {
            File dir = new File(directory);
            if(dir.exists() && dir.isDirectory())
            {
                this.downloadDir.setText(directory);
            }
        }
    }

    /**
     * Function onSaveClick
     * that gets called when save button was pressed.
     */
    private void onSaveClick()
    {
        new SaveTask(this).execute();
    }

    /**
     * Function getNextUpdate
     * for getting text for nextUpdate field.
     * @return Formatted text for next update.
     */
    private String getNextUpdate()
    {
        DateTime dateTime = Feeds.NextUpdate;
        String text = "";
        if(dateTime != null)
        {
            text = getString(R.string.NextUpdate_START);
            String date = android.text.format.DateFormat.getDateFormat(getApplicationContext()).format(dateTime.toDate());
            String time = android.text.format.DateFormat.getTimeFormat(getApplicationContext()).format(dateTime.toDate());
            text += date + " " + time;
        }
        return text;
    }

    /**
     * Function SaveAll
     * for saving all values.
     * @return Success of save.
     */
    private boolean SaveAll()
    {
        boolean success = this.saveDelay();
        success = this.saveRowLimit() && success;
        success = this.saveDownloadDir() && success;
        return success;
    }

    /**
     * Function getUnsignedInt
     * for getting unsigned int from EditText.
     * @param editText Field to get int from.
     * @return Fields value as int or -1 if failed.
     */
    private int getUnsignedInt(EditText editText)
    {
        int value;
        String str = editText.getText().toString();
        if(str.isEmpty())
        {
            value = 0;
            editText.setText("0");
        }
        else
        {
            try
            {
                value = Integer.parseInt(editText.getText().toString());
            }catch (NumberFormatException ex)
            {
                value = -1;
            }
        }
        return value;
    }

    /**
     * Function saveDelay
     * for saving update delay.
     * @return Success of save.
     */
    private boolean saveDelay()
    {
        runOnUiThread(new Runnable() {
            @Override
            public void run() {
                delay.setBackgroundColor(colorDefault);
            }
        });
        String value = this.downloadDir.getText().toString();
        if(!value.isEmpty())
        {
            File dir = new File(value);
            if(dir.exists() && dir.isDirectory())
            {
                Feeds.downloadDir = dir;
                return Preference.Set(FeedCollection.PREF_DOWNLOAD_DIR, value);
            }

        }
        runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    delay.setBackgroundColor(colorError);
                }
            });
        return false;
    }

    /**
     * Function for saving Download Directory
     * @return
     */
    private boolean saveDownloadDir()
    {
        runOnUiThread(new Runnable() {
            @Override
            public void run() {
                delay.setBackgroundColor(colorDefault);
            }
        });
        int value = this.getUnsignedInt(this.delay);
        if(value >= 0)
        {
            Global.Feeds.setAlarm(value);
            return Preference.Set(FeedCollection.PREF_DELAY_HOURS, value);
        }
        else
        {
            runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    downloadDir.setBackgroundColor(colorError);
                }
            });
            return false;
        }
    }

    /**
     * Function saveRowLimit
     * for saving row limit.
     * @return Success of save.
     */
    private boolean saveRowLimit()
    {
        runOnUiThread(new Runnable() {
            @Override
            public void run() {
                limit.setBackgroundColor(colorDefault);
            }
        });
        int value = this.getUnsignedInt(this.limit);
        if(value >= 0)
        {
            Global.Feeds.RowLimit = value;
            new UpdateTask(Feeds).execute();
            return Preference.Set(FeedCollection.PREF_ROW_LIMIT, value);
        }
        else
        {
            runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    limit.setBackgroundColor(colorError);
                }
            });
            return false;
        }
    }

    /**
     * Function Load
     * for loading data to fields.
     * @return Success of load.
     */
    @Override
    public boolean Load() {
        final String delayText          = String.valueOf(Preference.Get(FeedCollection.PREF_DELAY_HOURS,
                FeedCollection.DEFAULT_DELAY_HOURS));
        final String limitText          = String.valueOf(Preference.Get(FeedCollection.PREF_ROW_LIMIT,
                FeedCollection.DEFAULT_ROW_LIMIT));
        final String downloadDirText    = Preference.Get(FeedCollection.PREF_DOWNLOAD_DIR,
                FeedCollection.DEFAULT_DOWNLOAD_DIR);

        final String nextUpdateText = this.getNextUpdate();
        runOnUiThread(new Runnable() {
            @Override
            public void run() {
                delay.setText(delayText);
                limit.setText(limitText);
                nextUpdate.setText(nextUpdateText);
                downloadDir.setText(downloadDirText);
            }
        });
        return true;
    }

    /**
     * Function onLoadSuccess
     * This gets called when loading has been done and was successful.
     */
    @Override
    public void onLoadSuccess() {

    }

    /**
     * Function onLoadFailure
     * This gets called when loading has been done and there were errors.
     */
    @Override
    public void onLoadFailure() {
        Error.Long(Resource.String(R.string.Loading, R.string.failed_END));
    }

    /**
     * Function Save
     * for saving data from fields.
     * @return Success of save.
     */
    @Override
    public boolean Save() {
        return this.SaveAll();
    }

    /**
     * Function onSaveSuccess
     * This gets called when saving has been done and was successful.
     * Informing user and loading fields.
     */
    @Override
    public void onSaveSuccess() {
        Message.Long(R.string.Saved_END);
        new LoadTask(this).execute();
    }

    /**
     * Function onSaveFailure
     * This gets called when saving has been done and there were errors.
     */
    @Override
    public void onSaveFailure() {
        Error.Long(Resource.String(R.string.Saving, R.string.failed_END));
    }
}


text:
#include <assert.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>

#include <string>
#include <vector>
#include <algorithm>

#include "native_client/src/include/nacl_string.h"
#include "native_client/src/include/portability.h"
#include "native_client/src/trusted/validator/ncfileutil.h"
#include "native_client/src/trusted/validator_arm/model.h"
#include "native_client/src/trusted/validator_arm/problem_reporter.h"
#include "native_client/src/trusted/validator_arm/validator.h"

using nacl_arm_val::SfiValidator;
using nacl_arm_val::CodeSegment;
using nacl_arm_val::ProblemReporter;
using nacl_arm_val::ValidatorProblem;
using nacl_arm_val::kValidatorProblemSize;
using nacl_arm_dec::MAY_BE_SAFE;

using std::string;
using std::vector;

/*
 * Reports problems in an easily-parsed textual format, for consumption by a
 * validation-reporting script.
 *
 * The format is as follows:
 *   ncval: <hex vaddr> <decimal safety> <problem ID string> <hex ref vaddr>
 *
 * For possible safety levels, see inst_classes.h.
 *
 * For possible problem ID strings, see validator.h.
 */
class NcvalProblemReporter : public ProblemReporter {
 public:
  virtual bool should_continue() {
    // Collect *all* problems before returning!
    return true;
  }

 protected:
  virtual void ReportProblemInternal(
      uint32_t vaddr,
      nacl_arm_val::ValidatorProblem problem,
      nacl_arm_val::ValidatorProblemMethod method,
      nacl_arm_val::ValidatorProblemUserData user_data);
};

static const size_t kBufferSize = 256;

void NcvalProblemReporter::
ReportProblemInternal(uint32_t vaddr,
                      nacl_arm_val::ValidatorProblem problem,
                      nacl_arm_val::ValidatorProblemMethod method,
                      nacl_arm_val::ValidatorProblemUserData user_data) {
  char buffer[kBufferSize];
  ToText(buffer, kBufferSize, vaddr, problem, method, user_data);
  fprintf(stderr, "%s\n", buffer);
}

const uint32_t kOneGig = 1U * 1024 * 1024 * 1024;

int validate(const ncfile *ncf) {
  SfiValidator validator(
      16,  // bytes per bundle
      // TODO(cbiffle): maybe check region sizes from ELF headers?
      //                verify that instructions are in right region
      kOneGig,  // code region size
      kOneGig,  // data region size
      nacl_arm_dec::RegisterList(nacl_arm_dec::Register::Tp()),
      nacl_arm_dec::RegisterList(nacl_arm_dec::Register::Sp()));

  NcvalProblemReporter reporter;

  Elf_Shdr *shdr = ncf->sheaders;

  vector<CodeSegment> segments;
  for (int i = 0; i < ncf->shnum; i++) {
    if ((shdr[i].sh_flags & SHF_EXECINSTR) != SHF_EXECINSTR) {
      continue;
    }

    CodeSegment segment(ncf->data + (shdr[i].sh_addr - ncf->vbase),
        shdr[i].sh_addr, shdr[i].sh_size);
    segments.push_back(segment);
  }

  std::sort(segments.begin(), segments.end());

  bool success = validator.validate(segments, &reporter);
  if (!success) return 1;
  return 0;
}

int main(int argc, const char *argv[]) {
  const char *filename = NULL;

  for (int i = 1; i < argc; ++i) {
    string o = argv[i];
    if (filename != NULL) {
      // trigger error when filename is overwritten
      filename = NULL;
      break;
    }
    filename = argv[i];
  }

  if (NULL == filename) {
    fprintf(stderr, "Usage: %s <filename>\n", argv[0]);
    return 2;
  }

  ncfile *ncf = nc_loadfile(filename);
  if (!ncf) {
    fprintf(stderr, "Unable to load %s: %s\n", filename, strerror(errno));
    return 1;
  }

  // TODO(cbiffle): check OS ABI, ABI version, align mask

  int exit_code = validate(ncf);
  nc_freefile(ncf);
  return exit_code;
}

redpajama_set_name: RedPajamaGithub


text:
import material from '../vendor/material.min';
import messageCurrentTab from './common/message-current-tab';
import messages from './common/messages';
import isObject from 'lodash/isObject';
import formSerialize from 'form-serialize';
import throttle from 'lodash/throttle';

function sendMessage(message, cb) {
  if (!isObject(message)) {
    message = { message };
  }
  return chrome.runtime.sendMessage(message, cb);
}

function getOptions() {
  return new Promise(resolve => sendMessage(messages.getOptions, resolve));
}

function ensureContentScript(retry = false) {
  return new Promise((resolve, reject) => {
    messageCurrentTab(messages.status, (status) => {
      if (status === 1) {
        resolve();
      } else {
        if (retry) {
          reject()
        } else {
          chrome.tabs.executeScript(null, { file: "client.js" });
          ensureContentScript(true).then(resolve);
        }
      }
    });
  });
}

let isOn = false;

function toggleOn(turnOn) {
  ensureContentScript()
    .then(() => {
      if (turnOn === undefined) {
        turnOn = !isOn;
      }
      isOn = turnOn;
      if (isOn) {
        getOptions()
          .then(options => {
            messageCurrentTab({ message: messages.start, options })
          });
      } else {
        messageCurrentTab(messages.stop);
      }
      render();
    })
}

const setOptions = throttle(() => {
  const options = formSerialize(els.optionsForm, { hash: true });
  sendMessage({ message: messages.setOptions, options });
  refresh();
}, 100);

function refresh() {
  toggleOn(isOn);
}

let els;

function bindClicks() {
  els = {
    onOff: document.getElementById('switch-on-off'),
    optionsForm: document.getElementById('options-form'),
    colorTypeFull: document.getElementById('color-type-full'),
    colorTypeSingle: document.getElementById('color-type-single'),
    colorValue: document.getElementById('color-value'),
    colorBackground: document.getElementById('color-background')
  };

  els.onOff.addEventListener('change', e => toggleOn(e.target.checked));
  els.optionsForm.addEventListener('change', setOptions);
  els.optionsForm.addEventListener('input', setOptions);
}

function setBadge(isOn) {
  chrome.tabs.query({ active: true, currentWindow: true }, function(tabs) {
    var tabId = tabs[0].id;
    const path = isOn ? '../assets/icon_active.png' : '../assets/icon.png';
    chrome.browserAction.setIcon({ path, tabId })
  });
}

function render() {
  getOptions()
    .then(options => {
      setBadge(isOn);

      els.onOff.checked = isOn;
      els.colorValue.value = options.colorValue;
      if (options.colorType === 'single') {
        els.colorTypeSingle.parentElement.MaterialRadio.check();
        els.colorTypeFull.parentElement.MaterialRadio.uncheck();
      } else {
        els.colorTypeSingle.parentElement.MaterialRadio.uncheck();
        els.colorTypeFull.parentElement.MaterialRadio.check();
      }
      els.colorBackground.value = options.background;
    });
}

document.addEventListener('DOMContentLoaded', ()=> {
  bindClicks();
  toggleOn();
  render();
});


text:
"use strict";

// spec.js
describe('Protractor Demo App', function() {

  it('Prenom vide', function() {
    browser.get('http://localhost:9000/#/register');

    element(by.model('user.nom')).sendKeys("moi");
    element(by.id('inscription')).click();
    expect(element(by.model('user.nom') ).getAttribute('class')).toMatch('ng-valid');
    expect(element(by.model('user.prenom') ).getAttribute('class')).toMatch('ng-invalid');

  });

    it('Valide', function() {
    browser.get('http://localhost:9000/#/register');

    element(by.model('user.nom')).sendKeys("mon nom");
    element(by.model('user.prenom')).sendKeys("mon prenom");
    element(by.model('user.email')).sendKeys("toto@email.com");
    element(by.model('user.password')).sendKeys("toto");
    element(by.model('passwordConfirm')).sendKeys("toto");
    element(by.id('inscription')).click();

    expect(element(by.model('user.nom') ).getAttribute('class')).toMatch('ng-valid');
    expect(element(by.model('user.prenom') ).getAttribute('class')).toMatch('ng-valid');
    expect(element(by.model('user.email') ).getAttribute('class')).toMatch('ng-valid');
    expect(element(by.model('user.password') ).getAttribute('class')).toMatch('ng-valid');
    expect(element(by.model('passwordConfirm') ).getAttribute('class')).toMatch('ng-valid');

  });

   it('Mot de passe invalide', function() {
    browser.get('http://localhost:9000/#/register');

    element(by.model('user.nom')).sendKeys("mon nom");
    element(by.model('user.prenom')).sendKeys("mon prenom");
    element(by.model('user.email')).sendKeys("toto@email.com");
    element(by.model('user.password')).sendKeys("toto");
    element(by.model('passwordConfirm')).sendKeys("toto2");
    element(by.id('inscription')).click();

    expect(element(by.model('user.nom') ).getAttribute('class')).toMatch('ng-valid');
    expect(element(by.model('user.prenom') ).getAttribute('class')).toMatch('ng-valid');
    expect(element(by.model('user.email') ).getAttribute('class')).toMatch('ng-valid');
    expect(element(by.model('user.password') ).getAttribute('class')).toMatch('ng-valid');
    expect(element(by.model('passwordConfirm') ).getAttribute('class')).toMatch('ng-invalid');

  });
});


text:
package laol.ast;

import apfe.runtime.Sequence;
import laol.ast.etc.IStatementModifier;

/**
 *
 * @author gburdell
 */
public class ThrowStatement extends Item implements IStatementModifier {
    public ThrowStatement(final laol.parser.apfe.ThrowStatement decl) {
        super(decl);
        final Sequence seq = asSequence();
        m_expr = createItem(seq, 1);
        m_stmtModifier = getStatementModifier(seq, 2);
    }

    public Expression getExpr() {
        return m_expr;
    }

    @Override
    public StatementModifier getStmtModifier() {
        return m_stmtModifier;
    }

    private final Expression m_expr;
    private final StatementModifier m_stmtModifier;
}


text:
============
Django Steps
============

.. image:: https://img.shields.io/pypi/v/django-steps.svg
   :target: https://pypi.python.org/pypi/django-steps

.. image:: https://img.shields.io/pypi/l/django-steps.svg
   :target: https://pypi.python.org/pypi/django-steps

.. image:: https://img.shields.io/travis/MarkusH/django-steps.svg
   :target: https://travis-ci.org/MarkusH/django-steps

**django-steps** is a reusable Django application to easily combine multiple
views as steps in a process.


text:
module Microformats2
  class Parser
    attr_reader :http_headers, :http_body

    def initialize
      @http_headers = {}
    end

    def parse(html, headers={})
      html = read_html(html, headers)
      document = Nokogiri::HTML(html)
      Collection.new(document).parse
    end

    def read_html(html, headers={})
      open(html, headers) do |response|
        @http_headers = response.meta if response.respond_to?(:meta)
        @http_body = response.read
      end
      @http_body
    rescue Errno::ENOENT, Errno::ENAMETOOLONG => e
      @http_body = html
    end
  end
end


text:
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.2">
  <compounddef id="d8/da2/pycode_8h" kind="file">
    <compoundname>pycode.h</compoundname>
      <sectiondef kind="func">
      <memberdef kind="function" id="d8/da2/pycode_8h_1a6d00b23c0ae8938d91cf6f678c80e8fc" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void parsePythonCode</definition>
        <argsstring>(CodeOutputInterface &, const char *, const QCString &, bool, const char *, FileDef *fd, int startLine, int endLine, bool inlineFragment, MemberDef *memberDef, bool showLineNumbers, Definition *searchCtx)</argsstring>
        <name>parsePythonCode</name>
        <param>
          <type><ref refid="d5/d9c/class_code_output_interface" kindref="compound">CodeOutputInterface</ref> &</type>
        </param>
        <param>
          <type>const char *</type>
        </param>
        <param>
          <type>const QCString &</type>
        </param>
        <param>
          <type>bool</type>
        </param>
        <param>
          <type>const char *</type>
        </param>
        <param>
          <type><ref refid="de/db0/class_file_def" kindref="compound">FileDef</ref> *</type>
          <declname>fd</declname>
        </param>
        <param>
          <type>int</type>
          <declname>startLine</declname>
        </param>
        <param>
          <type>int</type>
          <declname>endLine</declname>
        </param>
        <param>
          <type>bool</type>
          <declname>inlineFragment</declname>
        </param>
        <param>
          <type><ref refid="da/d09/class_member_def" kindref="compound">MemberDef</ref> *</type>
          <declname>memberDef</declname>
        </param>
        <param>
          <type>bool</type>
          <declname>showLineNumbers</declname>
        </param>
        <param>
          <type><ref refid="d5/dcc/class_definition" kindref="compound">Definition</ref> *</type>
          <declname>searchCtx</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Users/Mat/Projects/doxygraph/examples/doxygen-1.8.4/src/pycode.h" line="37"/>
      </memberdef>
      <memberdef kind="function" id="d8/da2/pycode_8h_1a9ee8cc9c825a96efb6bd4193244b019f" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void resetPythonCodeParserState</definition>
        <argsstring>()</argsstring>
        <name>resetPythonCodeParserState</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Users/Mat/Projects/doxygraph/examples/doxygen-1.8.4/src/pycode.h" line="38"/>
      </memberdef>
      </sectiondef>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"><highlight class="comment"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="17"><highlight class="normal"></highlight><highlight class="comment">/*<sp/><sp/>This<sp/>code<sp/>is<sp/>based<sp/>on<sp/>the<sp/>work<sp/>done<sp/>by<sp/>the<sp/>MoxyPyDoxy<sp/>team</highlight></codeline>
<codeline lineno="18"><highlight class="comment"><sp/>*<sp/><sp/>(Linda<sp/>Leong,<sp/>Mike<sp/>Rivera,<sp/>Kim<sp/>Truong,<sp/>and<sp/>Gabriel<sp/>Estrada)</highlight></codeline>
<codeline lineno="19"><highlight class="comment"><sp/>*<sp/><sp/>in<sp/>Spring<sp/>2005<sp/>as<sp/>part<sp/>of<sp/>CS<sp/>179E:<sp/>Compiler<sp/>Design<sp/>Project</highlight></codeline>
<codeline lineno="20"><highlight class="comment"><sp/>*<sp/><sp/>at<sp/>the<sp/>University<sp/>of<sp/>California,<sp/>Riverside;<sp/>the<sp/>course<sp/>was</highlight></codeline>
<codeline lineno="21"><highlight class="comment"><sp/>*<sp/><sp/>taught<sp/>by<sp/>Peter<sp/>H.<sp/>Froehlich<sp/><phf@acm.org>.</highlight></codeline>
<codeline lineno="22"><highlight class="comment"><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="23"><highlight class="normal"></highlight></codeline>
<codeline lineno="24"><highlight class="normal"></highlight></codeline>
<codeline lineno="25"><highlight class="normal"></highlight><highlight class="preprocessor">#ifndef<sp/>PYCODE_H</highlight></codeline>
<codeline lineno="26"><highlight class="preprocessor"></highlight><highlight class="preprocessor">#define<sp/>PYCODE_H</highlight></codeline>
<codeline lineno="27"><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="28"><highlight class="normal"></highlight><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="d5/d9c/class_code_output_interface" kindref="compound" tooltip="Output interface for code parser.">CodeOutputInterface</ref>;</highlight></codeline>
<codeline lineno="29"><highlight class="normal"></highlight><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="de/db0/class_file_def" kindref="compound" tooltip="A model of a file symbol.">FileDef</ref>;</highlight></codeline>
<codeline lineno="30"><highlight class="normal"></highlight><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="da/d09/class_member_def" kindref="compound" tooltip="A model of a class/file/namespace member symbol.">MemberDef</ref>;</highlight></codeline>
<codeline lineno="31"><highlight class="normal"></highlight><highlight class="keyword">class<sp/></highlight><highlight class="normal">QCString;</highlight></codeline>
<codeline lineno="32"><highlight class="normal"></highlight><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="d5/dcc/class_definition" kindref="compound" tooltip="The common base class of all entity definitions found in the sources.">Definition</ref>;</highlight></codeline>
<codeline lineno="33"><highlight class="normal"></highlight></codeline>
<codeline lineno="34"><highlight class="normal"></highlight><highlight class="keyword">extern</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>parsePythonCode(<ref refid="d5/d9c/class_code_output_interface" kindref="compound" tooltip="Output interface for code parser.">CodeOutputInterface</ref><sp/>&,</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*,</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>QCString<sp/>&,<sp/></highlight></codeline>
<codeline lineno="35"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/>,</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*,<ref refid="de/db0/class_file_def" kindref="compound" tooltip="A model of a file symbol.">FileDef</ref><sp/>*fd,</highlight></codeline>
<codeline lineno="36"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>startLine,</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>endLine,</highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/>inlineFragment,</highlight></codeline>
<codeline lineno="37"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="da/d09/class_member_def" kindref="compound" tooltip="A model of a class/file/namespace member symbol.">MemberDef</ref><sp/>*memberDef,</highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/>showLineNumbers,<ref refid="d5/dcc/class_definition" kindref="compound" tooltip="The common base class of all entity definitions found in the sources.">Definition</ref><sp/>*searchCtx);</highlight></codeline>
<codeline lineno="38"><highlight class="normal"></highlight><highlight class="keyword">extern</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>resetPythonCodeParserState();</highlight></codeline>
<codeline lineno="39"><highlight class="normal"></highlight></codeline>
<codeline lineno="40"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight></codeline>
    </programlisting>
    <location file="C:/Users/Mat/Projects/doxygraph/examples/doxygen-1.8.4/src/pycode.h"/>
  </compounddef>
</doxygen>


text:
using base::DictionaryValue;
using base::Value;

namespace webdriver {

namespace {

// Error message taken from:
// http://code.google.com/p/selenium/wiki/JsonWireProtocol#Response_Status_Codes
const char kStatusKey[] = "status";
const char kValueKey[] = "value";
const char kMessageKey[] = "message";

}  // namespace

Response::Response() {
  SetStatus(kSuccess);
  SetValue(new DictionaryValue());
}

Response::~Response() {}

ErrorCode Response::GetStatus() const {
  int status;
  if (!data_.GetInteger(kStatusKey, &status))
    NOTREACHED();
  return static_cast<ErrorCode>(status);
}

void Response::SetStatus(ErrorCode status) {
  data_.SetInteger(kStatusKey, status);
}

const Value* Response::GetValue() const {
  Value* out = NULL;
  data_.Get(kValueKey, &out);
  return out;
}

void Response::SetValue(Value* value) {
  data_.Set(kValueKey, value);
}

void Response::SetError(Error* error) {
  DictionaryValue* error_dict = new DictionaryValue();
  error_dict->SetString(kMessageKey, error->details());

  SetStatus(error->code());
  SetValue(error_dict);
  delete error;
}

void Response::SetField(const std::string& key, Value* value) {
  data_.Set(key, value);
}

const Value* Response::GetDictionary() const {
  return &data_;
}

std::string Response::ToJSON() const {
  std::string json;
  base::JSONWriter::Write(&data_, false, &json);
  return json;
}

}  // namespace webdriver


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

namespace TwitchLib.Enums
{
    ///
    /// A list of valid commercial lengths.
    ///
    public enum CommercialLength
    {
        /// 30 second commercial
        Seconds30,
        /// 60 second commercial
        Seconds60,
        /// 90 second commercial
        Seconds90,
        /// 120 second commercial
        Seconds120,
        /// 150 second commercial
        Seconds150,
        /// 180 second commercial
        Seconds180
    }
}


text:
#include <QtGui>
#include <QtDebug>

#include "dfinstance.h"
#include "dfinstanceosx.h"
#include "defines.h"
#include "dwarf.h"
#include "utils.h"
#include "gamedatareader.h"
#include "memorylayout.h"
#include "cp437codec.h"
#include "memorysegment.h"

DFInstanceOSX::DFInstanceOSX(QObject* parent)
	: DFInstance(parent)
{
}

DFInstanceOSX::~DFInstanceOSX() {
}

QVector<uint> DFInstanceOSX::enumerate_vector(const uint &addr) {
    attach();
    QVector<uint> addrs;
    detach();
    return addrs;
}

uint DFInstanceOSX::calculate_checksum() {
    // ELF binaries don't seem to store a linker timestamp, so just MD5 the file.
    uint md5 = 0; // we're going to throw away a lot of this checksum we just need 4bytes worth
    return md5;
}

uint DFInstanceOSX::read_uint(const uint &addr) {
    uint retval = 0;
    return retval;
}

int DFInstanceOSX::read_int(const uint &addr) {
    int retval = 0;
    return retval;
}

QString DFInstanceOSX::read_string(const uint &addr) {
	QString ret_val = "FOO";
	return ret_val;
}

uint DFInstanceOSX::write_string(const uint &addr, const QString &str) {
    Q_UNUSED(addr);
    Q_UNUSED(str);
	return 0;
}

short DFInstanceOSX::read_short(const uint &addr) {
    short retval = 0;
    return retval;
}

ushort DFInstanceOSX::read_ushort(const uint &addr) {
    ushort retval = 0;
    return retval;
}

uint DFInstanceOSX::write_int(const uint &addr, const int &val) {
    return 0;
}

char DFInstanceOSX::read_char(const uint &addr) {
	char retval;
	return retval;
}

bool DFInstanceOSX::attach() {
    return true;
}

bool DFInstanceOSX::detach() {
	return true;
}

uint DFInstanceOSX::read_raw(const uint &addr, const uint &bytes, void *buffer) {
    return 0;
}

uint DFInstanceOSX::write_raw(const uint &addr, const uint &bytes, void *buffer) {
    return 0;
}

bool DFInstanceOSX::find_running_copy() {
    return false;
}


text:
My approach was to find the total possible anagrams per word and find the answer based on a simple fraction scoring system.

I wrote a helper function to find the possible number of arrangements: `number_of_arrangements`

I didn't know what the math was going to look like to get this number.  For discovery I used the permutations generator in a set to find out.  I had something like this:

```python
def number_of_arrangements(word):
    from itertools import permutations

    results = len({i for i in permutations(word)})
    print results
```

I knew this wouldn't be the final solution.  As a generator it has the O^2 problem. But this helped to get the following test cases:
```python
test.assert_equals(number_of_arrangements("AAA"), 1)
test.assert_equals(number_of_arrangements("AAB"), 3)
test.assert_equals(number_of_arrangements("ABB"), 3)  # 3*1*1
test.assert_equals(number_of_arrangements("ABC"), 6)  # 3*2*1
test.assert_equals(number_of_arrangements("AAAB"), 4)  # 4
test.assert_equals(number_of_arrangements("AABC"), 12)  # 4*3*1*1
test.assert_equals(number_of_arrangements("ABCD"), 24)  # 4*3*2*1
test.assert_equals(number_of_arrangements("AABB"), 6)  #
test.assert_equals(number_of_arrangements("AAAAB"), 5)  # 5
test.assert_equals(number_of_arrangements("AAABC"), 20)  # 5*4
test.assert_equals(number_of_arrangements("AABCD"), 60)  # 5*4*3
test.assert_equals(number_of_arrangements("ABCDE"), 120)  # 5*4*3*2*1
test.assert_equals(number_of_arrangements("AAABB"), 10)  # 5*2
test.assert_equals(number_of_arrangements("AABBC"), 30)  # 5*3*2
test.assert_equals(number_of_arrangements("ABBBC"), 20)  # 5*4
```

Initially, I didn't understand the math, but I knew factorials were involved, so I wrote out the answers in factorial form. e.g.:

```python
number_of_arrangements("ABCDE") == 120 # 5*4*3*2
number_of_arrangements("AABCD") ==  60 # 5*4*3
number_of_arrangements("AABBC") ==  30 # 5  *3*2
```

After about 15 of these I understood the pattern. You group and count the non-unique digits.  Then you divide the main factorial by the factorials of those counts.

so for

```python
number_of_arrangements("AABBC") ==  30
# instead of 5*3*2 it's better represented as
# FAC(5) / (FAC(2) * FAC(2) * FAC(1))
# 5*4*3*2*1 / 2*1*2*1*1 == 5*4*3*2/2*2
```

After I rewrote this helper function I added the following test to see if I solved the O^2 problem:

```python
# refactored helper function
def number_of_arrangements(word):
    letter_counts = [factorial(word.count(i)) for i in set(word)]
    return factorial(len(word)) / reduce(mul, letter_counts)

# 0^2 test
test.assert_equals(number_of_arrangements("ABCDEFGHIJKLMNOPQRSTUVWXYZ"),
                   403291461126605635584000000)
```

If your computer freezes, then you didn't pass.  :D  The `math.factorial()` function is lightning fast.

##My final test cases:

```python
test.assert_equals(number_of_arrangements("AAA"), 1)
test.assert_equals(number_of_arrangements("AAB"), 3)
test.assert_equals(number_of_arrangements("ABB"), 3)  # 3*1*1
test.assert_equals(number_of_arrangements("ABC"), 6)  # 3*2*1
test.assert_equals(number_of_arrangements("AAAB"), 4)  # 4
test.assert_equals(number_of_arrangements("AABC"), 12)  # 4*3*1*1
test.assert_equals(number_of_arrangements("ABCD"), 24)  # 4*3*2*1
test.assert_equals(number_of_arrangements("AABB"), 6)  #
test.assert_equals(number_of_arrangements("AAAAB"), 5)  # 5
test.assert_equals(number_of_arrangements("AAABC"), 20)  # 5*4

# 5*4*3*2*1/(3*2*1*2*1) == factorial(5)/factorial(2)
test.assert_equals(number_of_arrangements("AABCD"), 60)
test.assert_equals(number_of_arrangements("ABCDE"), 120)  # 5*4*3*2*1

# 5*4*3*2*1/(3*2*1*2*1) == factorial(5)/(factorial(3)*factorial(2))
test.assert_equals(number_of_arrangements("AAABB"), 10)

# 5*4*3*2*1/(2*1*2*1*1) == factorial(5)/(factorial(2)*factorial(2))
test.assert_equals(number_of_arrangements("AABBC"), 30)
test.assert_equals(number_of_arrangements("ABBBC"), 20)  # 5*2*3
test.assert_equals(number_of_arrangements("ABCDEFGHIJKLMNOPQRSTUVWXYZ"),
                   403291461126605635584000000)

test.describe('Anagram')
test.it('Must return appropriate values for known inputs')
testValues = {'A': 1, 'ABAB': 2, 'AAAB': 1, 'BAAA': 4, 'QUESTION': 24572,
              'BOOKKEEPER': 10743}
for word in testValues:
    test.assert_equals(listPosition(word), testValues[word],
                       'Incorrect list position for: ' + word)
```

##Scoring
The scoring system based on fractions of the possible solutions was mostly trial and error.  But I was comfortable with with the test cases that the author provided.  So I didn't add any there.


text:
/* -*-  mode: c++; indent-tabs-mode: nil -*- */

/* -----------------------------------------------------------------------------
ATS

Authors: Ethan Coon (ecoon@lanl.gov)

Evaluator for enthalpy.
----------------------------------------------------------------------------- */

#ifndef AMANZI_ENTHALPY_EVALUATOR_HH_
#define AMANZI_ENTHALPY_EVALUATOR_HH_

#include "Teuchos_ParameterList.hpp"

#include "Factory.hh"
#include "EvaluatorSecondaryMonotype.hh"

namespace Amanzi {
namespace Energy {

class EnthalpyEvaluator : public EvaluatorSecondaryMonotypeCV {

 public:
  explicit
  EnthalpyEvaluator(Teuchos::ParameterList& plist);
  EnthalpyEvaluator(const EnthalpyEvaluator& other) = default;

  virtual Teuchos::RCP<Evaluator> Clone() const override;

 protected:
  // Required methods from EvaluatorSecondaryMonotypeCV
  virtual void Evaluate_(const State& S,
          const std::vector<CompositeVector*>& result) override;
  virtual void EvaluatePartialDerivative_(const State& S,
          const Key& wrt_key, const Tag& wrt_tag,
          const std::vector<CompositeVector*>& result) override;

 protected:
  Key pres_key_;
  Key dens_key_;
  Key ie_key_;
  bool include_work_;

 private:
  static Utils::RegisteredFactory<Evaluator,EnthalpyEvaluator> factory_;

};

} // namespace
} // namespace

#endif


text:
using System;

namespace Salient.ReflectiveLoggingAdapter
{
    public class LogManager
    {
        public delegate object CreateInnerLoggerDelegate(string logName, LogLevel logLevel, bool showLevel, bool showDateTime, bool showLogName,
                             string dateTimeFormat);

        static LogManager()
        {
            CreateInnerLogger  = GetInnerLogger;
        }

        public static CreateInnerLoggerDelegate CreateInnerLogger { get; set; }

        public static bool IsDebug = false;

        public static ILog GetLogger(Type type)
        {
            var inner = CreateInnerLogger(type.FullName, LogLevel.All, true, true, true, "u");
            return new LogAdapter(inner);
        }

        public static ILog GetLogger(string logName, LogLevel logLevel, bool showLevel, bool showDateTime, bool showLogName,
                             string dateTimeFormat)
        {
            var inner = CreateInnerLogger(logName, logLevel, showLevel, showDateTime, showLogName, dateTimeFormat);
            return new LogAdapter(inner);
        }

        private static object GetInnerLogger(string logName, LogLevel logLevel, bool showLevel, bool showDateTime, bool showLogName,
                             string dateTimeFormat)
        {
            return new DebugAppender(logName, logLevel, showLevel, showDateTime,showLogName, dateTimeFormat);
        }

    }
}


text:
`data.table`
============

As you may be able to guess, `data.table` is closely related to `data.frame`.
They also work in a similar way. So then, why would we want to use `data.table`?

If you have been using R for a while you will realise that R maybe slower than
SAS for data mungling. `data.table` makes use of indexing to offer "fast
subset, fast grouping, fast update, fast ordered joins...". Since `data.table`
inherits `data.frame` it supports most R functions and packages which use `data.frame`.

## Building Keys

The key item in `data.table` is the idea of having keys. You can build keys and then
query on them.

```{.r}
class <- data.table(
  sex = sample(c("M", "F"), size=19, replace=TRUE),
  age = sample(12:16, size=19, replace=TRUE),
  height = runif(n=19, min=50, max=70),
  weight = runif(n=19, min=70, max=115)
)

class["M", ] # doesn't work
setkey(class, sex)
class["M", ] # now it works
```

You can also set multiple keys.

```{.r}
setkey(class, sex, age)
class[J("M", 12),]
```

We would use the `J` function to query based on these keys. (Note: to see all your current
tables and their keys simply type `tables()` into the console).


text:
module Extensions
  module Page
    module Parse

      extend ActiveSupport::Concern

      included do
        field :serialized_template, :type => Binary
        field :template_dependencies, :type => Array, :default => []
        field :snippet_dependencies, :type => Array, :default => []

        attr_reader :template_changed

        before_validation :serialize_template
        after_save :update_template_descendants

        validate :template_must_be_valid

        scope :pages, lambda { |domain| { :any_in => { :domains => [*domain] } } }
      end

      module InstanceMethods

        def template
          @template ||= Marshal.load(read_attribute(:serialized_template).to_s) rescue nil
        end

        protected

        def serialize_template
          if self.new_record? || self.raw_template_changed?
            @template_changed = true

            @parsing_errors = []

            begin
              self._parse_and_serialize_template
            rescue ::Liquid::SyntaxError => error
              @parsing_errors << I18n.t(:liquid_syntax, :fullpath => self.fullpath, :error => error.to_s,:scope => [:errors, :messages])
            rescue ::Locomotive::Liquid::PageNotFound => error
              @parsing_errors << I18n.t(:liquid_extend, :fullpath => self.fullpath,:scope => [:errors, :messages])
            end
          end
        end

        def _parse_and_serialize_template(context = {})
          self.parse(context)
          self._serialize_template
        end

        def _serialize_template
          self.serialized_template = BSON::Binary.new(Marshal.dump(@template))
        end

        def parse(context = {})
          self.disable_all_editable_elements

          default_context = { :site => self.site, :page => self, :templates => [], :snippets => [] }

          context = default_context.merge(context)

          @template = ::Liquid::Template.parse(self.raw_template, context)

          self.template_dependencies = context[:templates]
          self.snippet_dependencies = context[:snippets]

          @template.root.context.clear
        end

        def template_must_be_valid
          @parsing_errors.try(:each) { |msg| self.errors.add :template, msg }
        end

        def update_template_descendants
          return unless @template_changed == true

          # we admit at this point that the current template is up-to-date
          template_descendants = self.site.pages.any_in(:template_dependencies => [self.id]).to_a

          # group them by fullpath for better performance
          cached = template_descendants.inject({}) { |memo, page| memo[page.fullpath] = page; memo }

          self._update_direct_template_descendants(template_descendants.clone, cached)

          # finally save them all
          ::Page.without_callback(:save, :after, :update_template_descendants) do
            template_descendants.each do |page|
              page.save(:validate => false)
            end
          end
        end

        def _update_direct_template_descendants(template_descendants, cached)
          direct_descendants = template_descendants.select do |page|
            ((self.template_dependencies || []) + [self._id]) == (page.template_dependencies || [])
          end

          direct_descendants.each do |page|
            page.send(:_parse_and_serialize_template, { :cached_parent => self, :cached_pages => cached })

            template_descendants.delete(page) # no need to loop over it next time

            page.send(:_update_direct_template_descendants, template_descendants, cached) # move down
          end
        end

      end

    end
  end
end


text:
'use strict';

var dotenv = require('dotenv');
var Alexa = require('alexa-sdk');
var TinCan = require('tincanjs');

dotenv.load();

var wsEndpoint = process.env.WS_ENDPOINT;
var wsUsername = process.env.WS_USERNAME;
var wsPassword = process.env.WS_PASSWORD;
var alexaAppId = ''; // optional

var welcomeOutput = 'Watershed is ready.';
var welcomeReprompt = 'Let me know what you want to do. ' +
    'You can say send test statement.';

var handlers = {
    'LaunchRequest': function() {
        this.emit(':ask', welcomeOutput, welcomeReprompt);
    },
    'SendTestStatementIntent': function() {
        var speechOutput = 'Sending test statement to Watershed. ';

        var statement = {
            actor: {
                mbox: 'mailto:alexa@foo.bar',
                name: 'Alexa'
            },
            verb: {
                id: 'http://activitystrea.ms/schema/1.0/send',
                display: {
                    'en-US': 'sent'
                }
            },
            target: {
                id: 'http://foo.bar/statement',
                definition: {
                    name: {
                        'en-US': 'test statement'
                    }
                }
            }
        };

        sendStatement(new TinCan.Statement(statement), function(result) {
            speechOutput += result;
            this.emit(':tell', speechOutput);
        }.bind(this));
    },
    'AMAZON.HelpIntent': function () {
        speechOutput = '';
        reprompt = '';
        this.emit(':ask', speechOutput, reprompt);
    },
    'AMAZON.CancelIntent': function () {
        speechOutput = '';
        this.emit(':tell', speechOutput);
    },
    'AMAZON.StopIntent': function () {
        speechOutput = '';
        this.emit(':tell', speechOutput);
    },
    'SessionEndedRequest': function () {
        var speechOutput = '';
        this.emit(':tell', speechOutput);
    },
};

exports.handler = (event, context) => {
    var alexa = Alexa.handler(event, context);
    alexa.appId = alexaAppId;
    // To enabled string i18n features, set a resources object.
    //alexa.resources = languageStrings;
    alexa.registerHandlers(handlers);
    alexa.execute();
};

function sendStatement(statement, callback) {
    // Connect to Watershed
    var lrs;

    try {
        lrs = new TinCan.LRS(
            {
                endpoint: wsEndpoint,
                username: wsUsername,
                password: wsPassword,
                allowFail: false
            }
        );
    } catch (ex) {
        console.log('Failed to setup LRS object: ' + ex);
        return;
    }

    // Save statement
    lrs.saveStatement(
        statement,
        {
            callback:  function (err, xhr) {
                function getResult() {
                    if (err !== null) {
                        if (xhr !== null) {
                            console.log ('Failed to save statement: ' + xhr.responseText + ' (' + xhr.status + ')');
                            return 'Failed to save statement.';
                        }
                        console.log ('Failed to save statement: ' + err);
                        return 'Failed to save statement.';
                    }
                    console.log ('Statement saved');
                    return 'Statement saved.';
                }
                callback(getResult());
            }
        }
    );
}


text:
require "rails_helper"

RSpec.describe ProductsController, :type => :controller do
  describe "GET #index" do
    it "renders the index template" do
      get :index
      expect(response).to be_success
      expect(response).to have_http_status(200)
      expect(response).to render_template("index")
    end

    it "loads all of the products into @products" do
      products = [
        FactoryGirl.create(:product),
        FactoryGirl.create(:product)
      ]
      get :index
      expect(assigns(:products)).to match_array(products)
    end
  end

  describe "GET #show" do
    it "renders show template" do
      product = FactoryGirl.create(:product)
      get :show, id: product.id
      expect(response).to be_success
      expect(response).to have_http_status(200)
      expect(response).to render_template("show")
    end

    it "loads all of the products into @products" do
      product = FactoryGirl.create(:product)
      get :show, id: product.id
      expect(assigns(:product)).to match(product)
    end
  end
end


text:
#region LICENSE
// Copyright (C) 2015 by Sherif Elmetainy (Grendiser@Kazzak-EU)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#endregion

using Newtonsoft.Json;

namespace WOWSharp.Warcraft
{
    /// <summary>
    ///   Represents information about talent points spent in a tree
    /// </summary>
    [JsonObject(MemberSerialization.OptIn)]
    public class CharacterTalent
    {
        /// <summary>
        ///   Gets or sets the tier of the talent (0-5)
        /// </summary>
        [JsonProperty(PropertyName="tier", Required = Required.Always)]
        public int Tier
        {
            get;
            set;
        }

        /// <summary>
        ///   Gets or sets the column of the talent (0-2)
        /// </summary>
        [JsonProperty(PropertyName="column", Required = Required.Always)]
        public int Column
        {
            get;
            set;
        }

        /// <summary>
        ///   Gets or sets the spell for the talent
        /// </summary>
        [JsonProperty(PropertyName="spell", Required = Required.Always)]
        public Spell Spell
        {
            get;
            set;
        }

        /// <summary>
        ///   Gets string representation (for debugging purposes)
        /// </summary>
        /// <returns> Gets string representation (for debugging purposes) </returns>
        public override string ToString()
        {
            return Spell.Name;
        }
    }
}


text:
<?php

require_once ('..\lib\jpgraph\jpgraph.php');
require_once ('..\lib\jpgraph\jpgraph_pie.php');
require_once ('..\lib\jpgraph\jpgraph_pie3d.php');
include_once ('..\database\DBManager.php');
if (empty($_SESSION['usuario'])) header("Location: login.php");
$db = new DBManager();

$camiones = $db->obtenerUsosdeCamionesEnAcualAnio();
$camionesMarcas = array();
$camionesCantUsos = array();

foreach($camiones as $camion) {
	array_push($camionesMarcas, $camion["MARCA"] . " " . $camion["MODELO"]);
	array_push($camionesCantUsos, $camion["CANT_VEHICULO_VIAJES"]);
}

$data = $camionesCantUsos;

// Create the Pie Graph.
$graph = new PieGraph(600,600);

$theme_class= new VividTheme;
$graph->SetTheme($theme_class);

// Set A title for the plot
$graph->title->Set("Camiones mas usados en el año " . date("Y"));

// Create
$p1 = new PiePlot3D($data);
$graph->Add($p1);
$p1->SetLegends($camionesMarcas);

$p1->ShowBorder();
$p1->SetColor('black');
$p1->ExplodeSlice(1);
$graph->Stroke();


text:
<?xml version="1.0" encoding="UTF-8"?>
<billStatus>
  <bill>
    <introducedDate>2017-07-26</introducedDate>
    <latestAction>
      <actionDate>2017-07-26</actionDate>
      <links />
      <text>Referred to the House Committee on Financial Services.</text>
    </latestAction>
    <billType>HR</billType>
    <billNumber>3439</billNumber>
    <recordedVotes />
    <createDate>2017-07-27T03:11:35Z</createDate>
    <actions>
      <actionByCounts>
        <houseOfRepresentatives>3</houseOfRepresentatives>
      </actionByCounts>
      <actionTypeCounts>
        <introducedInTheHouse>1</introducedInTheHouse>
        <introducedInHouse>1</introducedInHouse>
        <billReferrals>1</billReferrals>
      </actionTypeCounts>
      <item>
        <actionDate>2017-07-26</actionDate>
        <sourceSystem>
          2
          <name>House floor actions</name>
        </sourceSystem>
        <actionCode>H11100</actionCode>
        <text>Referred to the House Committee on Financial Services.</text>
        <committee>
          <systemCode>hsba00</systemCode>
          <name>Financial Services Committee</name>
        </committee>
        <links />
        <type>IntroReferral</type>
      </item>
      <item>
        <actionDate>2017-07-26</actionDate>
        <sourceSystem>
          9
          <name>Library of Congress</name>
        </sourceSystem>
        <actionCode>Intro-H</actionCode>
        <text>Introduced in House</text>
        <committee />
        <links />
        <type>IntroReferral</type>
      </item>
      <item>
        <actionDate>2017-07-26</actionDate>
        <sourceSystem>
          9
          <name>Library of Congress</name>
        </sourceSystem>
        <actionCode>1000</actionCode>
        <text>Introduced in House</text>
        <committee />
        <links />
        <type>IntroReferral</type>
      </item>
    </actions>
    <committeeReports />
    <version>1.0.0</version>
    <title>Financial Institution Security Act</title>
    <summaries>
      <billSummaries />
    </summaries>
    <relatedBills />
    <notes />
    <sponsors>
      <item>
        <state>NC</state>
        <district>9</district>
        <fullName>Rep. Pittenger, Robert [R-NC-9]</fullName>
        <firstName>Robert</firstName>
        <middleName />
        <lastName>Pittenger</lastName>
        <byRequestType />
        <party>R</party>
        <bioguideId>P000606</bioguideId>
        <identifiers>
          <bioguideId>P000606</bioguideId>
          <lisID>2141</lisID>
          <gpoId />
        </identifiers>
      </item>
    </sponsors>
    <titles>
      <item>
        <chamberName />
        <parentTitleType />
        <titleType>Short Titles as Introduced</titleType>
        <chamberCode />
        <title>Financial Institution Security Act</title>
      </item>
      <item>
        <chamberName />
        <parentTitleType />
        <titleType>Official Title as Introduced</titleType>
        <chamberCode />
        <title>To facilitate better information sharing to assist in the fight against the funding of terrorist activities, and for other purposes.</title>
      </item>
      <item>
        <chamberName />
        <parentTitleType />
        <titleType>Display Title</titleType>
        <chamberCode />
        <title>Financial Institution Security Act</title>
      </item>
      <item>
        <chamberName />
        <parentTitleType />
        <titleType>(Extracted from GPO) Short Titles as Introduced</titleType>
        <chamberCode />
        <title>Financial Institution Security Act</title>
      </item>
    </titles>
    <policyArea>
      <name>Finance and Financial Sector</name>
    </policyArea>
    <committees>
      <billCommittees>
        <item>
          <systemCode>hsba00</systemCode>
          <chamber>House</chamber>
          <name>Financial Services Committee</name>
          <subcommittees />
          <type>Standing</type>
          <activities>
            <item>
              <date>2017-07-26T14:01:35Z</date>
              <name>Referred to</name>
            </item>
          </activities>
        </item>
      </billCommittees>
    </committees>
    <constitutionalAuthorityStatementText><![CDATA[
From the Congressional Record Online through the Government Publishing Office [www.gpo.gov]By Mr. PITTENGER:H.R. 3439.Congress has the power to enact this legislation pursuantto the following:Pursuant to the Commerce Clause, Article I, Section 8,Clause 3.[Page H6467]
]]></constitutionalAuthorityStatementText>
    <calendarNumbers />
    <updateDate>2017-09-11T02:55:55Z</updateDate>
    <subjects>
      <billSubjects>
        <legislativeSubjects />
        <policyArea>
          <name>Finance and Financial Sector</name>
        </policyArea>
      </billSubjects>
    </subjects>
    <cosponsors />
    <congress>115</congress>
    <cboCostEstimates />
    <laws />
    <originChamber>House</originChamber>
    <amendments />
  </bill>
  <dublinCore xmlns:dc="http://purl.org/dc/elements/1.1/">
    <dc:format>text/xml</dc:format>
    <dc:language>EN</dc:language>
    <dc:rights>Pursuant to Title 17 Section 105 of the United States Code, this file is not subject to copyright protection and is in the public domain.</dc:rights>
    <dc:contributor>Congressional Research Service, Library of Congress</dc:contributor>
    <dc:description>This file contains bill summaries and statuses for federal legislation. A bill summary describes the most significant provisions of a piece of legislation and details the effects the legislative text may have on current law and federal programs. Bill summaries are authored by the Congressional Research Service (CRS) of the Library of Congress. As stated in Public Law 91-510 (2 USC 166 (d)(6)), one of the duties of CRS is "to prepare summaries and digests of bills and resolutions of a public general nature introduced in the Senate or House of Representatives". For more information, refer to the User Guide that accompanies this file.</dc:description>
  </dublinCore>
</billStatus>


text:
using OKHOSTING.UI.Controls;
using System;

namespace OKHOSTING.UI.RPC.Controls
{
	/// <summary>
	/// A control (not necesary a calendar, it might be a textbox) for date selection
	/// <para xml:lang="es">Un calendario para seleccion de fechas.</para>
	/// </summary>
	public class DatePicker : TextControl, IDatePicker
	{
		public DateTime? Value
		{
			get
			{
				return (DateTime?) Get(nameof(Value));
			}
			set
			{
				Set(nameof(Value), value);
			}
		}

		public event EventHandler<DateTime?> ValueChanged
		{
			add
			{
				AddHybridEventHandler(nameof(ValueChanged), value);
			}
			remove
			{
				RemoveHybridEventHandler(nameof(ValueChanged), value);
			}
		}
	}
}


text:
/* jshint expr:true */
import {
    describe,
    it,
    beforeEach,
    afterEach
} from 'mocha';
import {expect} from 'chai';
import $ from 'jquery';
import startApp from '../../helpers/start-app';
import destroyApp from '../../helpers/destroy-app';
import {invalidateSession, authenticateSession} from 'ghost-admin/tests/helpers/ember-simple-auth';

describe('Acceptance: Settings - Labs', function() {
    let application;

    beforeEach(function() {
        application = startApp();
    });

    afterEach(function() {
        destroyApp(application);
    });

    it('redirects to signin when not authenticated', function () {
        invalidateSession(application);
        visit('/settings/labs');

        andThen(function() {
            expect(currentURL(), 'currentURL').to.equal('/signin');
        });
    });

    it('redirects to team page when authenticated as author', function () {
        let role = server.create('role', {name: 'Author'});
        server.create('user', {roles: [role], slug: 'test-user'});

        authenticateSession(application);
        visit('/settings/labs');

        andThen(() => {
            expect(currentURL(), 'currentURL').to.equal('/team/test-user');
        });
    });

    it('redirects to team page when authenticated as editor', function () {
        let role = server.create('role', {name: 'Editor'});
        server.create('user', {roles: [role], slug: 'test-user'});

        authenticateSession(application);
        visit('/settings/labs');

        andThen(() => {
            expect(currentURL(), 'currentURL').to.equal('/team');
        });
    });

    describe('when logged in', function () {
        beforeEach(function () {
            let role = server.create('role', {name: 'Administrator'});
            server.create('user', {roles: [role]});

            return authenticateSession(application);
        });

        it.skip('it renders, loads modals correctly', function () {
            visit('/settings/labs');

            andThen(() => {
                // has correct url
                expect(currentURL(), 'currentURL').to.equal('/settings/labs');

                // has correct page title
                expect(document.title, 'page title').to.equal('Settings - Labs - Test Blog');

                // highlights nav menu
                expect($('.gh-nav-settings-labs').hasClass('active'), 'highlights nav menu item')
                    .to.be.true;
            });

            click('#settings-resetdb .js-delete');

            andThen(() => {
                expect(find('.fullscreen-modal .modal-content').length, 'modal element').to.equal(1);
            });

            click('.fullscreen-modal .modal-footer .gh-btn');

            andThen(() => {
                expect(find('.fullscreen-modal').length, 'modal element').to.equal(0);
            });
        });
    });
});


text:
import { ReactNode, useLayoutEffect } from 'react';

import useInstance from '@proton/hooks/useInstance';
import { EVENT_ACTIONS } from '@proton/shared/lib/constants';
import createCache from '@proton/shared/lib/helpers/cache';
import createLRU from '@proton/shared/lib/helpers/lru';
import { STATUS } from '@proton/shared/lib/models/cache';

import { useEventManager } from '../../hooks';
import ContactProviderContext from './ContactProviderContext';

interface Props {
    children: ReactNode;
}

/**
 * The purpose of this provider is to synchronize individual contact fetches with updates from the event manager,
 * and to have a separate LRU cache for it.
 */
const ContactProvider = ({ children }: Props) => {
    const { subscribe } = useEventManager();
    const cache = useInstance(() => {
        return createCache(createLRU({ max: 10 }));
    });

    useLayoutEffect(() => {
        return subscribe(({ Contacts }: any) => {
            if (!Array.isArray(Contacts)) {
                return;
            }
            for (const { ID, Action, Contact } of Contacts) {
                // Ignore updates for non-fetched contacts.
                if (!cache.has(ID)) {
                    continue;
                }
                if (Action === EVENT_ACTIONS.DELETE) {
                    cache.delete(ID);
                }
                if (Action === EVENT_ACTIONS.UPDATE) {
                    // The contact is always received in full, so we can ignore if the contact would be currently fetching (to merge the old data)
                    cache.set(ID, { value: Contact, status: STATUS.RESOLVED });
                }
            }
        });
    }, []);

    return <ContactProviderContext.Provider value={cache}>{children}</ContactProviderContext.Provider>;
};

export default ContactProvider;


text:
MemoryOperationError CodePatch(void *address, uint8_t *buffer, uint32_t buffer_size);

#endif


text:
alias av="ansible-vault"
alias ave="ansible-vault edit"


text:
//
//  FormVIP.h
//  Markit
//
//  Created by Breezewish on 4/26/14.
//  Copyright (c) 2014 Breezewish. All rights reserved.
//

#ifndef Markit_FormVIP_h
#define Markit_FormVIP_h

#include <string>
#include "Utils.h"
#include "FormUtils.h"
#include "FormPayment.h"
#include "Basket.h"
#include "Users.h"
#include "UserLevel.h"

class FormVIP
{
private:
    struct EntryIdCallbackData
    {
        Basket& basket;
        newtComponent& entryId;
        newtComponent& txtTotal;
        newtComponent& txtName;
        newtComponent& txtLevel;
        newtComponent& txtTel;
    };

    static void entryIdCallback(newtComponent entry, void* data)
    {
        EntryIdCallbackData* entryIdData = (EntryIdCallbackData*)data;

        char* _id = newtEntryGetValue(entryIdData->entryId);

        try {
            unsigned int uid = std::atoi(_id);
            auto& u = Users::getFromUID(uid);

            newtTextboxSetText(entryIdData->txtLevel, (u.getLevel() + " (Point: " + Utils::to_string_with_precision((float)u.getPoint1000() / 1000, 3) + ")").c_str());

            auto gender = u.getGender();
            string gender_str;
            if (gender == 0) {
                gender_str = "Other";
            } else if (gender == 1) {
                gender_str = "Male";
            } else {
                gender_str = "Female";
            }

            float price = (float)entryIdData->basket.getTotalPrice100() / 100;
            float price2 = (float)u.getAccesser()->getDiscountBasket(entryIdData->basket).getTotalPrice100() / 100;

            newtTextboxSetText(entryIdData->txtName, (u.getName() + " (" + gender_str + ")").c_str());
            newtTextboxSetText(entryIdData->txtTel, u.getTel().c_str());
            newtTextboxSetText(entryIdData->txtTotal, ("RMB " + Utils::to_string_with_precision(price2, 2) + " (discount: RMB " + Utils::to_string_with_precision(price - price2, 2) + ")").c_str());
        } catch (...) {
            float price = (float)entryIdData->basket.getTotalPrice100() / 100;

            newtTextboxSetText(entryIdData->txtName, "/* NOT FOUND */");
            newtTextboxSetText(entryIdData->txtTel, "/* NOT FOUND */");
            newtTextboxSetText(entryIdData->txtLevel, "/* NOT FOUND */");
            newtTextboxSetText(entryIdData->txtTotal, ("RMB " + Utils::to_string_with_precision(price, 2)).c_str());
        }
    }

    static bool useCard(EntryIdCallbackData& entryIdData)
    {
        char* _id = newtEntryGetValue(entryIdData.entryId);

        try {
            unsigned int uid = std::atoi(_id);
            auto& u = Users::getFromUID(uid);

            auto accesser = u.getAccesser();
            auto basket_new = accesser->getDiscountBasket(entryIdData.basket);
            FormPayment::execute(basket_new);

            //TODO: check whether update successfully
            u.updatePoint1000(accesser->getBonusPoint1000(entryIdData.basket));
        } catch(...) {
            newtWinMessage((char*)"Markit Error", (char*)"OK", (char*)"VIPUser not found.");
            return false;
        }

        return true;
    }

public:
    static void execute(Basket& basket)
    {
        const char *input_cid;

        auto grid = newtCreateGrid(1, 4);

        auto amountGrid = newtCreateGrid(2, 1);
        auto lblTotal = newtLabel(-1, -1, "Total:  ");
        auto txtTotal = newtTextbox(-1, -1, 40, 1, 0);
        newtGridSetField(amountGrid, 0, 0, NEWT_GRID_COMPONENT, lblTotal, 0, 0, 0, 0, NEWT_ANCHOR_LEFT, 0);
        newtGridSetField(amountGrid, 1, 0, NEWT_GRID_COMPONENT, txtTotal, 1, 0, 0, 0, NEWT_ANCHOR_LEFT, 0);
        newtGridSetField(grid, 0, 0, NEWT_GRID_SUBGRID, amountGrid, 0, 0, 0, 0, 0, 0);

        auto txtDesc = newtTextbox(-1, -1, 30, 1, 0);
        newtGridSetField(grid, 0, 1, NEWT_GRID_COMPONENT, txtDesc, 0, 1, 0, 0, NEWT_ANCHOR_LEFT, 0);
        newtTextboxSetText(txtDesc, "-- VIP DISCOUNT --");

        auto userGrid = newtCreateGrid(2, 4);

        auto lblId = newtLabel(-1, -1, "Card ID:");
        auto entryId = newtEntry(-1, -1, NULL, 20, &input_cid, NEWT_ENTRY_SCROLL);
        newtGridSetField(userGrid, 0, 0, NEWT_GRID_COMPONENT, lblId, 0, 0, 0, 0, NEWT_ANCHOR_LEFT, 0);
        newtGridSetField(userGrid, 1, 0, NEWT_GRID_COMPONENT, entryId, 1, 0, 0, 0, NEWT_ANCHOR_LEFT, 0);

        auto lblLevel = newtLabel(-1, -1, "Level:");
        auto txtLevel = newtTextbox(-1, -1, 40, 1, 0);
        newtGridSetField(userGrid, 0, 1, NEWT_GRID_COMPONENT, lblLevel, 0, 0, 0, 0, NEWT_ANCHOR_LEFT, 0);
        newtGridSetField(userGrid, 1, 1, NEWT_GRID_COMPONENT, txtLevel, 1, 0, 0, 0, NEWT_ANCHOR_LEFT, 0);

        auto lblName = newtLabel(-1, -1, "Name:");
        auto txtName = newtTextbox(-1, -1, 40, 1, 0);
        newtGridSetField(userGrid, 0, 2, NEWT_GRID_COMPONENT, lblName, 0, 0, 0, 0, NEWT_ANCHOR_LEFT, 0);
        newtGridSetField(userGrid, 1, 2, NEWT_GRID_COMPONENT, txtName, 1, 0, 0, 0, NEWT_ANCHOR_LEFT, 0);

        auto lblTel = newtLabel(-1, -1, "Tel:");
        auto txtTel = newtTextbox(-1, -1, 40, 1, 0);
        newtGridSetField(userGrid, 0, 3, NEWT_GRID_COMPONENT, lblTel, 0, 0, 0, 0, NEWT_ANCHOR_LEFT, 0);
        newtGridSetField(userGrid, 1, 3, NEWT_GRID_COMPONENT, txtTel, 1, 0, 0, 0, NEWT_ANCHOR_LEFT, 0);

        EntryIdCallbackData entryIdData = { basket, entryId, txtTotal, txtName, txtLevel, txtTel };
        newtComponentAddCallback(entryId, entryIdCallback, &entryIdData);

        auto buttonGrid = newtCreateGrid(2, 1);
        auto btnUse = newtButton(-1, -1, "Use");
        auto btnSkip = newtButton(-1, -1, "Skip");
        newtGridSetField(buttonGrid, 0, 0, NEWT_GRID_COMPONENT, btnUse, 1, 0, 1, 0, 0, 0);
        newtGridSetField(buttonGrid, 1, 0, NEWT_GRID_COMPONENT, btnSkip, 1, 0, 1, 0, 0, 0);

        newtGridSetField(grid, 0, 2, NEWT_GRID_SUBGRID, userGrid, 0, 0, 0, 0, 0, 0);
        newtGridSetField(grid, 0, 3, NEWT_GRID_SUBGRID, buttonGrid, 0, 1, 0, 0, 0, 0);

        auto form = newtForm(NULL, NULL, 0);
        newtGridAddComponentsToForm(grid, form, 1);

        newtGridWrappedWindow(grid, (char*)"Discount");
        newtGridFree(grid, 1);

        bool complete = false;

        do {
            auto answer = newtRunForm(form);
            if (answer == btnSkip) {
                FormPayment::execute(basket);
                complete = true;
            } else if (answer == btnUse) {
                complete = useCard(entryIdData);
            }
        } while (!complete);

        newtFormDestroy(form);
        newtPopWindow();
    }
};

#endif


text:
@interface PodsDummy_Pods_EAMovieApp : NSObject
@end
@implementation PodsDummy_Pods_EAMovieApp
@end


text:
<!DOCTYPE html>

        <meta charset="UTF-8">
        <title>Sistema | Estadistico</title>
        <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>

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

        <link href="../../css/font-awesome.min.css" rel="stylesheet" type="text/css" />

        <link href="../../css/ionicons.min.css" rel="stylesheet" type="text/css" />

        <link href="../../css/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />

        <link href="../../css/iCheck/all.css" rel="stylesheet" type="text/css" />

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

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

        <link href="../../css/AdminLTE.css" rel="stylesheet" type="text/css" />

                Sistema Estadistico

                    Toggle navigation

                                Nombre Usuario

                                        Nombre Usuario - Maestra Piso 1

                                        Perfil

                                        Salir

Hola, Usuario

                    <form action="#" method="get" class="sidebar-form">

                            <input type="text" name="q" class="form-control" placeholder="Buscar..."/>

                                <button type='submit' name='seach' id='search-btn' class="btn btn-flat"></button>

                    </form>

<?php
    include("menu_form.php");

    $id_periodo = $_GET['id'];
    require ("../control/conexion_bd.php");

  $sql="SELECT * FROM periodo_escolar WHERE id_periodo_escolar = '$id_periodo'";
  $datos=mysql_query($sql,$link);
  $arreglo = mysql_fetch_array($datos);

?>

                        Sección Periodo Escolar                     Registro - Vista

 Inicio

Formularios

Formulario Periodo Escolar

Registrar Periodo Escolar

                                        Año inicio Periodo Escolar:

                                            <input type="text" name="inicio" class="form-control" required="es requerido" value="<?php echo $arreglo['inicio']; ?>" />

                                        Año final Periodo Escolar:

                                            <input type="text" name="final" class="form-control" value="<?php echo $arreglo['fin']; ?>"/>

                                    <?php
                                    $consulta ="SELECT * FROM total_poblacion_atendida WHERE id_periodo_escolar = '$id_periodo' AND id_mes = '1'";
                                    $query = mysql_query($consulta,$link);
                                    $list_mes= mysql_num_rows($query);

                                    echo "
";
                                    if ($list_mes > 0){
                                        echo "<button class='btn btn-success'>ENERO Registrado</button>  ";

                                    }else{
                                        echo "<button class='btn btn-danger'>ENERO no Registrado</button>  ";

                                    }
                                    $consulta ="SELECT * FROM total_poblacion_atendida WHERE id_periodo_escolar = '$id_periodo' AND id_mes = '2'";
                                    $query = mysql_query($consulta,$link);
                                    $list_mes= mysql_num_rows($query);

                                    if ($list_mes > 0){
                                        echo "<button class='btn btn-success'>FEBRERO Registrado</button>  ";

                                    }else{
                                        echo "<button class='btn btn-danger'>FEBRERO no Registrado</button>  ";

                                    }
                                    echo "
";
                                    $consulta ="SELECT * FROM total_poblacion_atendida WHERE id_periodo_escolar = '$id_periodo' AND id_mes = '3'";
                                    $query = mysql_query($consulta,$link);
                                    $list_mes= mysql_num_rows($query);

                                    echo "
";
                                    if ($list_mes > 0){
                                        echo "<button class='btn btn-success'>MARZO Registrado</button>  ";

                                    }else{
                                        echo "<button class='btn btn-danger'>MARZO no Registrado</button>  ";

                                    }

                                    $consulta ="SELECT * FROM total_poblacion_atendida WHERE id_periodo_escolar = '$id_periodo' AND id_mes = '4'";
                                    $query = mysql_query($consulta,$link);
                                    $list_mes= mysql_num_rows($query);

                                    if ($list_mes > 0){
                                        echo "<button class='btn btn-success'>ABRIL Registrado</button>  ";

                                    }else{
                                        echo "<button class='btn btn-danger'>ABRIL no Registrado</button>  ";

                                    }
                                    echo "
";
                                    $consulta ="SELECT * FROM total_poblacion_atendida WHERE id_periodo_escolar = '$id_periodo' AND id_mes = '5'";
                                    $query = mysql_query($consulta,$link);
                                    $list_mes= mysql_num_rows($query);

                                    echo "
";
                                    if ($list_mes > 0){
                                        echo "<button class='btn btn-success'>MAYO Registrado</button>  ";

                                    }else{
                                        echo "<button class='btn btn-danger'>MAYO no Registrado</button>  ";

                                    }

                                    $consulta ="SELECT * FROM total_poblacion_atendida WHERE id_periodo_escolar = '$id_periodo' AND id_mes = '6'";
                                    $query = mysql_query($consulta,$link);
                                    $list_mes= mysql_num_rows($query);

                                    if ($list_mes > 0){
                                        echo "<button class='btn btn-success'>JUNIO Registrado</button>  ";

                                    }else{
                                        echo "<button class='btn btn-danger'>JUNIO no Registrado</button>  ";

                                    }
                                    echo "
";
                                    $consulta ="SELECT * FROM total_poblacion_atendida WHERE id_periodo_escolar = '$id_periodo' AND id_mes = '7'";
                                    $query = mysql_query($consulta,$link);
                                    $list_mes= mysql_num_rows($query);
                                    echo "
";

                                    if ($list_mes > 0){
                                        echo "<button class='btn btn-success'>JULIO Registrado</button> ";

                                    }else{
                                        echo "<button class='btn btn-danger'>JULIO no Registrado</button>  ";

                                    }

                                    $consulta ="SELECT * FROM total_poblacion_atendida WHERE id_periodo_escolar = '$id_periodo' AND id_mes = '8'";
                                    $query = mysql_query($consulta,$link);
                                    $list_mes= mysql_num_rows($query);

                                    if ($list_mes > 0){
                                        echo "<button class='btn btn-success'>AGOSTO Registrado</button>  ";

                                    }else{
                                        echo "<button class='btn btn-danger'>AGOSTO no Registrado</button>  ";

                                    }
                                    echo "
";
                                    $consulta ="SELECT * FROM total_poblacion_atendida WHERE id_periodo_escolar = '$id_periodo' AND id_mes = '9'";
                                    $query = mysql_query($consulta,$link);
                                    $list_mes= mysql_num_rows($query);
                                    echo "
";

                                    if ($list_mes > 0){
                                        echo "<button class='btn btn-success'>SEPTIEMBRE Registrado</button>  ";

                                    }else{
                                        echo "<button class='btn btn-danger'>SEPTIEMBRE no Registrado</button>  ";

                                    }

                                    $consulta ="SELECT * FROM total_poblacion_atendida WHERE id_periodo_escolar = '$id_periodo' AND id_mes = '10'";
                                    $query = mysql_query($consulta,$link);
                                    $list_mes= mysql_num_rows($query);

                                    if ($list_mes > 0){
                                        echo "<button class='btn btn-success'>OCTUBRE Registrado</button>  ";

                                    }else{
                                        echo "<button class='btn btn-danger'>OCTUBRE no Registrado</button>  ";

                                    }
                                    echo "
";
                                    $consulta ="SELECT * FROM total_poblacion_atendida WHERE id_periodo_escolar = '$id_periodo' AND id_mes = '11'";
                                    $query = mysql_query($consulta,$link);
                                    $list_mes= mysql_num_rows($query);
                                    echo "
";

                                    if ($list_mes > 0){
                                        echo "<button class='btn btn-success'>NOVIMEBRE Registrado</button>  ";

                                    }else{
                                        echo "<button class='btn btn-danger'>NOVIMEBRE no Registrado</button>  ";

                                    }

                                    $consulta ="SELECT * FROM total_poblacion_atendida WHERE id_periodo_escolar = '$id_periodo' AND id_mes = '12'";
                                    $query = mysql_query($consulta,$link);
                                    $list_mes= mysql_num_rows($query);

                                    if ($list_mes > 0){
                                        echo "<button class='btn btn-success'>DICIEMBRE Registrado</button>  ";

                                    }else{
                                        echo "<button class='btn btn-danger'>DICIEMBRE no Registrado</button>  ";

                                    }
                                    echo "
";

                                    ?>

                            </form>

<?php
#$consulta = $_POST['consulta'];
#echo "
Su Consulta es: $consulta
";
$sql="SELECT * FROM periodo_escolar";
  $datos=mysql_query($sql,$link);
$contador = mysql_num_rows($datos);
    if ($contador == 0)
      {
        echo "
NO SE ENCONTRO RESULTADOS :-(
";
      }
    else
      {

?>

Lista de Periodos Escolares

PERIODO ESCOLAR ACTUAL

                                <?php
                                $ultimo="SELECT * FROM periodo_escolar order by id_periodo_escolar desc limit 1";
                                $res_ultimo = mysql_query($ultimo,$link);
                                $renglon=mysql_fetch_array($res_ultimo);

                                echo $renglon['inicio'];
                                echo "-";
                                echo $renglon['fin'];
                                ?>

                                            ID
                                              PERIODO ESCOLAR
                                            ACCIÓN

                                        <?php
                              while ($renglon=mysql_fetch_array($datos))
                                {
                            ?>

                                    <?php echo $renglon['id_periodo_escolar']; ?>
                                    <?php echo $renglon['inicio']; echo " - "; echo $renglon['fin']?>

                                        <a href="../forms/form_periodo_editar.php?id=<?php echo $renglon['id_periodo_escolar']?>">

                                        <button class="btn btn-success"> VER</button>

                                            <a href="../emergente/borrar_periodo.php?id=<?php echo $renglon['id_periodo_escolar']?>" >
                                                <button class="btn btn-danger">

                                                         ELIMINAR

                                                </button>

                              <?php } }?>

«

1

2

3

»


text:
package org.apache.druid.tests.indexer;

import org.apache.druid.java.util.common.Pair;
import org.apache.druid.testing.guice.DruidTestModuleFactory;
import org.apache.druid.tests.TestNGGroup;
import org.testng.annotations.Guice;
import org.testng.annotations.Test;

import java.util.List;

/**
 * IMPORTANT:
 * To run this test, you must:
 * 1) Set the bucket and path for your data. This can be done by setting -Ddruid.test.config.cloudBucket and
 *    -Ddruid.test.config.cloudPath or setting "cloud_bucket" and "cloud_path" in the config file.
 * 2) Copy wikipedia_index_data1.json, wikipedia_index_data2.json, and wikipedia_index_data3.json
 *    located in integration-tests/src/test/resources/data/batch_index/json to your GCS at the location set in step 1.
 * 3) Provide -Doverride.config.path=<PATH_TO_FILE> with gcs configs and hdfs deep storage configs set. See
 *    integration-tests/docker/environment-configs/override-examples/gcs and
 *    integration-tests/docker/environment-configs/override-examples/hdfs for env vars to provide.
 * 4) Provide -Dresource.file.dir.path=<PATH_TO_FOLDER> with folder that contains GOOGLE_APPLICATION_CREDENTIALS file
 * 5) Run the test with -Dstart.hadoop.docker=true in the mvn command
 */
@Test(groups = TestNGGroup.HDFS_DEEP_STORAGE)
@Guice(moduleFactory = DruidTestModuleFactory.class)
public class ITGcsToHdfsParallelIndexTest extends AbstractGcsInputSourceParallelIndexTest
{
  @Test(dataProvider = "resources")
  public void testGcsIndexData(Pair<String, List> gcsInputSource) throws Exception
  {
    doTest(gcsInputSource);
  }
}


text:
USE STATegraDB;
START TRANSACTION;
BEGIN;
    set FOREIGN_KEY_CHECKS = 1;

    -- -----------------------------------------------------
    -- Table `STATegraDB`.`proteomics_msinformatics`
    -- -----------------------------------------------------
    DROP TABLE IF EXISTS `STATegraDB`.`proteomics_msinformatics` ;

    SHOW WARNINGS;
    CREATE TABLE IF NOT EXISTS `STATegraDB`.`proteomics_msinformatics` (
      `step_id` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
      `msi_responsible_person` VARCHAR(400) NULL DEFAULT NULL,
      `msi_software` VARCHAR(400) NULL DEFAULT NULL,
      `msi_customizations` VARCHAR(400) NULL DEFAULT NULL,
      `msi_software_availability` VARCHAR(400) NULL DEFAULT NULL,
      `msi_files_description` VARCHAR(500) NULL DEFAULT NULL,
      `msi_files_location` VARCHAR(500) NULL DEFAULT NULL,
      `msi_inputdata_description` TEXT NULL DEFAULT NULL,
      `msi_database_queried` VARCHAR(400) NULL DEFAULT NULL,
      `msi_taxonomical_restrictions` TEXT NULL DEFAULT NULL,
      `msi_tool_description` TEXT NULL DEFAULT NULL,
      `msi_cleavage_agents` VARCHAR(500) NULL DEFAULT NULL,
      `msi_missed_cleavages` VARCHAR(500) NULL DEFAULT NULL,
      `msi_cleavage_additional_params` VARCHAR(500) NULL DEFAULT NULL,
      `msi_permissible_aminoacids_modifications` VARCHAR(500) NULL,
      `msi_precursorion_tolerance` VARCHAR(500) NULL,
      `msi_pmf_mass_tolerance` VARCHAR(500) NULL,
      `msi_thresholds` VARCHAR(400) NULL,
      `msi_otherparams` TEXT NULL,
      `msi_accession_code` VARCHAR(400) NULL,
      `msi_protein_description` TEXT NULL,
      `msi_protein_scores` VARCHAR(500) NULL,
      `msi_validation_status` VARCHAR(500) NULL,
      `msi_different_peptide_sequences` VARCHAR(500) NULL,
      `msi_peptide_coverage` VARCHAR(500) NULL,
      `msi_pmf_matched_peaks` VARCHAR(500) NULL,
      `msi_other_additional_info` TEXT NULL,
      `msi_sequence` TEXT NULL,
      `msi_peptide_scores` TEXT NULL,
      `msi_chemical_modifications` TEXT NULL,
      `msi_spectrum_locus` VARCHAR(500) NULL,
      `msi_charge_assumed` TEXT NULL,
      `msi_quantitation_approach` TEXT NULL,
      `msi_quantitation_measurement` VARCHAR(400) NULL,
      `msi_quantitation_normalisation` TEXT NULL,
      `msi_quantitation_replicates_number` VARCHAR(500) NULL,
      `msi_quantitation_acceptance` TEXT NULL,
      `msi_quantitation_error_analysis` TEXT NULL,
      `msi_quantitation_control_results` TEXT NULL,
      `msi_interpretation_assessment` TEXT NULL,
      `msi_interpretation_results` TEXT NULL,
      `msi_interpretation_inclusion` TEXT NULL,
      PRIMARY KEY (`step_id`),
      INDEX `idx_step_id_1` (`step_id` ASC),
      CONSTRAINT `proteomics_msinformatics0`
        FOREIGN KEY (`step_id`)
        REFERENCES `STATegraDB`.`processed_data` (`step_id`)
        ON DELETE CASCADE
        ON UPDATE CASCADE)
    ENGINE = InnoDB;

    SHOW WARNINGS;

    INSERT INTO proteomics_msinformatics
    (step_id, msi_responsible_person, msi_software, msi_customizations, msi_software_availability,
    msi_files_description, msi_files_location, msi_inputdata_description, msi_database_queried, msi_taxonomical_restrictions, msi_tool_description,
    msi_cleavage_agents, msi_missed_cleavages, msi_cleavage_additional_params, msi_permissible_aminoacids_modifications, msi_precursorion_tolerance,
    msi_pmf_mass_tolerance, msi_thresholds, msi_otherparams, msi_accession_code, msi_protein_description, msi_protein_scores, msi_validation_status,
    msi_different_peptide_sequences, msi_peptide_coverage, msi_pmf_matched_peaks, msi_other_additional_info, msi_sequence, msi_peptide_scores,
    msi_chemical_modifications, msi_spectrum_locus, msi_charge_assumed,  msi_quantitation_approach, msi_quantitation_measurement,
    msi_quantitation_normalisation, msi_quantitation_replicates_number, msi_quantitation_acceptance, msi_quantitation_error_analysis,
    msi_quantitation_control_results, msi_interpretation_assessment, msi_interpretation_results, msi_interpretation_inclusion)
    SELECT step_id, msi_responsible_person, msi_software, msi_customizations, msi_software_availability, msi_files_description, msi_files_location,
     msi_inputdata_description, msi_database_queried, msi_taxonomical_restrictions, msi_tool_description, msi_cleavage_agents, msi_missed_cleavages, msi_cleavage_additional_params,
     msi_permissible_aminoacids_modifications, msi_precursorion_tolerance, msi_pmf_mass_tolerance, msi_thresholds, msi_otherparams, msi_accession_code, msi_protein_description, msi_protein_scores,
    msi_validation_status, msi_different_peptide_sequences, msi_peptide_coverage, msi_pmf_matched_peaks, msi_other_additional_info, msi_sequence, msi_peptide_scores, msi_chemical_modifications,
     msi_spectrum_locus, msi_charge_assumed, msi_quantitation_approach, msi_quantitation_measurement, msi_quantitation_normalisation, msi_quantitation_replicates_number, msi_quantitation_acceptance,
    msi_quantitation_error_analysis, msi_quantitation_control_results, msi_interpretation_assessment, msi_interpretation_results, msi_interpretation_inclusion
    FROM proteomics_msquantification;

    LOCK TABLES `proteomics_msquantification` WRITE;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_responsible_person;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_software;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_customizations;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_software_availability;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_files_description;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_files_location;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_inputdata_description;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_database_queried;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_taxonomical_restrictions;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_tool_description;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_cleavage_agents;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_missed_cleavages;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_cleavage_additional_params;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_permissible_aminoacids_modifications;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_precursorion_tolerance;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_pmf_mass_tolerance;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_thresholds;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_otherparams;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_accession_code;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_protein_description;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_protein_scores;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_validation_status;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_different_peptide_sequences;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_peptide_coverage;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_pmf_matched_peaks;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_other_additional_info;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_sequence;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_peptide_scores;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_chemical_modifications;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_spectrum_locus;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_charge_assumed;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_quantitation_approach;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_quantitation_measurement;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_quantitation_normalisation;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_quantitation_replicates_number;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_quantitation_acceptance;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_quantitation_error_analysis;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_quantitation_control_results;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_interpretation_assessment;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_interpretation_results;
        ALTER TABLE proteomics_msquantification DROP COLUMN msi_interpretation_inclusion;
    UNLOCK TABLES;

    -- -----------------------------------------------------
    -- Table `STATegraDB`.`analysis`
    -- -----------------------------------------------------
    LOCK TABLES `analysis` WRITE;
        ALTER IGNORE TABLE `analysis` ADD `analysisName` VARCHAR(200) NULL ;
    UNLOCK TABLES;

    -- -----------------------------------------------------
    -- Table `STATegraDB`.`appVersion`
    -- -----------------------------------------------------
    DROP TABLE IF EXISTS `STATegraDB`.`appVersion` ;
    SHOW WARNINGS;
    CREATE TABLE IF NOT EXISTS `STATegraDB`.`appVersion` (
      `version` VARCHAR(50) NOT NULL,
      PRIMARY KEY (`version`))
    ENGINE = InnoDB;

    INSERT IGNORE INTO `STATegraDB`.`appVersion` (version) VALUES('0.6');

    SHOW WARNINGS;

set FOREIGN_KEY_CHECKS = 0;

COMMIT;