text:
class ModelCabinetOfficeOrgStructure < ActiveRecord::Migration
  def up
    cabinet_office = Organisation.find_by(name: "Cabinet Office")
    downing_street = Organisation.find_by(name: "Prime Minister's Office, 10 Downing Street")
    civil_service = Organisation.find_by(name: "Civil Service")
    civil_service_resourcing = Organisation.find_by(name: "Civil Service Resourcing")

    organisation_names = {
        cabinet_office => [
          "Committee on Standards in Public Life",
          "Office of the Leader of the House of Commons",
          "Advisory Committee on Business Appointments",
          "Boundary Commission for England",
          "House of Lords Appointments Commission",
          "Privy Council Office",
          "Civil Service Commission",
          "Security Vetting Appeals Panel",
          "Senior Salaries Review Body",
          "Office of the Leader of the House of Lords",
          "Boundary Commission for Wales",
          "National security and intelligence",
          "Efficiency and Reform Group",
          "Office of the Parliamentary Counsel",
          "Commissioner for Public Appointments",
          "The McKay Commission",
          "Prime Minister's Office, 10 Downing Street",
          "Deputy Prime Minister's Office",
          "Government Estates Management",
          "Open Public Services",
          "Crown Commercial Service",
          "Civil Service",
          "Office of the Registrar of Consultant Lobbyists",
          "Third Party Campaigning Review",
          "Cabinet Office Board",
          "National School of Government",
        ],
        downing_street => [
          "UK Holocaust Memorial Foundation",
        ],
        civil_service => [
          "Operational Delivery Profession",
          "Policy Profession",
          "Project Delivery Profession",
          "Procurement profession",
          "Government Legal Service",
          "Government Communication Service",
          "Government Finance Profession",
          "Government Economic Service",
          "Human Resources Profession",
          "Internal Audit Profession",
          "Government Occupational Psychology Profession",
          "Government Knowledge & Information Management Profession",
          "Government Veterinary Services",
          "Government Property Profession",
          "Government Tax Profession",
          "Government Science & Engineering Profession",
          "Government Planning Inspectors",
          "Government Statistical Service",
          "Government Planning Profession",
          "Government Operational Research Service",
          "Government Social Research Profession",
          "Intelligence Analysis",
          "Government IT Profession",
          "Medical Profession",
          "Civil Service Reform",
          "Government Security Profession",
          "Civil Service Resourcing",
          "Government Commercial Function",
          "Digital, data and technology professions",
          "Civil Service Board",
        ],
        civil_service_resourcing => [
          "Civil Service Fast Stream",
          "Civil Service Fast Track Apprenticeship",
        ],
    }

    missing_orgs = []

    organisation_names.each do |expected_parent, children|
      children.each do |child_name|
        org = Organisation.find_by(name: child_name)
        if org.nil?
          missing_orgs << child_name
          puts "!! Couldn't find #{child_name}"
        else
          if org.parent != expected_parent
            begin
              old_parent_name = org.parent.nil? ? "nil" : org.parent.name

              puts "Checking parent for #{child_name}. Old parent is #{old_parent_name}"

              org.update!(parent: expected_parent)

              puts "Updating parent for #{child_name} from #{old_parent_name} to #{expected_parent.name}"
            rescue StandardError => e
              puts "Parent re-assignment failed for: #{child_name} with error '#{e.message}'"
            end
          else
            puts "Parent for #{child_name} is correct"
          end
        end
      end
    end

    if missing_orgs.empty?
      puts "All organisations were found"
    else
      puts "Missing organisations: #{missing_orgs.join("\n")}"
    end
  end

  def down
    # This change cannot be reversed
  end
end


text:
<?php

namespace PHPExiftool\Driver\Tag\XMPPlus;

use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;

/**
 * @ExclusionPolicy("all")
 */
class LicensorCountry extends AbstractTag
{

    protected $Id = 'LicensorLicensorCountry';

    protected $Name = 'LicensorCountry';

    protected $FullName = 'XMP::plus';

    protected $GroupName = 'XMP-plus';

    protected $g0 = 'XMP';

    protected $g1 = 'XMP-plus';

    protected $g2 = 'Author';

    protected $Type = 'string';

    protected $Writable = true;

    protected $Description = 'Licensor Country';

    protected $flag_List = true;
}

redpajama_set_name: RedPajamaGithub


text:
//Problem 24. Order words
//Write a program that reads a list of words, separated by spaces and prints the list in an alphabetical order.

using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
class OrderWord
{
    static void Main()
    {
        //string input = "RegEx Hero is a real-time online Silverlight Regular Expression Tester.";
        Console.Write("Enter string: ");
        string input = Console.ReadLine();
        Regex regex = new Regex(@"\w+"); // Get all words
        MatchCollection words = regex.Matches(input); // Save them in collection
        List<string> result = new List<string>();

        foreach (var item in words) // Check for duplicate
        {
            string reminder = item.ToString().ToLower();
            if (result.Contains(reminder))
            {
                continue;
            }
            else
            {
                result.Add(reminder);
            }
        }

        result.Sort();
        for (int i = 0; i < result.Count; i++)
        {
            Console.WriteLine("{0}", result[i]);
        }
    }
}


text:
"use strict";
// import { Converter } from "./Converter";
// import { Message, InitMessage, EOM } from "./ProcessFork";
// import CSVError from "./CSVError";
// import { CSVParseParam } from "./Parameters";
// process.on("message", processMsg);
// let conv: Converter;
// function processMsg(msg: Message) {
//   if (msg.cmd === "init") {
//     const param = prepareParams((msg as InitMessage).params);
//     param.fork = false;
//     conv = new Converter(param);
//     process.stdin.pipe(conv).pipe(process.stdout);
//     conv.on("error", (err) => {
//       if ((err as CSVError).line) {
//         process.stderr.write(JSON.stringify({
//           err: (err as CSVError).err,
//           line: (err as CSVError).line,
//           extra: (err as CSVError).extra
//         }))
//       } else {
//         process.stderr.write(JSON.stringify({
//           err: err.message,
//           line: -1,
//           extra: "Unknown error"
//         }));
//       }
//     });
//     conv.on("eol", (eol) => {
//       // console.log("eol!!!",eol);
//       if (process.send)
//         process.send({ cmd: "eol", "value": eol });
//     })
//     conv.on("header", (header) => {
//       if (process.send)
//         process.send({ cmd: "header", "value": header });
//     })
//     conv.on("done", () => {
//       const drained = process.stdout.write("", () => {
//         if (drained) {
//           gracelyExit();
//         }
//       });
//       if (!drained) {
//         process.stdout.on("drain", gracelyExit)
//       }
//       // process.stdout.write(EOM);
//     })
//     if (process.send) {
//       process.send({ cmd: "inited" });
//     }
//   }
// }
// function gracelyExit(){
//   setTimeout(()=>{
//     conv.removeAllListeners();
//     process.removeAllListeners();
//   },50);
// }
// function prepareParams(p: any): CSVParseParam {
//   if (p.ignoreColumns) {
//     p.ignoreColumns = new RegExp(p.ignoreColumns.source, p.ignoreColumns.flags)
//   }
//   if (p.includeColumns) {
//     p.includeColumns = new RegExp(p.includeColumns.source, p.includeColumns.flags)
//   }
//   return p;
// }
// process.on("disconnect", () => {
//   process.exit(-1);
// });
//# sourceMappingURL=worker.js.map


text:
#Position a:link,#Position a:visited{color:#222;}
.Main a:link,.Main a:visited{color:#3366CC;}
.Main a:hover,.Main a:active{color:#FF7403;}
.left{width:165px;margin-right:10px;float:left;text-align:center;}
.right{width:211px;float:right;}
.right h2{width:195px;height:25px;line-height:25px;padding:2px 8px 0;background:url(../images/spring_08.gif) #E7CA96 no-repeat 0 0px;color:#D6290B;}
.right ul{width:193px;padding:8px;border:solid #E7CA96;border-width:0 1px 1px;}
.right li{height:20px;line-height:20px;overflow:hidden;}
.middle{width:552px;padding:15px;line-height:1.5em;border:1px solid #E7CA96;float:left;}
.right1{width:805px;line-height:1.5em;float:right;}
/*-----------------------------left---------------------------------------*/
.left h2{background:url(../images/title_user_bg.jpg) #CE2020 no-repeat;height:27px;line-height:27px;color:#fff;}
.left .left_box1{border:solid #E7CA96;border-width:0 1px 1px;}
.left h3{padding:0 10px;height:25px;line-height:25px;background:#FBF7EE;border-top:1px solid #f2dcb3;font-size:12px;}
.left ul{padding:4px 0;text-align:left;}
.left ul li{background:url(../images/my_icon.gif) no-repeat 50px 7px;height:18px;padding-left:60px;padding-top:2px;}
/*-----------------------------right---------------------------------------*/
/*Report*/
#Report{overflow:hidden;margin-bottom:6px;}
/*userhelp&&problem*/
#userhelp{margin-bottom:6px;}
/*-----------------------------middle---------------------------------------*/
.Welcome{font-size:14px;font-weight:bold;padding-bottom:15px;background:url(../images/w_dot_3.gif) repeat-x 0 bottom;margin-bottom:10px;}
.Welcome span{font-weight:normal;color:#666;font-size:12px;}
	/*User_Info*/
.User_Info{margin-bottom:20px;line-height:2em;}
.User_Info td{background:url(../images/w_dot_3.gif) repeat-x 0 bottom;}
.red{color:red;}
.blue{color:blue;}
.grey{color:#999;}
	/*User_Tip*/
.User_Tip{margin:0 auto 20px;border:1px solid #E7CA96;padding:10px;/*text-align:center;*/}
.User_Tip a{font-weight:bold;}
.User_Tip em{color:red;}
	/*Tips*/
.middle h3{height:25px;line-height:25px;margin-bottom:8px;}
.middle h3 em{font-weight:normal;color:#994030;font-size:12px;}
	.Tip_Buy{margin:0 auto 20px;}
	.Tip_Buy th,.Tip_Buy td{padding:2px;text-align:center;}
	.Tip_Buy th{background:#EBF4FB;}
	.Tip_Buy tr.tr1 th{background:#FBF7EE;}
/*fov*/
#fov li{border:none;}
#fov dl{background:none;}
#fov dd.p_Price strong{color:#DA2B28;}
/*EDM by LiuWenLei*/
.f_313132{color:#313132}
.sub_tit{margin-left:7px;margin-right:7px}
.sub_email{font-size:14px;border-bottom:1px solid #e7eff6}
.sub_email_a{border-top:1px solid #e7eff6}
.sub_email_button{ background:url(../images/jd_email_03.gif) no-repeat;border:0;width:89px;height:26px}
.sub_l7{padding-left:7px}
.sub_box{padding:1px; background:#fff}
.jd_new{background:url(../images/jd_email_07.gif) no-repeat 52px 2px;}
.jd_up{background:url(../images/jd_up.gif) no-repeat 52px 2px;}
.wdy{color:#7c7c7c}
.list_new{ position:relative}
.jd_hot{background:url(../images/jd_hot.gif) no-repeat 52px 2px;}
/*newSkin--------------------------------------------------------*/
.pD1{padding:5px 2px;line-height:24px;}
.pD1 .h1{font-size:16px;}


text:
@interface HBLineLayout : UICollectionViewFlowLayout

@end


text:
using GroupDocs.Metadata.Common;
using GroupDocs.Metadata.Formats.Font;
using GroupDocs.Metadata.WebForms.Products.Metadata.Model;
using System;
using System.Collections.Generic;

namespace GroupDocs.Metadata.WebForms.Products.Metadata.Repositories.Fonts
{
    public class OpenTypeRepository : EnumMapperRepository
    {
        private const string GlyphBounds = "GlyphBounds";
        private static readonly IDictionary<string, Type> EnumMap = new Dictionary<string, Type>
        {
            { "SfntVersion", typeof(OpenTypeVersion) },
            { "Flags", typeof(OpenTypeFlags) },
            { "MacStyle", typeof(OpenTypeStyles) },
            { "FontDirectionHint", typeof(OpenTypeDirectionHint) },
            { "UsWeightClass", typeof(OpenTypeWeight) },
            { "UsWidthClass", typeof(OpenTypeWidth) },
            { "FsType", typeof(OpenTypeLicensingRights) },
        };

        public OpenTypeRepository(MetadataPackage branchPackage) : base(branchPackage, EnumMap)
        {
        }

        public override IEnumerable<Property> GetProperties()
        {
            foreach (var property in base.GetProperties())
            {
                if (property.Name != GlyphBounds)
                {
                    yield return property;
                }
            }

            var font = (OpenTypeFont)BranchPackage;
            yield return new Property(GlyphBounds, PropertyType.String, $"{font.GlyphBounds.Width}X{font.GlyphBounds.Height}");

            var visited = new Dictionary<OpenTypeName, int>();

            foreach (var name in font.Names)
            {
                if (visited.ContainsKey(name.NameID))
                {
                    visited[name.NameID]++;
                }
                else
                {
                    visited.Add(name.NameID, 1);
                }
                yield return new Property($"z_{name.NameID} {visited[name.NameID]}", PropertyType.String, name.Value);
            }
        }
    }
}


text:
package org.osgl.cache.impl;

import net.spy.memcached.compat.log.AbstractLogger;
import net.spy.memcached.compat.log.Level;
import org.osgl.logging.L;
import org.osgl.logging.Logger;
import org.osgl.util.E;
import org.osgl.util.S;

/**
 * Created by luog on 17/02/14.
 */
public class SpyMemcachedLogger extends AbstractLogger {

    private Logger logger = null;

    public SpyMemcachedLogger(String name) {
        super(name);
        logger = L.get(name);
    }

    @Override
    public boolean isDebugEnabled() {
        return false;
    }

    @Override
    public boolean isInfoEnabled() {
        return false;
    }

    @Override
    public boolean isTraceEnabled() {
        return false;
    }

    @Override
    public void log(Level level, Object message, Throwable e) {
        String s = S.string(message);
        switch (level) {
            case TRACE:
                logger.trace(e, s);
                break;
            case DEBUG:
                logger.debug(e, s);
                break;
            case INFO:
                logger.info(e, s);
                break;
            case WARN:
                logger.warn(e, s);
                break;
            case ERROR:
                logger.error(e, s);
                break;
            case FATAL:
                logger.fatal(e, s);
            default:
                throw E.unexpected("Error level not recognized: %s", level);
        }
    }
}


text:
using System;
using FasterTests.Core.Interfaces.Models;

namespace FasterTests.Core.Integration.Nunit
{
    public interface ISetupFixturesContext
    {
        bool SetupFor(TestDescriptor test, IObserver<TestResult> resultsObserver);

        void TeardownAll(IObserver<TestResult> resultsObserver);
    }
}


text:
$:.unshift File.join(File.dirname(__FILE__),'../lib')
require "lipa/web"

#Configuration
srv = root :server do
  node :message do
    html text("Hello World!")
  end
end

srv.run!

#Open http://127.0.0.1:9292/message


text:
author: Luther Goh Lu Feng
categories:
  - Events
  - Headline
comments: true
date: 2009-08-15T00:00:00.000Z
title: A HoN-y Night
url: /2009/08/a-hon-y-night/
aliases:
  - /2009/08/15/a-hon-y-night/
---

Besides the usual hacking and configuration, it only apt to unwind and take a break from geekdom once in a while. So it's time to play!

linuxNUS will be having its inaugural Games Night on the 20th Aug, this coming Thur. Our game of interest is Heroes of Newerth (HoN), which runs natively on Windows, Linux and Mac OS. This game is very much like Defense of the Ancients (DOTA).

Due to a NDA, we can't publish any screenshot or videos of the game, but you can find them on the Facebook fan page.

Who knows, if enough people, especially Linux users, play the game, then maybe linuxNUS can organise a HoN competition :)

Currently, the game is in closed BETA. But linuxNUS is giving away 10 beta keys for those who turn up during Game night  and 20 for those who post in the comments of this blog post. Alternatively, one can google around and try to fish a beta key from somewhere ;)

If there is overwhelming response in the comments of our blog post, we can consider requesting more keys from the HoN creators.

So if you are keen, here are the details:

Date: 20th Aug 2009, Thursday
Time: 730pm to 10pm (latest)
Venue: SOC1/ TR6
Map: //www.comp.nus.edu.sg/aboutsoc/location-cluster.shtml and //gothere.sg/search#linuxnus:
Stuff to bring: Laptops and mouse and LAN cable

Please RSVP on our Facebook event page. See you there!

Update: dwu will be bringing her Wii Console, and I will be bring some games too. We will have 4 Wii motes and can definitely have some good mulitplayer action.

Problem is we will need a Wii-VGA connector. Does anyone have that?

And don't forget to bring your LAN cables for better HoN gameplay :)

Update: HoN-y night report is out!

PS. If there are any other native Linux games that you would like to suggest for future games nights, please do feedback in the comments!


text:
package com.sharepast.its.common;

/**
 * Created by IntelliJ IDEA.
 * User: Kostya
 * Date: 3/22/11
 * Time: 12:02 AM
 * To change this template use File | Settings | File Templates.
 */

import org.restlet.Request;

/**
 * if supplied, tis implementation will be called on the Request before sending it
 *
 *
 */

public interface IRequestModifier
{
  public abstract void modify( Request resource );
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/dialog_view"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_margin="20dp"
    android:background="@drawable/bg_progress_dialog"
    android:gravity="center"
    android:minHeight="60dp"
    android:minWidth="180dp"
    android:orientation="vertical"
    android:padding="15dp" >

    <ImageView
        android:id="@+id/loading_imgeview"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="10dp"
        android:src="@drawable/progress_bar" />

    <TextView
        android:id="@+id/txt_tips"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="10dp"
        android:text="@string/is_loading"
        android:textColor="@color/black"
        android:textSize="@dimen/text_size_small" />

</LinearLayout>


text:
package org.jboss.pnc.localbuilder.exception;

/**
 * Created by aabulawi on 13/07/15.
 */
public class LocalBuildProcessException extends Exception {

    public LocalBuildProcessException () {

    }

    public LocalBuildProcessException (String message) {
        super (message);
    }

    public LocalBuildProcessException (Throwable cause) {
        super (cause);
    }

    public LocalBuildProcessException (String message, Throwable cause) {
        super(message, cause);
    }

}


text:
title: Searching for a maximum-sum subsequence
localeTitle: Buscando una subsecuencia de suma máxima
---
## Problema 149: Buscar una subsecuencia de suma máxima

Esto es un talón. [Ayuda a nuestra comunidad a expandirla](https://github.com/freecodecamp/guides/tree/master/src/pages/certifications/coding-interview-prep/project-euler/problem-149-searching-for-a-maximum-sum-subsequence/index.md) .

[Esta guía rápida de estilo ayudará a asegurar que su solicitud de extracción sea aceptada](https://github.com/freecodecamp/guides/blob/master/README.md) .


text:
#ifndef FIRMessaging_xcodeproj_FIRMessagingDefines_h
#define FIRMessaging_xcodeproj_FIRMessagingDefines_h

#define _FIRMessaging_VERBOSE_LOGGING 1

// Verbose Logging
#if (_FIRMessaging_VERBOSE_LOGGING)
#define FIRMessaging_DEV_VERBOSE_LOG(...) NSLog(__VA_ARGS__)
#else
#define FIRMessaging_DEV_VERBOSE_LOG(...) do { } while (0)
#endif // FIRMessaging_VERBOSE_LOGGING

// FIRMessaging_FAIL
#ifdef DEBUG
#define FIRMessaging_FAIL(format, ...) \
do { \
  NSLog(format, ##__VA_ARGS__); \
  __builtin_trap(); \
} while (false)
#else
#define FIRMessaging_FAIL(...) do { } while (0)
#endif

// WEAKIFY & STRONGIFY
// Helper macro.
#define _FIRMessaging_WEAKNAME(VAR) VAR ## _weak_

#define FIRMessaging_WEAKIFY(VAR) __weak __typeof__(VAR) _FIRMessaging_WEAKNAME(VAR) = (VAR);

#define FIRMessaging_STRONGIFY(VAR) \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wshadow\"") \
__strong __typeof__(VAR) VAR = _FIRMessaging_WEAKNAME(VAR); \
_Pragma("clang diagnostic pop")

// Type Conversions (used for NSInteger etc)
#ifndef _FIRMessaging_L
#define _FIRMessaging_L(v) (long)(v)
#endif

#ifndef _FIRMessaging_UL
#define _FIRMessaging_UL(v) (unsigned long)(v)
#endif

#endif

// Debug Assert
#ifndef _FIRMessagingDevAssert
// we directly invoke the NSAssert handler so we can pass on the varargs
// (NSAssert doesn't have a macro we can use that takes varargs)
#if !defined(NS_BLOCK_ASSERTIONS)
#define _FIRMessagingDevAssert(condition, ...)                                       \
  do {                                                                      \
    if (!(condition)) {                                                     \
      [[NSAssertionHandler currentHandler]                                  \
          handleFailureInFunction:(NSString *)                              \
                                      [NSString stringWithUTF8String:__PRETTY_FUNCTION__] \
                             file:(NSString *)[NSString stringWithUTF8String:__FILE__]  \
                       lineNumber:__LINE__                                  \
                      description:__VA_ARGS__];                             \
    }                                                                       \
  } while(0)
#else // !defined(NS_BLOCK_ASSERTIONS)
#define _FIRMessagingDevAssert(condition, ...) do { } while (0)
#endif // !defined(NS_BLOCK_ASSERTIONS)

#endif // _FIRMessagingDevAssert

// Invalidates the initializer from which it's called.
#ifndef FIRMessagingInvalidateInitializer
#define FIRMessagingInvalidateInitializer() \
  do { \
    [self class]; /* Avoid warning of dead store to |self|. */ \
    _FIRMessagingDevAssert(NO, @"Invalid initializer."); \
    return nil; \
  } while (0)
#endif


text:
package edu.agh.gst

import javax.swing.SwingUtilities

trait SwingHelper {

  import scala.language.implicitConversions
  implicit def quasiblockToRunnable(f: () => Unit) = new Runnable {
    def run() = f()
  }

  def laterOnUiThread(r: Runnable) = SwingUtilities invokeLater r

  def delayOnUiThread(ms: Long)(r: Runnable) {
    import concurrent._
    import ExecutionContext.Implicits.global

    val _ = future { blocking {
      Thread sleep ms
      SwingUtilities invokeLater r
    }}
  }

}


text:
module BetfairNg

  #  Declares the module for API interactions
  #
  module API

    #  Declares module for all operations
    #
    module Operations

      #  Declares module for all Accounts operations
      #
      module Accounts

        #  Declares a Base class for all Accounts operations
        #
        module Base

          #  Declares Base::Operation class
          #
          class Operation < Operations::Betting::Base::Operation

            #  Returns an endpoint for the API request
            #
            def endpoint
              @endpoint ||= "#{config.protocol}://#{ config.host(:accounts) }#{ self.class.operation.endpoint_prefix }"
            end
          end

          #  Declares Base::Response class
          #
          class Response < Operations::Base::Response
          end

          #  Declares Base::Request class
          #
          class Request < Operations::Base::Request
          end
        end
      end
    end
  end
end


text:
package org.apache.accumulo.core.compaction;

import java.util.Map;

public enum CompactionSettings {

  SF_NO_SUMMARY(new NullType(), true),
  SF_EXTRA_SUMMARY(new NullType(), true),
  SF_NO_SAMPLE(new NullType(), true),
  SF_GT_ESIZE_OPT(new SizeType(), true),
  SF_LT_ESIZE_OPT(new SizeType(), true),
  SF_NAME_RE_OPT(new PatternType(), true),
  SF_PATH_RE_OPT(new PatternType(), true),
  MIN_FILES_OPT(new UIntType(), true),
  OUTPUT_COMPRESSION_OPT(new StringType(), false),
  OUTPUT_BLOCK_SIZE_OPT(new SizeType(), false),
  OUTPUT_HDFS_BLOCK_SIZE_OPT(new SizeType(), false),
  OUTPUT_INDEX_BLOCK_SIZE_OPT(new SizeType(), false),
  OUTPUT_REPLICATION_OPT(new UIntType(), false);

  private Type type;
  private boolean selectorOpt;

  private CompactionSettings(Type type, boolean selectorOpt) {
    this.type = type;
    this.selectorOpt = selectorOpt;
  }

  public void put(Map<String,String> selectorOpts, Map<String,String> configurerOpts, String val) {
    if (selectorOpt)
      selectorOpts.put(name(), type.convert(val));
    else
      configurerOpts.put(name(), type.convert(val));
  }
}


text:
while inotifywait -e close_write /etc/hosts 1>/dev/null 2>/dev/null; do
  python add_backends.py hosts
  reload
done


text:
/*****************************************************************************
This program should compile and when run, print a single line like:
#define SIZEOF_PTHREAD_T %d

Created April 18, 2009 Vasil Dimov
*****************************************************************************/

#include <stdio.h>
#include <pthread.h>

int
main(int argc, char** argv)
{
	printf("#define SIZEOF_PTHREAD_T %d\n", (int) sizeof(pthread_t));

	return(0);
}


text:
using AVDump3Lib.Processing.BlockBuffers;
using BXmlLib;
using BXmlLib.DataSource;
using BXmlLib.DocTypes.MP4;

namespace AVDump3Lib.Processing.BlockConsumers.MP4;

public class MP4Parser : BlockConsumer {
	public MP4Node RootBox { get; private set; }

	public MP4Parser(string name, IBlockStreamReader reader) : base(name, reader) { }

	protected override void DoWork(CancellationToken ct) {
		IBXmlDataSource dataSrc = new AVDMP4BlockDataSource(Reader);
		using(var cts = new CancellationTokenSource())
		using(ct.Register(() => cts.Cancel())) {
			var matroskaDocType = new MP4DocType(); //(MatroskaVersion.V3);
			var bxmlReader = new BXmlReader(dataSrc, matroskaDocType);

			try {
				RootBox = MP4Node.Read(bxmlReader, Reader.Length);

			} catch(Exception ex) {
				//TODO: Only ignore excpetion when it is not a matroska file
			}

		}
	}
}


text:
module RedisCloudAutoUpgrade::ClassMethods
  def potential_upgrade!(conf, &blk)
    updated_conf = conf.merge(on_upgrade: blk)
    new
      .configure(updated_conf)
      .potential_upgrade!
  end
end


text:
var BaseSequenceContext = function(base)
{
  this.index_ = 0;
  this.offset_ = 0;
  this.baseTick_ = 0;
  this.base_ = base;
  this.cycled_ = false;
}

BaseSequenceContext.prototype.reset = function(baseTick)
{
  var offset = baseTick - this.baseTick_;
  this.baseTick_ = baseTick;

  if (this.cycled_)
  {
    this.index_ = 0;
    this.offset_ = 0;
    this.cycled_ = false;
  }
  else
  {
    this.offset_ -= offset;
  }
};

BaseSequenceContext.prototype.position = function()
{
  return this.baseTick_ + this.base_.sequence[this.index_].position + this.offset_;
}

BaseSequenceContext.prototype.stepData = function()
{
  var result = this.base_.sequence[this.index_].element.map(function(degreeElement)
  {
    var isNumber = typeof degreeElement == "number";
    var degree = isNumber ? degreeElement : degreeElement.d;
    var transpose = isNumber ? 0 : degreeElement.t;
    return { degree: degree, transpose: transpose}
  })
  return result;
}

BaseSequenceContext.prototype.next = function()
{
  // next one and wrap sequence if needed
   this.index_++;
   if (this.index_ >= this.base_.sequence.length)
   {
     this.index_ = 0;
     this.offset_ += this.base_.length;
     this.cycled_ = true;
   }
}

//------------------------------------------------------------------------------

var renderSequenceWithTicks = function(harmonicStructure, baseSequence, ticksPerBeat)
{
  CHECK_TYPE(harmonicStructure, Timeline);
  CHECK_TYPE(baseSequence, Timeline);

  var renderedTimeline = new Timeline();
  renderedTimeline.length = createSequencingPosition(0, ticksPerBeat);

  var baseSequenceContext = new BaseSequenceContext(baseSequence);

  var harmonyStepIndex = 0;
  // Do all of the harmonic steps
  while (harmonyStepIndex < harmonicStructure.sequence.length)
  {
    // Prepare data for from step
    var fromStep = harmonicStructure.sequence[harmonyStepIndex];

    // Prepare data for to step. If we're doing the last index, to step is the first one
    var isLastStep = (harmonyStepIndex == harmonicStructure.sequence.length - 1);
    var toStep = _.clone(harmonicStructure.sequence[isLastStep ? 0 : harmonyStepIndex+1]);
    if (isLastStep)
    {
      toStep.position = harmonicStructure.length;
    }

    var renderedSlice = function(harmonyStepFrom, harmonyStepTo)
    {
      var render = true;
      var notes = harmonyStepFrom.element;

      var renderedSlice = new Timeline();

      baseSequenceContext.reset(harmonyStepFrom.position);

      while (render)
      {
        var currentPosition = baseSequenceContext.position();

        if (currentPosition < harmonyStepTo.position)
        {
          // Expand degree data

          var baseSequenceStep = baseSequenceContext.stepData();
          var renderedNotes = baseSequenceStep.filter(function(e)
            {
              return (e.degree -1 < notes.length)
            }).map(function(e)
            {
              velocity = 1;
              return new NoteData(notes[e.degree -1] + e.transpose , velocity, 12)
            })

          var position = createSequencingPosition(currentPosition, ticksPerBeat);
          renderedSlice.add(renderedNotes,position);

          baseSequenceContext.next();
        }
        else {
          render = false;
        }
      }
      renderedSlice.setLength(createSequencingPosition(harmonyStepTo.position, ticksPerBeat));
      return renderedSlice;
    }(fromStep, toStep)

    renderedTimeline = mergeTimeline(renderedTimeline, renderedSlice);

    harmonyStepIndex++;
  }
  renderedTimeline.setLength(createSequencingPosition(harmonicStructure.length, ticksPerBeat));
  return renderedTimeline;
}

// renders a serie of note events to be played from
// a base array sequence in the form:
//   { position: "1.1.1", degrees: [1,3] }
// and a harmonic structure
//   structure: [{ position: "1.1.1", midiNoteList: [35,67] }]
//   length: "4.1.1" // In bars

renderSequence = function(rootNote, harmonicStructure, baseSequence, signature, ticksPerBeat)
{
  CHECK_TYPE(harmonicStructure, Timeline);
  CHECK_TYPE(baseSequence, Timeline);

  // convert base sequence to ticks and harmonize it

  tickBaseSequence = baseSequence.mapSteps(
    (element) => element,
    (position) =>  ticksFromPosition(position, signature, ticksPerBeat)
  );

  tickBasedStructure = harmonicStructure.mapSteps(
    (element) => tonal.harmonize(element, rootNote).map((s) => tonal.note.midi(s)),
    (position) =>  ticksFromPosition(position, signature, ticksPerBeat)
  );
  return renderSequenceWithTicks(tickBasedStructure, tickBaseSequence, ticksPerBeat);
}


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.42
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace IIS.Электронный_Магазин {

    /// <summary>
    /// ТоварE class.
    /// </summary>
    /// <remarks>
    /// Auto-generated class.
    /// </remarks>
    public partial class ТоварE {
    }
}


text:
layout: page
title: vocabularies-old
date: 2014-08-22 03:41:30.000000000 +08:00
categories: []
tags: []
status: draft
type: page
published: false
meta:
  _edit_last: '4'
  _wp_page_template: default
  _su_rich_snippet_type: none
  _su_description: ''
author:
  login: qianli
  email: t-qial@microsoft.com
  display_name: Qian Li
  first_name: Qian
  last_name: Li
excerpt: !ruby/object:Hpricot::Doc
  options: {}
---

Vocabularies provide the ability to annotate metadata as well as instance data, and define a powerful extensibility point for OData.

Metadata annotations can be used to define additional characteristics or capabilities of a metadata element, such as a service, entity type, property, function, action or parameter. For example, a metadata annotation may define ranges of valid values for a particular property.

Instance annotations can be used to define additional information associated with a particular result, entity, property, or error; for example whether a property is read-only for a particular instance.

Annotations that apply across instances should be specified within the metadata. Where the same annotation is defined at both the metadata and instance level, the instance-level annotation should override the annotation specified at the metadata level.

Some things to keep in mind about vocabularies:

A vocabulary is a namespace containing terms where each term is a named metadata extension for an OData service

Anyone can define a vocabulary that is specific to a scenario; more commonly used terms can be added to shared vocabularies such as the OData core vocabularies

A service should not require a client to interpret annotations

Metadata annotations appear in $metadata whereas instance annotations appear in the actual payload

Display and Publication are core OData vocabularies. You can see metadata annotations applying these terms in the metadata of our sample OData feed.

The Display vocabulary has two terms:

DisplayName is used to define a displayable name for a Container, Set, Type or Property

Description is used to provide additional information about a Container, Set, Type or Property

One common use of the Display vocabulary is to annotate feeds with values that can be displayed in a UI for consuming generic OData feeds.

Directories of publications will frequently use the Publication vocabulary. For example, attribution is a common legal requirement when crawling other data sources.

PublisherName provides the name of the publisher for a given publication.

PublisherId provides the ID of the publisher for a given publication.

You can think of Keywords as a search term. For example OData might have these keywords: web, HTML, RESTful, Web API.

Attribution is used to adhere to copyright law. It allows crediting the author of a work which is used or appears someplace else. As an example for Wikipedia data, each table may have a URL that points to the original Wikipedia page from where the data was collected.

Similarly, AttributionUrl is used to follow the copyright law.

DocumentationUrl provides the URL to where the documentation lives.

TermsOfUseUrl will point to any legal terms of use associated with a publication.

PrivacyPolicyUrl will point to a privacy policy document/EULA associated with a publication.

LastModifed shows how fresh the data is. For example in case of Wikipedia it may show the last time the page was crawled.

ImageUrl provides the information about where the icon is for a given publication.


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string name="app_name">MPChart</string>

</resources>


text:
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include "generator.h"
#include "request.h"
#include <vbench/core/input_file_reader.h>
#include <vbench/core/handler.h>

namespace vbench {

/**
 * Reads lines from an input file and generates requests that are
 * passed to a request handler.
 **/
class RequestGenerator : public Generator
{
private:
    InputFileReader   _input;
    Handler<Request> &_next;
    bool              _aborted;

public:
    RequestGenerator(const string &inputFile, Handler<Request> &next);
    ~RequestGenerator() override;
    void abort() override;
    void run() override;
    const Taint &tainted() const override { return _input.tainted(); }
};

} // namespace vbench


text: import port_diag


text:
NS_ASSUME_NONNULL_BEGIN

@interface REInstaAttribution (CoreDataProperties)

@property (nullable, nonatomic, retain) NSString *name;
@property (nullable, nonatomic, retain) NSOrderedSet<REInstaPost *> *posts;

@end

@interface REInstaAttribution (CoreDataGeneratedAccessors)

- (void)insertObject:(REInstaPost *)value inPostsAtIndex:(NSUInteger)idx;
- (void)removeObjectFromPostsAtIndex:(NSUInteger)idx;
- (void)insertPosts:(NSArray<REInstaPost *> *)value atIndexes:(NSIndexSet *)indexes;
- (void)removePostsAtIndexes:(NSIndexSet *)indexes;
- (void)replaceObjectInPostsAtIndex:(NSUInteger)idx withObject:(REInstaPost *)value;
- (void)replacePostsAtIndexes:(NSIndexSet *)indexes withPosts:(NSArray<REInstaPost *> *)values;
- (void)addPostsObject:(REInstaPost *)value;
- (void)removePostsObject:(REInstaPost *)value;
- (void)addPosts:(NSOrderedSet<REInstaPost *> *)values;
- (void)removePosts:(NSOrderedSet<REInstaPost *> *)values;

@end

NS_ASSUME_NONNULL_END


text:
"""
## skchem.core.mol

Defining molecules in scikit-chem.
"""

import copy

import rdkit.Chem
import rdkit.Chem.inchi
from rdkit.Chem import AddHs, RemoveHs
from rdkit.Chem.rdMolDescriptors import CalcMolFormula, CalcExactMolWt

import json

from .atom import AtomView
from .bond import BondView
from .conformer import ConformerView
from .base import ChemicalObject, PropertyView
from ..utils import Suppressor

class Mol(rdkit.Chem.rdchem.Mol, ChemicalObject):

    """Class representing a Molecule in scikit-chem.

    Mol objects inherit directly from rdkit Mol objects.  Therefore, they
    contain atom and bond information, and may also include properties and
    atom bookmarks.

    Example:
        Constructors are implemented as class methods with the `from_` prefix.

        >>> import skchem
        >>> m = skchem.Mol.from_smiles('CC(=O)Cl'); m # doctest: +ELLIPSIS
        <Mol name="None" formula="C2H3ClO" at ...>

        This is an rdkit Mol:

        >>> from rdkit.Chem import Mol as RDKMol
        >>> isinstance(m, RDKMol)
        True

        A name can be given at initialization:
        >>> m = skchem.Mol.from_smiles('CC(=O)Cl', name='acetyl chloride'); m # doctest: +ELLIPSIS
        <Mol name="acetyl chloride" formula="C2H3ClO" at ...>

        >>> m.name
        'acetyl chloride'

        Serializers are implemented as instance methods with the `to_` prefix.

        >>> m.to_smiles()
        'CC(=O)Cl'

        >>> m.to_inchi()
        'InChI=1S/C2H3ClO/c1-2(3)4/h1H3'

        >>> m.to_inchi_key()
        'WETWJCDKMRHUPV-UHFFFAOYSA-N'

        RDKit properties are accessible through the `props` property:

        >>> m.SetProp('example_key', 'example_value') # set prop with rdkit directly
        >>> m.props['example_key']
        'example_value'

        >>> m.SetIntProp('float_key', 42) # set int prop with rdkit directly
        >>> m.props['float_key']
        42

        They can be set too:

        >>> m.props['example_set'] = 'set_value'
        >>> m.GetProp('example_set') # getting with rdkit directly
        'set_value'

        We can export the properties into a dict or a pandas series:

        >>> m.props.to_series()
        example_key    example_value
        example_set        set_value
        float_key                 42
        dtype: object

        Atoms and bonds are provided in views:

        >>> m.atoms # doctest: +ELLIPSIS
        <AtomView values="['C', 'C', 'O', 'Cl']" at ...>

        >>> m.bonds # doctest: +ELLIPSIS
        <BondView values="['C-C', 'C=O', 'C-Cl']" at ...>

        These are iterable:
        >>> [a.symbol for a in m.atoms]
        ['C', 'C', 'O', 'Cl']

        The view provides shorthands for some attributes to get these:

        >>> m.atoms.symbol  # doctest: +ELLIPSIS
        array(['C', 'C', 'O', 'Cl'], dtype=...)

        Atom and bond props can also be set:

        >>> m.atoms[0].props['atom_key'] = 'atom_value'
        >>> m.atoms[0].props['atom_key']
        'atom_value'

        The properties for atoms on the whole molecule can be accessed like so:

        >>> m.atoms.props # doctest: +ELLIPSIS
        <MolPropertyView values="{'atom_key': ['atom_value', None, None, None]}" at ...>

        The properties can be exported as a pandas dataframe
        >>> m.atoms.props.to_frame()
                    atom_key
        atom_idx
        0         atom_value
        1               None
        2               None
        3               None

    """

    def __init__(self, *args, **kwargs):

        """
        The default constructor.

        Note:
            This will be rarely used, as it can only create an empty molecule.

        Args:
            *args: Arguments to be passed to the rdkit Mol constructor.
            **kwargs: Arguments to be passed to the rdkit Mol constructor.
        """
        super(Mol, self).__init__(*args, **kwargs)
        self.__two_d = None # set in constructor

    @property
    def name(self):

        """ str: The name of the molecule.

        Raises:
            KeyError"""

        try:
            return self.GetProp('_Name')
        except KeyError:
            return None

    @name.setter
    def name(self, value):

        if value is None:
            self.ClearProp('_Name')
        else:
            self.SetProp('_Name', value)

    @property
    def atoms(self):

        """ List[skchem.Atom]: An iterable over the atoms of the molecule. """

        if not hasattr(self, '_atoms'):
            self._atoms = AtomView(self)
        return self._atoms

    @property
    def bonds(self):

        """ List[skchem.Bond]: An iterable over the bonds of the molecule. """

        if not hasattr(self, '_bonds'):
            self._bonds = BondView(self)
        return self._bonds

    @property
    def mass(self):

        """ float: the mass of the molecule. """

        return CalcExactMolWt(self)

    @property
    def props(self):

        """ PropertyView: A dictionary of the properties of the molecule. """

        if not hasattr(self, '_props'):
            self._props = PropertyView(self)
        return self._props

    @property
    def conformers(self):

        """ List[Conformer]: conformers of the molecule. """

        if not hasattr(self, '_conformers'):
            self._conformers = ConformerView(self)
        return self._conformers

    def to_formula(self):

        """ str: the chemical formula of the molecule.

        Raises:
            RuntimeError"""

        # formula may be undefined if atoms are uncertainly typed
        # e.g. if the molecule was initialize through SMARTS
        try:
            with Suppressor():
                return CalcMolFormula(self)
        except RuntimeError:
            raise ValueError('Formula is undefined for {}'.format(self))

    def add_hs(self, inplace=False, add_coords=True, explicit_only=False,
               only_on_atoms=False):
        """ Add hydrogens to self.

        Args:
            inplace (bool):
                Whether to add Hs to `Mol`, or return a new `Mol`.
            add_coords (bool):
                Whether to set 3D coordinate for added Hs.
            explicit_only (bool):
                Whether to add only explicit Hs, or also implicit ones.
            only_on_atoms (iterable<bool>):
                An iterable specifying the atoms to add Hs.
        Returns:
            skchem.Mol:
                `Mol` with Hs added.
        """
        if inplace:
            msg = 'Inplace addition of Hs is not yet supported.'
            raise NotImplementedError(msg)
        raw = AddHs(self, addCoords=add_coords, onlyOnAtoms=only_on_atoms,
                    explicitOnly=explicit_only)
        return self.__class__.from_super(raw)

    def remove_hs(self, inplace=False, sanitize=True, update_explicit=False,
                  implicit_only=False):

        """ Remove hydrogens from self.

        Args:
            inplace (bool):
                Whether to add Hs to `Mol`, or return a new `Mol`.
            sanitize (bool):
                Whether to sanitize after Hs are removed.
            update_explicit (bool):
                Whether to update explicit count after the removal.
            implicit_only (bool):
                Whether to remove explict and implicit Hs, or Hs only.
        Returns:
            skchem.Mol:
                `Mol` with Hs removed.
        """
        if inplace:
            msg = 'Inplace removed of Hs is not yet supported.'
            raise NotImplementedError(msg)
        raw = RemoveHs(self, implicitOnly=implicit_only,
                       updateExplicitCount=update_explicit, sanitize=sanitize)
        return self.__class__.from_super(raw)

    def to_dict(self, kind="chemdoodle", conformer_id=-1):

        """ A dictionary representation of the molecule.

        Args:
            kind (str):
                The type of representation to use.  Only `chemdoodle` is
                currently supported.

        Returns:
            dict:
                dictionary representation of the molecule."""

        if kind == "chemdoodle":
            return self._to_dict_chemdoodle(conformer_id=conformer_id)

        else:
            raise NotImplementedError

    def _to_dict_chemdoodle(self, conformer_id=-1):

        """ Chemdoodle dict representation of the molecule.

        Documentation of the format may be found on the `chemdoodle website \
        <https://web.chemdoodle.com/docs/chemdoodle-json-format>`_"""

        try:
            pos = self.conformers[conformer_id].positions
        except IndexError as e:
            if conformer_id == -1:
                # no conformers available, so we generate one with 2d coords,
                # save the positions, then delete the conf

                self.conformers.append_2d()
                pos = self.conformers[0].positions

                del self.conformers[0]
            else:
                raise e

        atoms = [{'x': p[0], 'y': p[1], 'z': p[2], 'l': s}
                 for s, p in zip(self.atoms.symbol, pos.round(4))]

        bonds = [b.to_dict() for b in self.bonds]

        return {"m": [{"a": atoms, "b": bonds}]}

    def to_json(self, kind='chemdoodle'):

        """ Serialize a molecule using JSON.

        Args:
            kind (str):
                The type of serialization to use.  Only `chemdoodle` is
                currently supported.

        Returns:
            str: the json string. """

        return json.dumps(self.to_dict(kind=kind))

    def to_inchi_key(self):

        """ The InChI key of the molecule.

        Returns:
            str: the InChI key.

        Raises:
            RuntimeError"""

        if not rdkit.Chem.inchi.INCHI_AVAILABLE:
            raise ImportError("InChI module not available.")

        res = rdkit.Chem.InchiToInchiKey(self.to_inchi())

        if res is None:
            raise RuntimeError("An InChI key could not be generated.")

        return res

    def to_binary(self):

        """  Serialize the molecule to binary encoding.

        Returns:
            bytes: the molecule in bytes.

        Notes:
            Due to limitations in RDKit, not all data is serialized.  Notably,
            properties are not, so e.g. compound names are not saved."""

        return self.ToBinary()

    @classmethod
    def from_binary(cls, binary):

        """ Decode a molecule from a binary serialization.

        Args:
            binary: The bytes string to decode.

        Returns:
            skchem.Mol: The molecule encoded in the binary."""

        return cls(binary)

    def copy(self):

        """ Return a copy of the molecule. """

        return Mol.from_super(copy.deepcopy(self))

    def __repr__(self):
        try:
            formula = self.to_formula()
        except ValueError:
            # if we can't generate the formula, just say it is unknown
            formula = 'unknown'

        return '<{klass} name="{name}" formula="{form}" at {address}>'.format(
            klass=self.__class__.__name__,
            name=self.name,
            form=formula,
            address=hex(id(self)))

    def __contains__(self, item):
        if isinstance(item, Mol):
            return self.HasSubstructMatch(item)
        else:
            msg = 'No way to check if {} contains {}'.format(self, item)
            raise NotImplementedError(msg)

    def __eq__(self, item):
        if isinstance(item, self.__class__):
            return (self in item) and (item in self)
        else:
            return False

    def __str__(self):
        return '<Mol: {}>'.format(self.to_smiles())

def bind_constructor(constructor_name, name_to_bind=None):

    """ Bind an (rdkit) constructor to the class """

    @classmethod
    def constructor(_, in_arg, name=None, *args, **kwargs):

        """ The constructor to be bound. """

        m = getattr(rdkit.Chem, 'MolFrom' + constructor_name)(in_arg, *args,
                                                              **kwargs)
        if m is None:
            raise ValueError('Failed to parse molecule, {}'.format(in_arg))
        m = Mol.from_super(m)
        m.name = name
        return m

    setattr(Mol, 'from_{}'.format(constructor_name).lower()
                 if name_to_bind is None else name_to_bind, constructor)

def bind_serializer(serializer_name, name_to_bind=None):

    """ Bind an (rdkit) serializer to the class """

    def serializer(self, *args, **kwargs):

        """ The serializer to be bound. """
        with Suppressor():
            return getattr(rdkit.Chem, 'MolTo' + serializer_name)(self, *args,
                                                                  **kwargs)

    setattr(Mol, 'to_{}'.format(serializer_name).lower()
                 if name_to_bind is None else name_to_bind, serializer)

CONSTRUCTORS = ['Inchi', 'Smiles', 'Mol2Block', 'Mol2File', 'MolBlock',
                'MolFile', 'PDBBlock', 'PDBFile', 'Smarts', 'TPLBlock',
                'TPLFile']
SERIALIZERS = ['Inchi', 'Smiles', 'MolBlock', 'MolFile', 'PDBBlock', 'Smarts',
               'TPLBlock', 'TPLFile']

list(map(bind_constructor, CONSTRUCTORS))
list(map(bind_serializer, SERIALIZERS))


text:
package com.brandtapps.remindem.extras;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Reader;
import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.net.HttpURLConnection;
import android.app.IntentService;
import android.content.Intent;

public class CommunicationsIntentService extends IntentService {

	public static final String PARAM_ACTION = "ACTION";
	public static final String PARAM_IN_JSON = "JSON_IN";
	public static final String PARAM_OUT_JSON = "JSON_OUT";
	public static final String PARAM_RECEIVER = "RECEIVER";
	public static final String PARAM_OUT_ERROR_MESSAGE = "ERROR_MESSAGE";

	public CommunicationsIntentService() {
		super("CommunicationsIntentService");
	}

	@Override
	protected void onHandleIntent(Intent intent) {

		InputStream is = null;
		HttpURLConnection conn = null;

		String errorMessage = "";
		int len = 1024;
		String response = null;
		String Receiver = "";
		OutputStream os = null;

		try {
			String Action = intent.getStringExtra(PARAM_ACTION);
			String JSON = intent.getStringExtra(PARAM_IN_JSON);
			Receiver = intent.getStringExtra(PARAM_RECEIVER);

			URL url = new URL("http://www.williamsportsda.com/apps/" + Action);
			conn = (HttpURLConnection) url.openConnection();
			conn.setReadTimeout(20000);
			conn.setConnectTimeout(20000);
			conn.setRequestMethod("POST");
			conn.setRequestProperty("Content-Type", "application/json");
			conn.setRequestProperty("Accept", "application/json");
			conn.setDoInput(true);

			os = conn.getOutputStream();
			OutputStreamWriter writer = new OutputStreamWriter(os, "UTF-8");
			if (JSON != null)
				writer.write(JSON);
			writer.flush();
			writer.close();

			conn.connect();
			int respCd = conn.getResponseCode();

			if (respCd == 200) {
				is = conn.getInputStream();

				// handle redirect
				if (!url.getHost().equals(conn.getURL().getHost())) {
					throw new Exception("Url Redirected.");
				}

				response = slurp(is, len);
			}

		} catch (Exception e) {
			errorMessage = "Internet Connection Failure.";
			e.printStackTrace();
		} finally {

			if (os != null) {
				try {
					os.close();
				} catch (IOException e) {
				}
			}

			if (conn != null)
				conn.disconnect();

			if (is != null) {
				try {
					is.close();
				} catch (IOException e) {
				}
			}

		}

		if (Receiver != null && Receiver != "") {

			Intent broadcastIntent = new Intent();
			broadcastIntent.setAction(Receiver);
			broadcastIntent.addCategory(Intent.CATEGORY_DEFAULT);
			broadcastIntent.putExtra(PARAM_OUT_JSON, response);
			broadcastIntent.putExtra(PARAM_OUT_ERROR_MESSAGE, errorMessage);
			sendBroadcast(broadcastIntent);
		}

	}

	public static String slurp(final InputStream is, final int bufferSize) {
		final char[] buffer = new char[bufferSize];
		final StringBuilder out = new StringBuilder();
		try {
			final Reader in = new InputStreamReader(is, "UTF-8");
			try {
				for (;;) {
					int rsz = in.read(buffer, 0, buffer.length);
					if (rsz < 0)
						break;
					out.append(buffer, 0, rsz);
				}
			} finally {
				in.close();
			}
		} catch (UnsupportedEncodingException e) {

		} catch (IOException e) {

		}
		return out.toString();
	}

}


text:
sudo apt-get update -y
sudo apt-get install -y apache2 git php5 php5-curl mysql-client curl php5-mysql php5-imagick libmagickwand-dev

git clone https://github.com/lruiabc/itmo544-mpf.git

mv ./../itmo544-mpf/images /var/www/html/images
mv ./../itmo544-mpf/image /var/www/html/image
mv ./../itmo544-mpf/css /var/www/html/css
mv ./../itmo544-mpf/js /var/www/html/js
mv ./../itmo544-mpf/vendor /var/www/html/vendor
mv ./../itmo544-mpf/index.html /var/www/html
mv ./../itmo544-mpf/*.php /var/www/html

curl -sS http://getcomposer.org/installer | php
php composer.phar require aws/aws-sdk-php

sudo mv ./../itmo544-mpf/vendor /var/www/html/vendor

sudo php /var/www/html/setup.php

echo "hello!" >/tmp/hello.txt

sudo reboot


text:
<html>
<head>
    <title></title>
</head>
<body>
<!-- build:js scripts/main.js -->
<script src="scripts/main.js"></script>
<script src="scripts/models/application.js"></script>
<!-- endbuild -->
</body>
</html>


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.orechou.alfred.dao.system.RoleMapper">

	<!-- 通用查询映射结果 -->
	<resultMap id="BaseResultMap" type="com.orechou.alfred.domain.system.Role">
		<id column="role_id" property="roleId" />
		<result column="name" property="name" />
		<result column="remark" property="remark" />
		<result column="create_time" property="createTime" />
		<result column="update_time" property="updateTime" />
		<result column="create_user_id" property="createUserId" />
	</resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        role_id AS roleId, name, remark, create_time AS createTime, update_time AS updateTime, create_user_id AS createUserId
    </sql>

</mapper>


text:
package org.apfloat.internal;

import org.apfloat.*;
import org.apfloat.spi.*;

import junit.framework.TestSuite;

/**
 * @version 1.9.0
 * @author Mikko Tommila
 */

public class RawtypeAdditionStrategyTest
    extends RawtypeTestCase
    implements RawtypeRadixConstants
{
    public RawtypeAdditionStrategyTest(String methodName)
    {
        super(methodName);
    }

    public static void main(String[] args)
    {
        junit.textui.TestRunner.run(suite());
    }

    public static TestSuite suite()
    {
        TestSuite suite = new TestSuite();

        suite.addTest(new RawtypeAdditionStrategyTest("testAdd"));
        suite.addTest(new RawtypeAdditionStrategyTest("testSubtract"));
        suite.addTest(new RawtypeAdditionStrategyTest("testMultiplyAdd"));
        suite.addTest(new RawtypeAdditionStrategyTest("testDivide"));

        return suite;
    }

    private static DataStorage createDataStorage(rawtype[] data)
    {
        int size = data.length;
        ApfloatContext ctx = ApfloatContext.getContext();
        DataStorageBuilder dataStorageBuilder = ctx.getBuilderFactory().getDataStorageBuilder();
        DataStorage dataStorage = dataStorageBuilder.createDataStorage(size * sizeof(rawtype));
        dataStorage.setSize(size);

        try (ArrayAccess arrayAccess = dataStorage.getArray(DataStorage.WRITE, 0, size))
        {
            System.arraycopy(data, 0, arrayAccess.getData(), arrayAccess.getOffset(), size);
        }

        return dataStorage;
    }

    private static void check(String message, rawtype[] expected, DataStorage actual)
    {
        try (ArrayAccess arrayAccess = actual.getArray(DataStorage.READ, 0, expected.length))
        {
            assertEquals(message + " length", expected.length, arrayAccess.getLength());
            for (int i = 0; i < arrayAccess.getLength(); i++)
            {
                assertEquals(message + " [" + i + "]", (long) expected[i], (long) arrayAccess.getRawtypeData()[arrayAccess.getOffset() + i]);
            }
        }
    }

    public static void testAdd()
    {
        DataStorage src1 = createDataStorage(new rawtype[] { (rawtype) 0, (rawtype) 1, (rawtype) 2, (rawtype) 3 }),
                    src2 = createDataStorage(new rawtype[] { (rawtype) 4, (rawtype) 5, (rawtype) 6, (rawtype) 7 }),
                    dst = createDataStorage(new rawtype[4]);

        RawtypeAdditionStrategy strategy = new RawtypeAdditionStrategy(10);
        rawtype carry = strategy.zero();

        carry = strategy.add(src1.iterator(DataStorage.READ, 0, 4),
                             src2.iterator(DataStorage.READ, 0, 4),
                             carry,
                             dst.iterator(DataStorage.WRITE, 0, 4),
                             4);

        assertEquals("carry", strategy.zero(), (RawType) carry);
        check("result", new rawtype[] { (rawtype) 4, (rawtype) 6, (rawtype) 8, (rawtype) 10 }, dst);
    }

    public static void testSubtract()
    {
        DataStorage src1 = createDataStorage(new rawtype[] { (rawtype) 4, (rawtype) 5, (rawtype) 6, (rawtype) 7 }),
                    src2 = createDataStorage(new rawtype[] { (rawtype) 0, (rawtype) 1, (rawtype) 2, (rawtype) 3 }),
                    dst = createDataStorage(new rawtype[4]);

        RawtypeAdditionStrategy strategy = new RawtypeAdditionStrategy(10);
        rawtype carry = strategy.zero();

        carry = strategy.subtract(src1.iterator(DataStorage.READ, 0, 4),
                                  src2.iterator(DataStorage.READ, 0, 4),
                                  carry,
                                  dst.iterator(DataStorage.WRITE, 0, 4),
                                  4);

        assertEquals("carry", strategy.zero(), (RawType) carry);
        check("result", new rawtype[] { (rawtype) 4, (rawtype) 4, (rawtype) 4, (rawtype) 4 }, dst);
    }

    public static void testMultiplyAdd()
    {
        DataStorage src1 = createDataStorage(new rawtype[] { (rawtype) 1, (rawtype) 2, (rawtype) 3, (rawtype) 4 }),
                    src2 = createDataStorage(new rawtype[] { (rawtype) 5, (rawtype) 6, (rawtype) 7, (rawtype) 8 }),
                    dst = createDataStorage(new rawtype[4]);

        RawtypeAdditionStrategy strategy = new RawtypeAdditionStrategy(10);
        rawtype carry = strategy.zero();

        carry = strategy.multiplyAdd(src1.iterator(DataStorage.READ, 0, 4),
                                     src2.iterator(DataStorage.READ, 0, 4),
                                     (rawtype) 9,
                                     carry,
                                     dst.iterator(DataStorage.WRITE, 0, 4),
                                     4);

        assertEquals("carry", strategy.zero(), (RawType) carry);
        check("result", new rawtype[] { (rawtype) 14, (rawtype) 24, (rawtype) 34, (rawtype) 44 }, dst);
    }

    public static void testDivide()
    {
        DataStorage src1 = createDataStorage(new rawtype[] { (rawtype) 0, (rawtype) 2, (rawtype) 4, (rawtype) 7 }),
                    dst = createDataStorage(new rawtype[4]);

        RawtypeAdditionStrategy strategy = new RawtypeAdditionStrategy(10);
        rawtype carry = strategy.zero();

        carry = strategy.divide(src1.iterator(DataStorage.READ, 0, 4),
                                (rawtype) 2,
                                carry,
                                dst.iterator(DataStorage.WRITE, 0, 4),
                                4);

        assertEquals("carry", 1, (long) carry);
        check("result", new rawtype[] { (rawtype) 0, (rawtype) 1, (rawtype) 2, (rawtype) 3 }, dst);
    }
}


text:
import 'babel-polyfill';
import Example from './container';
import React from 'react';
import ReactDOM from 'react-dom';

ReactDOM.render(
    <Example />,
    document.getElementById('target')
);


text:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>AnimateGame</title>

<script src="https://code.createjs.com/easeljs-0.8.1.min.js"></script>
<script src="https://code.createjs.com/tweenjs-0.6.1.min.js"></script>
<script src="https://code.createjs.com/movieclip-0.8.1.min.js"></script>
<script src="AnimateGame.js"></script>

<script>
var canvas, stage, exportRoot;

function init() {
	canvas = document.getElementById("canvas");
	exportRoot = new lib.AnimateGame();

	stage = new createjs.Stage(canvas);
	stage.addChild(exportRoot);
	stage.update();
	stage.enableMouseOver();

	createjs.Ticker.setFPS(lib.properties.fps);
	createjs.Ticker.addEventListener("tick", stage);
}
</script>
</head>

<body onload="init();" style="background-color:#D4D4D4;margin:0px;">
	<canvas id="canvas" width="1280" height="720" style="background-color:#FFFFFF"></canvas>
</body>
</html>


text:
/* MACHINE GENERATED FILE, DO NOT EDIT */

package org.lwjgl.opengl;

import org.lwjgl.*;
import java.nio.*;

public final class ARBDrawBuffers {

	/**
	 *  Accepted by the <pname> parameters of GetIntegerv, GetFloatv,
	 *  and GetDoublev:
	 */
	public static final int GL_MAX_DRAW_BUFFERS_ARB = 0x8824,
		GL_DRAW_BUFFER0_ARB = 0x8825,
		GL_DRAW_BUFFER1_ARB = 0x8826,
		GL_DRAW_BUFFER2_ARB = 0x8827,
		GL_DRAW_BUFFER3_ARB = 0x8828,
		GL_DRAW_BUFFER4_ARB = 0x8829,
		GL_DRAW_BUFFER5_ARB = 0x882A,
		GL_DRAW_BUFFER6_ARB = 0x882B,
		GL_DRAW_BUFFER7_ARB = 0x882C,
		GL_DRAW_BUFFER8_ARB = 0x882D,
		GL_DRAW_BUFFER9_ARB = 0x882E,
		GL_DRAW_BUFFER10_ARB = 0x882F,
		GL_DRAW_BUFFER11_ARB = 0x8830,
		GL_DRAW_BUFFER12_ARB = 0x8831,
		GL_DRAW_BUFFER13_ARB = 0x8832,
		GL_DRAW_BUFFER14_ARB = 0x8833,
		GL_DRAW_BUFFER15_ARB = 0x8834;

	private ARBDrawBuffers() {}

	public static void glDrawBuffersARB(IntBuffer buffers) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glDrawBuffersARB;
		BufferChecks.checkFunctionAddress(function_pointer);
		BufferChecks.checkDirect(buffers);
		nglDrawBuffersARB(buffers.remaining(), MemoryUtil.getAddress(buffers), function_pointer);
	}
	static native void nglDrawBuffersARB(int buffers_size, long buffers, long function_pointer);

	/** Overloads glDrawBuffersARB. */
	public static void glDrawBuffersARB(int buffer) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glDrawBuffersARB;
		BufferChecks.checkFunctionAddress(function_pointer);
		nglDrawBuffersARB(1, APIUtil.getInt(caps, buffer), function_pointer);
	}
}


text:
import { Observable } from '../../Observable';
import { mergeMapTo } from '../../operator/mergeMapTo';
Observable.prototype.flatMapTo = (mergeMapTo);
Observable.prototype.mergeMapTo = (mergeMapTo);


text:
<?php

namespace AppBundle\Command;

use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class CommanderHelperCommand extends ContainerAwareCommand
{
    protected function configure()
    {
        $this
            ->setName('commander:helper')
            ->setDescription('All commander commands')
        ;
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $io = new SymfonyStyle($input, $output);
        $io->title('Commander version 0.0.1');
        $io->section('Commands');
        $io->listing(array(
            'list-servers',
            'add-server',
            'delete-server',
            'list-repositories',
            'add-repository',
            'delete-repository',
            'check-repositories',
        ));
    }
}


text:
by Sven Nilsen, 2020

In lambda calculus, there is no direct way for a function to call itself recursively,
since the identity of the function is anonymous.

For example, the [Fibonacci sequence](https://en.wikipedia.org/wiki/Fibonacci_number):

```rust
f(x) = if x == 0 {0} else if x == 1 {1} else {f(x-1) + f(x-2)}
```

Assume that this was defined as a lambda:

```rust
f := \(x) = ...
```

How would you define this function as a recursive definition of the Fibonacci sequence?

There is one obvious trick one can use: Make the function take an argument that is "itself".

```rust
f := \(f, x) = if x == 0 {0} else if x == 1 {1} else {f(f, x-1) + f(f, x-2)}

println(f(f, 6)) // Prints `8`
```

Notice that this requires calling the function with itself as first argument.

Ideally, one would like to write this:

```rust
f := \(f, x) = if x == 0 {0} else if x == 1 {1} else {f(x-1) + f(x-2)}
```

There is a trick: A fixpoint combinator is a higher order function that makes it possible
to transform a function taking itself as argument into function that does not require an argument to itself.

The [Y-combinator](https://en.wikipedia.org/wiki/Fixed-point_combinator) is the most famous one.

```rust
y := \(f) = {
    g := \(x) = f(x(x))
    g(g)
}

f := \(f) = \(x) = if x == 0 {0} else if x == 1 {1} else {f(x-1) + f(x-2)}

f := y(f)

println(f(6)) // Prints `8`
```

The problem is that in languages with eager evaluation,
`x(x)` never terminates.

Let's try another combinator, calling this Y-combinator for "Y2":

```rust
y2 := \(f) = {
    g := \(x) = f(x)
    g(g)
}

f := \(f) = \(x) = if x == 0 {0} else if x == 1 {1} else {
    f := y2(f) // Create function for recursion.
    f(x-1) + f(x-2)
}

f := y2(f)

println(f(6)) // Prints `8`
```

Apparently, this works just as fine.

Now, is it perfect? No!

Why do you need to create the function for recursion *inside the function declaration*?

In the [Standard Dictionary of Path Semantics](https://github.com/advancedresearch/path_semantics/blob/master/papers-wip/alphabetic-list-of-functions.pdf),
there is an "sc" fixpoint combinator for that:

```rust
sc := \(sc, f) = \(n) = f(sc(sc, f), n)

f := \(f, n) = if n == 0 {0} else if n == 1 {1} else {f(n-1) + f(n-2)}

f := sc(sc, f)

println(f(6)) // Prints `8`
```

One difference between the "sc" combinator and the Y-kinds of combinators,
is that "sc" takes itself as argument.

You can not achieve this with the "Y2" combinator because it can not call itself.
The "sc" combinator calls itself with itself, such that it can call `f` with the `f's self`.