text:
<?xml version="1.0" encoding="UTF-8" ?>
<class name="XROrigin3D" inherits="Node3D" version="4.0">
	<brief_description>
		The origin point in AR/VR.
	</brief_description>
	<description>
		This is a special node within the AR/VR system that maps the physical location of the center of our tracking space to the virtual location within our game world.
		There should be only one of these nodes in your scene and you must have one. All the XRCamera3D, XRController3D and XRAnchor3D nodes should be direct children of this node for spatial tracking to work correctly.
		It is the position of this node that you update when your character needs to move through your game world while we're not moving in the real world. Movement in the real world is always in relation to this origin point.
		For example, if your character is driving a car, the XROrigin3D node should be a child node of this car. Or, if you're implementing a teleport system to move your character, you should change the position of this node.
	</description>
	<tutorials>
		<link title="VR documentation index">https://docs.godotengine.org/en/latest/tutorials/vr/index.html</link>
	</tutorials>
	<members>
		<member name="world_scale" type="float" setter="set_world_scale" getter="get_world_scale" default="1.0">
			Allows you to adjust the scale to your game's units. Most AR/VR platforms assume a scale of 1 game world unit = 1 real world meter.
			[b]Note:[/b] This method is a passthrough to the [XRServer] itself.
		</member>
	</members>
</class>


text:
Week 04: Assignment
===================

Please place your Jupyter notebooks or Python scripts for each of Lessons 4, 5,
and 6 in the corresponding directories, named according to the
`firstinitiallastname_0x.ipynb` naming scheme, where x = 4, 5, or 6.

For example, my files should be named `dsirianni_04.ipynb`,
`dsirianni_05.ipynb`, & `dsirianni_06.ipynb`, placed in the `Lesson04`,
`Lesson05`, and `Lesson06` directories, respectively.

redpajama_set_name: RedPajamaGithub


text:
package org.metaeffekt.core.maven.inventory.mojo;

import org.apache.maven.plugins.annotations.Parameter;

import java.util.Map;

public class RemoteUriResolver {

    @Parameter
    private Map<String, Object> properties;

    public Map<String, Object> getProperties() {
        return properties;
    }

    public void setProperties(Map<String, Object> properties) {
        this.properties = properties;
    }

}


text:
#ifndef __APPS_EXAMPLES_BAS_BAS_STR_H
#define __APPS_EXAMPLES_BAS_BAS_STR_H

/****************************************************************************
 * Included Files
 ****************************************************************************/

#include <sys/types.h>

/****************************************************************************
 * Public Types
 ****************************************************************************/

struct String
{
  size_t length;
  char *character;
  struct StringField *field;
};

struct StringField
{
  struct String **refStrings;
  int refCount;
};

/****************************************************************************
 * Public Function Prototypes
 ****************************************************************************/

int cistrcmp(const char *s, const char *r);

struct String *String_new(struct String *this);
void String_destroy(struct String *this);
int String_joinField(struct String *this, struct StringField *field,
                     char *character, size_t length);
void String_leaveField(struct String *this);
struct String *String_clone(struct String *this, const struct String *clon);
int String_appendString(struct String *this, const struct String *app);
int String_appendChar(struct String *this, char ch);
int String_appendChars(struct String *this, const char *ch);
int String_appendPrintf(struct String *this, const char *fmt, ...);
int String_insertChar(struct String *this, size_t where, char ch);
int String_delete(struct String *this, size_t where, size_t len);
void String_ucase(struct String *this);
void String_lcase(struct String *this);
int String_size(struct String *this, size_t length);
int String_cmp(const struct String *this, const struct String *s);
void String_lset(struct String *this, const struct String *s);
void String_rset(struct String *this, const struct String *s);
void String_set(struct String *this, size_t pos, const struct String *s,
                size_t length);

struct StringField *StringField_new(struct StringField *this);
void StringField_destroy(struct StringField *this);

#endif /* __APPS_EXAMPLES_BAS_BAS_STR_H */


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

/*
govc util holds various helper methods to be consumed by testcase.
It levereges govc CLI, parses json response and serves testcase/verification
util need.

For now, leaving the printf() calls commented out.
Once we have debug logs for tests then we can add these.
If some test is misbehaving, then the developer can enable that log and test.
*/

package esx

import (
	"log"
	"strings"

	"github.com/vmware/docker-volume-vsphere/tests/constants/esx"
	"github.com/vmware/docker-volume-vsphere/tests/utils/misc"
	"github.com/vmware/docker-volume-vsphere/tests/utils/ssh"
)

const (
	esxcliJSON = esx.JSONTypeOutput + "| " + esx.JSONParser
)

// RetrieveVMNameFromIP util retrieves VM  name from passed VM IP
//govc vm.info -vm.ip=10.20.104.62 -json | jq -r .VirtualMachines[].Name
func RetrieveVMNameFromIP(ip string) string {
	// log.Printf("Finding VM name from IP Address [%s]\n", ip)
	cmd := esx.VMInfoByIP + ip + esxcliJSON + esx.VMName
	return ssh.InvokeCommandLocally(cmd)
}

// GetVMPowerState util retrieves VM's current power state
// govc vm.info -json photon1 | jq -r .VirtualMachines[].Runtime.PowerState
func GetVMPowerState(vmName string) string {
	// log.Printf("Retrieving VM power state for [%s]\n", vmName)
	cmd := esx.VMInfo + esx.JSONTypeOutput + vmName + " | " + esx.JSONParser + esx.VMPowerState
	return ssh.InvokeCommandLocally(cmd)
}

// PowerOnVM util powers on the VM
// govc vm.power -on=true photon
func PowerOnVM(vmName string) string {
	// log.Printf("Powering on VM [%s]\n", vmName)
	cmd := esx.PowerOnVM + vmName
	return ssh.InvokeCommandLocally(cmd)
}

// PowerOffVM util powers off the VM
// govc vm.power -off=true photon
func PowerOffVM(vmName string) string {
	// log.Printf("Powering off VM [%s]\n", vmName)
	cmd := esx.PowerOffVM + vmName
	return ssh.InvokeCommandLocally(cmd)
}

// GetDatastoreList returns a list of datastore names available
func GetDatastoreList() []string {
	// log.Printf("Finding Datastores available on ESX")
	cmd := esx.DatastoreInfo + esxcliJSON + esx.DatastoreList
	out := ssh.InvokeCommandLocally(cmd)
	return strings.Fields(out)
}

// GetDatastoreByType returns the datastore name of type specified
func GetDatastoreByType(typeName string) string {
	cmd := esx.DatastoreInfo + esxcliJSON + " '.Datastores[].Summary | select(.Type==\"" + typeName + "\") | .Name'"
	return ssh.InvokeCommandLocally(cmd)
}

// CreateVM creates a vm on the specified ds and esx
func CreateVM(vmName, datastore, networkAdapterType string) string {
	log.Printf("Creating a vm [%s] \n", vmName)
	cmd := esx.VMCreate + datastore + " -on=false -link=false -net.adapter=" + networkAdapterType + " " + vmName
	return ssh.InvokeCommandLocally(cmd)
}

// DestroyVM deletes a vm
func DestroyVM(vmName string) string {
	log.Printf("Deleting a vm - %s \n", vmName)
	cmd := esx.VMDestroy + vmName
	return ssh.InvokeCommandLocally(cmd)
}

// IsVMExist returns true/false based on vm existence
func IsVMExist(vmName string) bool {
	log.Printf("Verifying if vm - %s exists \n", vmName)
	maxAttempt := 15
	waitTime := 2
	for attempt := 0; attempt < maxAttempt; attempt++ {
		vmList := ssh.InvokeCommandLocally(esx.ListVMs + " /ha-datacenter/vm")
		if strings.Contains(vmList, vmName) {
			return true
		}
		misc.SleepForSec(waitTime)
	}
	return false
}


text:
import * as React from 'react';
import styled, {keyframes} from 'styled-components';
import random from 'random';

import Shape from '/component/base/Shape';

const StyledComponent = styled(() => null)({}).render().type;
const StyleSheetConsumer = new StyledComponent({}).render().type;

const ConfettiContainer = styled(({width: _w, height: _h, ...rest}) => (
  <div {...rest} />
))`
  position: relative;
  width: ${({width}) => width}px;
  height: ${({height}) => height}px;
`;

const drift = ({rotate = 0, x, y}) => {
  return keyframes`
    0% {
      transform: translate(${x}px, ${y}px) rotate(${rotate}deg);
    }
    100% {
      transform: translate(0,0);
    }
  `;
};

/**
 * Provides an animatable wrapper for each Confetti shape.
 *
 * Animation param order: `name duration timing delay direction iterations fill-mode play-state`
 *
 * Problem 1: shapes all animate at the same time, looks robotic
 * Solution 1: add a random 0-2s animation-delay, inline style, overrides default 0s
 *
 * Problem 2: Long delays noticeably stutter shapes when animation finally starts
 * Solution 2: specify starting transform via inline style
 *
 * Problem 3: document contains 98113 bytes of CSS
 * Solution 3: ...
 */
const ConfettiWrapper = styled(
  ({angle: _a, x: x, y: y, rotate: r = 0, ...rest}) => {
    const delay = random.float(0, 2).toFixed(2);
    const anim = drift({rotate: r, x, y});
    return (
      <StyleSheetConsumer>
        {(sheet) => {
          anim.inject(sheet);
          return (
            <div
              {...rest}
              style={{
                animationName: anim.getName(),
                animationDelay: `${delay}s`,
                // transform: `translate(${x}px, ${y}px) rotate(${r}deg)`,
              }}
            />
          );
        }}
      </StyleSheetConsumer>
    );
  },
)`
  animation: 4s ease-in-out 0s alternate infinite none running;
`;

const capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
const coords = (angle = 0, distance) => {
  let a = Math.abs(angle);

  if (a === 0) {
    a = random.int(-359, 359);
  }

  let x = Math.trunc((distance * Math.sin(a)) / Math.sin(90));
  let y = Math.trunc((distance * Math.sin(90 - a)) / Math.sin(90));
  if (angle < 0) {
    x = -x;
    y = -y;
  }
  return {a, x, y};
};

const Confetti = styled(
  class Confetti extends React.Component {
    render() {
      const {pieces, size, color, ...rest} = this.props;
      const width = pieces.reduce((prev, cur) => {
        return Math.max(prev, cur.left + cur.size);
      }, 0);
      const height = pieces.reduce((prev, cur) => {
        return Math.max(prev, cur.top + cur.size);
      }, 0);
      return (
        <ConfettiContainer width={width} height={height} {...rest}>
          {pieces.map(({type, color: c = color, rotate: r, ...rest}, i) => {
            const {a, x, y} = coords(rest.angle, rest.size);
            const Component = Shape[capitalize(type)];

            return (
              <ConfettiWrapper angle={a} x={x} y={y} rotate={r} key={i}>
                <Component key={i} size={size} color={c} {...rest} />
              </ConfettiWrapper>
            );
          })}
        </ConfettiContainer>
      );
    }
  },
)``;

export default Confetti;


text:
package com.birthstone.widgets;

import android.app.Dialog;
import android.content.Context;
import android.util.Log;
import android.view.View;

import com.birthstone.base.helper.ReleaseHelper;
import com.birthstone.core.interfaces.IChildView;
import com.birthstone.core.parse.DataCollection;
import com.birthstone.core.parse.DataTable;

import java.util.LinkedList;
import java.util.List;

/**
 * Created by Ming on 2017/11/27.
 */

public class ESDialog extends Dialog implements IChildView
{
    /**存储实例化的View**/
    private List<View> views = new LinkedList<>();

    /**参数集合**/
    private DataCollection params;

    public ESDialog(Context context)
    {
        super(context);
    }

    public ESDialog(Context context, int resID)
    {
        super(context,resID);
    }

    @Override
    public View findViewById (int id)
    {
        View view = super.findViewById(id);
        views.add(view);
        return view;
    }

    /**
     *发布数据集到当前屏幕
     * */
    public void release(DataCollection params)
    {
        ReleaseHelper releaseHelper;
        try
        {
            releaseHelper = new ReleaseHelper(params, this);
            releaseHelper.release(null);
        }
        catch(Exception ex)
        {
            Log.e("", ex.getMessage());
        }
    }

    /**
     * 发布数据集到当前屏幕
     * @param tag 发布数据时用以区分标识
     * @param params 数据集
     */
    public void release (int tag,DataCollection params)
    {
        ReleaseHelper releaseHelper;
        try
        {
            releaseHelper = new ReleaseHelper(params, this);
            releaseHelper.release(null);
        }
        catch(Exception ex)
        {
            Log.e("", ex.getMessage());
        }
    }

    @Override
    public void release(int tag, DataTable table)
    {

    }

    /**
     *添加view到当前视图容器
     * @param view 视图
     * **/
    public void addView(View view)
    {
        if(views==null)
        {
            views = new LinkedList<>();
        }
        views.add(view);
    }

    /**
     *获取当前弹出框的所有View
     * **/
    public List<View> getViews ()
    {
        return views;
    }
}


text:
Currently, there are 2 options for Go projects:

 - `go-workspace.mk`: For GOPATH workspaces
 - `go-mod.mk`: For Go 1.11 modules

Besides the differences outlined in this section, `go-workspace.mk`
and `go-mod.mk` should work more-or-less identically.

### Initializing a `go-workspace.mk` project

	$ MODULE=EXAMPLE.COM/YOU/GITREPO

	$ echo 'include build-aux/go-workspace.mk' >> Makefile
	$ echo /.go-workpsace >> .gitignore
	$ echo "!/.go-workspace/src/${MODULE}" >> .gitignore
	$ mkdir -p $(dirname .go-workspace/src/${MODULE})
	$ ln -s $(dirname .go-workspace/src/${MODULE} | sed -E 's,[^/]+,..,g') .go-workspace/src/${MODULE}

What's that big expression in the `ln -s` command!?  It's the same as

	$ ln -sr . .go-workspace/src/${MODULE}

but for lame operating systems that ship an `ln` that doesn't
understand the `-r` flag.

### Initializing a `go-mod.mk` project

	$ go mod init EXAMPLE.COM/YOU/GITREPO

	$ echo 'include build-aux/go-mod.mk' >> Makefile

### Migrating from `go-workspace.mk` to `go-mod.mk`

	$ go mod init EXAMPLE.COM/YOU/GITREPO

	$ make clobber
	$ rm -rf -- .go-workspace vendor glide.* Gopkg.*
	$ sed -i -E 's,/go-workspace\.mk,/go-mod.mk,' Makefile
	$ sed -i -e '/\.go-workspace/d' .gitignore

## Using `go-{mod,workspace}.mk`

`go-{mod,workspace}.mk` try hard to automatically find whatever source
files you write, and do the right thing for each of the standard
`common.mk` targets.  By default:

 - `build`: Any `package "main"` package will automatically get build,
   and placed in `./bin_$(GOOS)_$(GOARCH)` (assuming the `+build` tags
   pass).  If you have any helper scripts that you intend to run with
   `go run`, and don't want to be compiled, you should put `// +build
   ignore` in them.
 - `check`: All packages in your project are automatically tested with `go test`.
 - `lint`: All packages in your project are automatically linted with
   `go vet`, and are verified to be formatted with `gofmt -s`.
 - When using `go-workspace.mk`, the `vendor` directory is created
   automatically, using either Glide (if `glide.yaml` exists), or
   `dep` (if `Gopkg.toml` exists).

Knobs you can turn in your `Makefile`:

 - `go.PLATFORMS`: A list of `GOOS_GOARCH` pairs to compile
   executables for.  Just `$(go env GOOS)_$(go env GOARCH)` by default
   (that is, the host platform, unless you've set the `GOOS` or
   `GOARCH` environment variables).
 - `go.DISABLE_GO_TEST`: If set to a non-empty string, don't have
   `make check` run `go test`.  This is useful if you need to pass
   special flags to `go test`, and would like to write the rule
   yourself.
 - `make lint` behavior can be modified either by creating a
   `.golangci.yml`, `.golangci.toml`, `.golangci.json` file; or by
   setting `go.GOLANG_LINT_FLAGS`.  See the [`golangci-lint`
   docs](https://github.com/golangci/golangci-lint) for information on
   that file format, and what valid flags are.
 - `go.LDFLAGS` can specify any flags to pass to the Go linker.
   `go-version.mk` uses this to set the `main.Version` symbol.

## `go-version.mk`

If you `include build-aux/go-version.mk`, it will set `go.LDFLAGS` to
include a `main.Version` symbol, which a string set to the
`$(VERSION)` Make variable

	go.LDFLAGS += -X main.Version=$(VERSION)

If you do not set `VERSION` in your `Makefile`, it will be set
automatically by [`version.mk`](../version.mk).


text:
set -eu
. env.sh

mkdir -p $HOME/.local/share/libvirt/images

# as an installed binary:
# coreos-installer download -s "${STREAM}" -p qemu -f qcow2.xz --decompress -C ~/.local/share/libvirt/images/
# or as a container:
podman run --pull=always --rm -v $HOME/.local/share/libvirt/images/:/data -w /data \
    quay.io/coreos/coreos-installer:release download -s "${STREAM}" -p qemu -f qcow2.xz --decompress


text:
module Fog
  module Compute
    class Cloudstack

      class Real
        # Destroys a router.
        #
        # {CloudStack API Reference}[http://cloudstack.apache.org/docs/api/apidocs-4.3/root_admin/destroyRouter.html]
        def destroy_router(id, options={})
          options.merge!(
            'command' => 'destroyRouter',
            'id' => id
          )
          request(options)
        end
      end

    end
  end
end


text:
// Copyright 2013 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

goog.require('axs.AuditRules');
goog.require('axs.browserUtils');
goog.require('axs.constants.Severity');

/**
 * The purpose of each link should be clear from the link text.
 */
axs.AuditRules.addRule({
    name: 'linkWithUnclearPurpose',
    heading: 'The purpose of each link should be clear from the link text',
    url: 'https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_text_04',
    severity: axs.constants.Severity.WARNING,
    /**
     * @param {Element} element
     * @return {boolean}
     */
    relevantElementMatcher: function(element, flags) {
        return axs.browserUtils.matchSelector(element, 'a[href]') && !flags.hidden;
    },
    /**
     * @param {Element} anchor
     * @param {Object=} opt_config
     * @return {boolean}
     */
    test: function(anchor, flags, opt_config) {
        var config = opt_config || {};
        var blacklistPhrases = config['blacklistPhrases'] || [];
        var whitespaceRE = /\s+/;
        for (var i = 0; i < blacklistPhrases.length; i++) {
            // Match the blacklist phrase, case insensitively, as the whole string (allowing for
            // punctuation at the end).
            // For example, a blacklist phrase of "click here" will match "Click here." and
            // "click here..." but not "Click here to learn more about trout fishing".
            var phraseREString =
                '^\\s*' + blacklistPhrases[i].trim().replace(whitespaceRE, '\\s*') + '\s*[^a-z]$';
            var phraseRE = new RegExp(phraseREString, 'i');
            if (phraseRE.test(anchor.textContent))
                return true;
        }

        // Remove punctuation from phrase, then strip out all stopwords. Fail if remaining text is
        // all whitespace.
        var stopwords = config['stopwords'] ||
            ['click', 'tap', 'go', 'here', 'learn', 'more', 'this', 'page', 'link', 'about'];
        var filteredText = axs.properties.findTextAlternatives(anchor, {});
        if (filteredText === null || filteredText.trim() === '')
            return true;
        filteredText = filteredText.replace(/[^a-zA-Z ]/g, '');
        for (var i = 0; i < stopwords.length; i++) {
            var stopwordRE = new RegExp('\\b' + stopwords[i] + '\\b', 'ig');
            filteredText = filteredText.replace(stopwordRE, '');
            if (filteredText.trim() == '')
                return true;
        }
        return false;
    },
    code: 'AX_TEXT_04'
});


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

/*=============================================================
**
** Source:  getmodulefilenamew.c
**
** Purpose: Positive test the GetModuleFileName API.
**          Call GetModuleFileName to retrieve current process
**          full path and file name by passing a NULL module handle
**          in UNICODE
**
**
**============================================================*/
#define UNICODE
#include <palsuite.h>

#define MODULENAMEBUFFERSIZE 1024

int __cdecl main(int argc, char *argv[])
{

    DWORD ModuleNameLength;
    WCHAR *ModuleFileNameBuf;
    int err;

    //Initialize the PAL environment
    err = PAL_Initialize(argc, argv);
    if(0 != err)
    {
        ExitProcess(FAIL);
    }

    ModuleFileNameBuf = (WCHAR*)malloc(MODULENAMEBUFFERSIZE*sizeof(WCHAR));

    //retrieve the current process full path and file name
    //by passing a NULL module handle
    ModuleNameLength = GetModuleFileName(
                NULL,             //a NULL handle
                ModuleFileNameBuf,//buffer for module file name
                MODULENAMEBUFFERSIZE);

    //free the memory
    free(ModuleFileNameBuf);

    if(0 == ModuleNameLength)
    {
        Fail("\nFailed to all GetModuleFileName API!\n");
    }

    PAL_Terminate();
    return PASS;
}


text:
<title>
"The American empire needs to be corralled"
</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php include "../../legacy-includes/Script.htmlf" ?>

<?php include "../../legacy-includes/TopLogo.htmlf" ?>

<?php include "../../legacy-includes/TopAd.htmlf" ?>

<?php include "../../legacy-includes/LeftButtons.htmlf" ?>

<?php include "../../legacy-includes/BodyInsert.htmlf" ?>

Antiwar author William Blum on the Osama bin Laden tape:

"The American empire needs to be corralled"

January 27, 2006 | Page 2

WILLIAM BLUM is known to antiwar activists as the the author of several excellent history books documenting the crimes of U.S. imperialism. But last week, Blum's name was all over the media after Osama bin Laden recommended one of Blum's books in his latest taped message, the first to emerge in over a year.

Socialist Worker contributor DAVE ZIRIN, author of What's My Name, Fool? Sports and Resistance in the United States and a Nation magazine columnist, talked to Blum about his reaction.

- - - - - - - - - - - - - - - -

LAST WEEK, during his much ballyhooed audio message, Osama bin Laden gave an Oprah-style book recommendation of Rogue State by William Blum.

"If Bush decides to carry on with his lies and oppression," bin Laden said, "then it would be useful for you to read the book Rogue State, which states in its introduction: 'If I were president, I would stop the attacks on the United States: First, I would give an apology to all the widows and orphans and those who were tortured. Then I would announce that American interference in the nations of the world has ended once and for all.'"

Actually, the quote, while written by Blum, is not in fact in the Rogue State introduction. Nevertheless, sales of Rogue State from Amazon.com shot up, climbing literally overnight from number 209,000 to 18--ahead of such mass-market best-sellers as The Da Vinci Code and the collected works of John Grisham.

The 72-year-old Blum was also catapulted from obscurity to a mini-cause celebre, with interviews on CNN and articles in the Washington Post and New York Times.

The publicity allowed Blum to get a hearing for the content of Rogue State, a brilliant detailing of U.S. intervention throughout the world that painstakingly documents coups fomented, death squads trained and funded, and dictators supported. Blum's explanation of how the U.S. undermines democracy and democratic movements (many of which bin Laden himself would oppose) was a total contrast from what the media usually talk about.

Asked how he felt being recommended by bin Laden, Blum said, "Osama bin Laden and I happen to share an intense dislike for certain aspects of U.S. foreign policy and a liking for a certain book of mine. The American Empire needs to be corralled before it kills again, and bombs and tortures. If his 'endorsement' helps me to get my message to a lot more people, why should I reject it? The more people who are turned off by the empire's crimes, the sooner the empire will fall."

Blum's welcome of the bin Laden's endorsement caused CNN's Wolf Blitzer to gasp--as did Blum's analysis that the roots of the September 11 attacks lie in the deadly foreign policy of the U.S. government.

Yet Blitzer didn't ask Blum about his extensive documentation of how bin Laden is a creature of U.S. Cold War policy--a CIA-funded reactionary from a ruling Saudi family who served U.S. interest well in leading the guerrilla struggle in the 1980s against forces of the former USSR after its invasion of Afghanistan.

Asked his opinion of this side of bin Laden's history, Blum repeated his anger at U.S. policy that buttressed the Taliban regime in Afghanistan. "My dislike of religious fundamentalism and oppression of women is second to no one," Blum said.

The skyrocketing sales of Rogue State show how sincere people are about trying to understand why the U.S. is in what Dick Cheney calls a "generational war on terror." Millions of people are hungering for an explanation that goes beyond anti-Muslim racism or the idea that we are fighting "madmen" who appeared out of thin air. Those are answers that the politicians in Washington aren't willing or able to provide.

<?php include "../../legacy-includes/BottomNavLinks.htmlf" ?>

<?php include "../../legacy-includes/RightAdFolder.htmlf" ?>


text:
import datetime
import os
from django.test import TestCase
from ..query import parse

TEST_DATA_PATH = os.path.join(os.path.dirname(__file__), "test-data.xml")

class QueryTest(TestCase):
    maxDiff = None

    def test_parse(self):
        papers = parse(open(TEST_DATA_PATH).read())
        self.assertEqual(
            list(papers)[0],
            {
                "arxiv_id": "1708.03312",
                "arxiv_version": 1,
                "title": "Radical-level Ideograph Encoder for RNN-based Sentiment Analysis of Chinese and Japanese",
                "published": datetime.datetime(
                    2017, 8, 10, 17, 46, 28, tzinfo=datetime.timezone.utc
                ),
                "updated": datetime.datetime(
                    2017, 8, 10, 17, 46, 28, tzinfo=datetime.timezone.utc
                ),
                "arxiv_url": "http://arxiv.org/abs/1708.03312",
                "authors": [
                    {"affiliation": [], "name": "Yuanzhi Ke"},
                    {"affiliation": [], "name": "Masafumi Hagiwara"},
                ],
                "categories": ["cs.CL"],
                "comment": "12 pages, 4 figures",
                "doi": None,
                "journal_ref": None,
                "pdf_url": "http://arxiv.org/pdf/1708.03312",
                "primary_category": "cs.CL",
                "summary": "  The character vocabulary can be very large in non-alphabetic languages such\n"
                "as Chinese and Japanese, which makes neural network models huge to process such\n"
                "languages. We explored a model for sentiment classification that takes the\n"
                "embeddings of the radicals of the Chinese characters, i.e, hanzi of Chinese and\n"
                "kanji of Japanese. Our model is composed of a CNN word feature encoder and a\n"
                "bi-directional RNN document feature encoder. The results achieved are on par\n"
                "with the character embedding-based models, and close to the state-of-the-art\n"
                "word embedding-based models, with 90% smaller vocabulary, and at least 13% and\n"
                "80% fewer parameters than the character embedding-based models and word\n"
                "embedding-based models respectively. The results suggest that the radical\n"
                "embedding-based approach is cost-effective for machine learning on Chinese and\n"
                "Japanese.\n",
            },
        )


text:
package com.intel.icecp.node.security.keymanagement;

import com.intel.icecp.core.Channel;
import com.intel.icecp.core.Message;
import com.intel.icecp.core.Metadata;
import com.intel.icecp.core.channels.ChannelProvider;
import com.intel.icecp.core.channels.Token;
import com.intel.icecp.core.management.Channels;
import com.intel.icecp.core.metadata.Persistence;
import com.intel.icecp.core.metadata.formats.JsonFormat;
import com.intel.icecp.core.misc.ChannelLifetimeException;
import com.intel.icecp.core.pipeline.Pipeline;
import com.intel.icecp.node.channels.file.FileChannel;
import com.intel.icecp.node.channels.file.FileChannelProvider;
import com.intel.icecp.node.messages.security.CertificateMessage;
import com.intel.icecp.node.pipeline.implementations.MessageFormattingPipeline;
import java.net.URI;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

/**
 * Mock channels class for testing
 *
 */
public class MockFileOnlyChannels implements Channels {

    /**
     * UTILITY: Creates a {@link FileChannel} that loads a
     * {@link CertificateMessage}
     *
     * @param certificateID Id of the certificate (in this case, the path in the
     * file system)
     * @return A channel to fetch the certificate from a local file
     * @throws Exception If the channel creation fails
     */
    private Channel<CertificateMessage> creteFileChannel(String certificateID) throws ChannelLifetimeException {
        Path root = Paths.get("");
        FileChannelProvider builder = new FileChannelProvider();
        Pipeline pipeline = MessageFormattingPipeline.create(CertificateMessage.class, new JsonFormat<>(CertificateMessage.class));
        Channel<CertificateMessage> channel = builder.build(
                root.resolve(certificateID).toUri(),
                pipeline,
                new Persistence());
        return channel;
    }

    /**
     * Not needed {@inheritDoc }
     */
    @Override
    public void register(String scheme, ChannelProvider implementation) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public ChannelProvider get(String scheme) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    /**
     * Not needed {@inheritDoc }
     */
    @Override
    public void unregister(String scheme) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    /**
     * Not needed {@inheritDoc }
     */
    @Override
    public void shutdown() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    /**
     * Not needed {@inheritDoc }
     */
    @Override
    public <T extends Message> Channel<T> openChannel(URI uri, Class<T> messageType, Persistence persistence, Metadata... metadata) throws ChannelLifetimeException {
        return openChannel(uri, Token.of(messageType), persistence, metadata);
    }

    /**
     * Always returns a {@link FileChannel}
     * {@inheritDoc }
     */
    @Override
    public <T extends Message> Channel<T> openChannel(URI uri, Token<T> messageType, Persistence persistence, Metadata... metadata) throws ChannelLifetimeException {
        try {
            Channel ch = creteFileChannel(uri.toString());
            ch.open().get(10, TimeUnit.SECONDS);
            return ch;
        } catch (InterruptedException | ExecutionException | TimeoutException ex) {
            throw new ChannelLifetimeException("Unable to open the channel", ex);
        }
    }

    /**
     * Not needed {@inheritDoc }
     */
    @Override
    public URI[] getOpenChannels() {
        return null;
    }

}


text:
import jsonScrap = require("./JsonScraper");
import song = require("../../Song");

import winston = require("winston");

export class SixFortyScraper extends jsonScrap.JsonScraper {

    constructor(name:string) {
        super(name);
    }

    getUrl(scraperParam?:string): string {
        return "http://54.173.171.80:8000/json.xsl?callback=parseMusic&_="
            + new Date().getTime();
    }

    preprocessBody(body: string):string {
        // Strip "parseMusic(" from start and ");" from end
        var trimmed = body.substring(11, body.length - 2);
        return trimmed;
    }

    extractNowPlayingSong(jsonData:any): song.Song {
        var title = jsonData['/6forty'].title;
        var split = title.split("-");
        if (split.length > 1) {
            return {
                Artist: split[0].trim(),
                Track: split[1].trim()
            };
        }
        return { Artist: null, Track: null };
    }
}


text:
// $Id: FILE_Addr.cpp 96985 2013-04-11 15:50:32Z huangh $

#include "ace/FILE_Addr.h"
#include "ace/Lib_Find.h"
#include "ace/Log_Category.h"
#include "ace/OS_NS_stdlib.h"
#include "ace/OS_NS_string.h"
#include "ace/os_include/sys/os_socket.h"

#if !defined (__ACE_INLINE__)
#include "ace/FILE_Addr.inl"
#endif /* __ACE_INLINE__ */

ACE_BEGIN_VERSIONED_NAMESPACE_DECL

ACE_ALLOC_HOOK_DEFINE(ACE_FILE_Addr)

ACE_FILE_Addr::ACE_FILE_Addr (void)
  : ACE_Addr (AF_FILE, sizeof this->filename_ / sizeof (ACE_TCHAR))
{
  this->filename_[0] = '\0';
}

int
ACE_FILE_Addr::set (const ACE_FILE_Addr &sa)
{
  if (sa.get_type () == AF_ANY)
    {
#if defined (ACE_DEFAULT_TEMP_FILE)
      // Create a temporary file.
      ACE_OS::strcpy (this->filename_,
                      ACE_DEFAULT_TEMP_FILE);
#else /* ACE_DEFAULT_TEMP_FILE */
      if (ACE::get_temp_dir (this->filename_, MAXPATHLEN - 15) == -1)
        // -15 for ace-file-XXXXXX
        {
          ACELIB_ERROR ((LM_ERROR,
                      ACE_TEXT ("Temporary path too long, ")
                      ACE_TEXT ("defaulting to current directory\n")));
          this->filename_[0] = 0;
        }

      // Add the filename to the end
      ACE_OS::strcat (this->filename_, ACE_TEXT ("ace-fileXXXXXX"));

#endif /* ACE_DEFAULT_TEMP_FILE */

      if (ACE_OS::mktemp (this->filename_) == 0)
        return -1;
      this->base_set (AF_FILE,
                      static_cast<int> (ACE_OS::strlen (this->filename_) + 1));
    }
  else
    {
      (void)ACE_OS::strsncpy (this->filename_, sa.filename_, sa.get_size ());

      this->base_set (sa.get_type (), sa.get_size ());
    }
  return 0;
}

// Copy constructor.

ACE_FILE_Addr::ACE_FILE_Addr (const ACE_FILE_Addr &sa)
  : ACE_Addr (AF_FILE, sizeof this->filename_)
{
  this->set (sa);
}

int
ACE_FILE_Addr::set (const ACE_TCHAR *filename)
{
  this->ACE_Addr::base_set (AF_FILE,
                            static_cast<int> (ACE_OS::strlen (filename) + 1));
  (void) ACE_OS::strsncpy (this->filename_,
                           filename,
                           sizeof this->filename_ / sizeof (ACE_TCHAR));
  return 0;
}

ACE_FILE_Addr &
ACE_FILE_Addr::operator= (const ACE_FILE_Addr &sa)
{
  if (this != &sa)
    this->set (sa);
  return *this;
}

// Create a ACE_Addr from a ACE_FILE pathname.

ACE_FILE_Addr::ACE_FILE_Addr (const ACE_TCHAR *filename)
{
  this->set (filename);
}

int
ACE_FILE_Addr::addr_to_string (ACE_TCHAR *s, size_t len) const
{
  ACE_OS::strsncpy (s, this->filename_, len);
  return 0;
}

// Return the address.

void *
ACE_FILE_Addr::get_addr (void) const
{
  return (void *)&this->filename_;
}

void
ACE_FILE_Addr::dump (void) const
{
#if defined (ACE_HAS_DUMP)
  ACE_TRACE ("ACE_FILE_Addr::dump");

  ACELIB_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
  ACELIB_DEBUG ((LM_DEBUG,  ACE_TEXT ("filename_ = %s"), this->filename_));
  ACELIB_DEBUG ((LM_DEBUG, ACE_END_DUMP));
#endif /* ACE_HAS_DUMP */
}
ACE_END_VERSIONED_NAMESPACE_DECL


text:
package peer.message;

import static org.junit.Assert.*;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.junit.Test;

import peer.peerid.PeerID;

public class BundleMessageTest {

	@Test
	public void testDestinationRemoval() {
		final PeerID source = new PeerID("0");
		final Set<PeerID> dests1 = new HashSet<PeerID>();
		dests1.add(new PeerID("1"));
		dests1.add(new PeerID("2"));
		dests1.add(new PeerID("3"));
		final MessageString msgStr1 = new MessageString(source, dests1, "hello");

		final Set<PeerID> dests2 = new HashSet<PeerID>();
		dests2.add(new PeerID("2"));
		dests2.add(new PeerID("3"));
		final MessageString msgStr2 = new MessageString(source, dests2, "hello");

		final List<BroadcastMessage> messages = new ArrayList<BroadcastMessage>();
		messages.add(msgStr1);
		messages.add(msgStr2);

		final BundleMessage bundleMessage = new BundleMessage(source, messages);
		assertEquals(dests1, bundleMessage.getExpectedDestinations());
		assertEquals(messages, bundleMessage.getPayloadMessages());

		bundleMessage.removeDestination(new PeerID("2"));
		Set<PeerID> expected = new HashSet<PeerID>();
		expected.add(new PeerID("1"));
		expected.add(new PeerID("3"));
		assertEquals(expected, bundleMessage.getExpectedDestinations());
		assertEquals(messages, bundleMessage.getPayloadMessages());

		bundleMessage.removeDestination(new PeerID("3"));
		expected = new HashSet<PeerID>();
		expected.add(new PeerID("1"));
		assertEquals(expected, bundleMessage.getExpectedDestinations());

		final List<BroadcastMessage> expectedMessages = new ArrayList<BroadcastMessage>();
		expectedMessages.add(msgStr1);
		assertEquals(expectedMessages, bundleMessage.getPayloadMessages());

		bundleMessage.removeDestination(new PeerID("1"));
		assertTrue(bundleMessage.getExpectedDestinations().isEmpty());
		assertTrue(bundleMessage.getPayloadMessages().isEmpty());
	}

	@Test
	public void testSerialization() throws IOException, UnsupportedTypeException {
		final PeerID source = new PeerID("0");
		final Set<PeerID> dests1 = new HashSet<PeerID>();
		dests1.add(new PeerID("1"));
		dests1.add(new PeerID("2"));
		dests1.add(new PeerID("3"));
		final MessageString msgStr1 = new MessageString(source, dests1, "hello");

		final Set<PeerID> dests2 = new HashSet<PeerID>();
		dests2.add(new PeerID("2"));
		dests2.add(new PeerID("3"));
		final MessageString msgStr2 = new MessageString(source, dests2, "hello");

		final List<BroadcastMessage> messages = new ArrayList<BroadcastMessage>();
		messages.add(msgStr1);
		messages.add(msgStr2);

		final BundleMessage message = new BundleMessage(source, messages);
		final ByteArrayOutputStream bos = new ByteArrayOutputStream();
		final ObjectOutputStream out = new ObjectOutputStream(bos);
		message.write(out);
		out.close();

		final ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
		final ObjectInputStream in = new ObjectInputStream(bis);
		final BroadcastMessage result = MessageTypes.readBroadcastMessage(in);
		in.close();
		assertEquals(message, result);

		assertTrue(message.getExpectedDestinations().containsAll(result.getExpectedDestinations()));
		assertTrue(result.getExpectedDestinations().containsAll(message.getExpectedDestinations()));
	}
}


text:
//
//  JhtChannelBarAndSlideViewConnect.h
//  JhtNewsChannelDemo
//
//  GitHub主页: https://github.com/jinht
//  CSDN博客: http://blog.csdn.net/anticipate91
//
//  Created by Jht on 16/8/18.
//  Copyright © 2016年 JhtNewsChannelDemo. All rights reserved.
//

#import "JhtTotalSlideView.h"
@class JhtNewsChannelItemEditParamModel;
@class JhtChannelBarAndSlideViewConnectParamModel;

/** 所在类是否含有NavigationBar || TabBar_枚举 */
typedef NS_ENUM(NSUInteger, Jht_IsExist_NT) {
    // 只有NavigationBar(Default)
    NT_OnlyHave_N,
    // 只有TabBar
    NT_OnlyHave_T,
    // NavigationBar && TabBar都有
    NT_Have,
    // NavigationBar && TabBar都不有
    NT_None
};

/** 频道栏和下边滚动View的结合体 */
@interface JhtChannelBarAndSlideViewConnect : JhtTotalSlideView

#pragma mark - property
/** 缓存总数 */
@property (nonatomic, assign) NSInteger cacheCount;
/** 频道数组 */
@property (nonatomic, strong) NSMutableArray *channelArray;
/** 上级传过来,装有ChannelModel 待添加的数组 */
@property (nonatomic, strong) NSMutableArray *toAddItemArray;

/** 是否添加频道栏尾部的加号Btn */
@property (nonatomic, assign) BOOL isAddTailBtn;
/** 频道栏尾部的Btn */
@property (nonatomic, strong) UIButton *channelBarTailBtn;

/** 排序界面View */
@property (nonatomic, strong) UIView *sortView;
/** 不能移动的名字数组 */
@property (nonatomic, strong) NSMutableArray *notMoveNameArray;
/** 是否存在删除btn  yes是存在删除 */
@property (nonatomic, assign) BOOL isExistDelete;

/** 轨道栏前边的阴影 */
@property (nonatomic, strong) UIImageView *frontImageView;
/** 轨道栏后边的阴影 */
@property (nonatomic, strong) UIImageView *behindImageView;
/** 频道栏之间横向间距 */
@property (nonatomic, assign) CGFloat itemSpace;
/** 底部的线 */
@property (nonatomic, strong) UIView *lowLineView;
/** 用于排序界面参数model */
@property (nonatomic, strong) JhtNewsChannelItemEditParamModel *itemEditModel;

/** 整体距离顶部的高度
 *  注: 只适用于NT_OnlyHave_T || NT_None 两种形式(即不存在navigationBar),default = [[UIApplication sharedApplication] statusBarFrame].size.height
 */
@property (nonatomic, assign) CGFloat connectToTopSpace;

#pragma mark - Public Method
/** 创建ChannelBarAndSliderView和排序删除界面
 *  barAndSlideModel: 用于设置sliderView和bar参数model(含有部分属性默认值)
 *  itemEditModel: 用于排序界面的参数设置(含有部分属性默认值)
 *  isExistType: 是否含有NavigationBar || TabBar
 *  channelArray: 已经添加的频道数组 存储JhtNewsChannelItemModel (必要参数,并且是存储JhtNewsChannelItemModel的数组)
 *  baseViewController: 所处于的VC
 *  delegate: 委托
 */
- (id)initSlideViewAndItemEditViewWithBarAndSlideModel:(JhtChannelBarAndSlideViewConnectParamModel *)barAndSlideModel withNewsChannelItemEditModel:(JhtNewsChannelItemEditParamModel *)itemEditModel isExistNavOrTab:(Jht_IsExist_NT)isExistType withChanelArray:(NSMutableArray *)channelArray baseViewController:(id)baseViewController delegte:(id<JhtTotalSlideViewDelegate>)delegate;

/** 根据名字数组,查找新的频道栏model */
- (NSMutableArray *)checkNewChannelItemModelWithNameArray:(NSArray *)nameArray;

/** 判断频道栏尾部按钮是否可以被点击
 *  enable: YES--可以被点击
 */
- (void)judgeChannelBarTailBtnIsEnableClick:(BOOL)enable;

/** 隐藏或者出现小红点
 *  hidden: YES--隐藏
 *  index: topBar 中频道栏的index
 */
- (void)redPonitIsHidden:(BOOL)hidden index:(NSInteger)index;

/** 是否展示"排序拖拽"按钮
 * 	hidden: YES--隐藏
 */
- (void)isHiddenTopEditItemBtn:(BOOL)hidden;

@end


text:
'use strict';
/* global suite, test */

//
// Note: This example test is leveraging the Mocha test framework.
// Please refer to their documentation on https://mochajs.org/ for help.
//

// The module 'assert' provides assertion methods from node
var assert = require('assert');

// You can import and use all API from the 'vscode' module
// as well as import your extension to test it
var vscode = require('vscode');
var myExtension = require('../extension');

// Defines a Mocha test suite to group tests of similar kind together
suite("Extension Tests", function() {

    test("Update Template with Date", () => {
       let template = "/images/${year}/${month}";

       let controlTemplate = template;

        let today = new Date();
        let year = today.getFullYear();
        let month = ('0' + (today.getMonth() + 1)).slice(-2);

        controlTemplate = controlTemplate.replace("${year}", year);
        controlTemplate = controlTemplate.replace("${month}", month);

       let updatedTemplate = myExtension.updateTemplateWithDate(template);

       assert.equal(updatedTemplate, controlTemplate, "Updated Template not correct. Expected: " + controlTemplate + " but got: " + updatedTemplate);
    });

});


text:
class CreateMatches < ActiveRecord::Migration
  def change
    create_table :matches do |t|
      t.references :user, index: true, foreign_key: true
      t.references :area, index: true, foreign_key: true
      t.integer :score

      t.timestamps null: false
    end
  end
end


text:
extern struct strerr maildir_chdir_err;
extern struct strerr maildir_scan_err;

extern int maildir_chdir();
extern void maildir_clean();
extern int maildir_scan();

#endif


text:
<?php

namespace Propel\Runtime\Collection;

use ArrayIterator;

/**
 * Iterator class for iterating over Collection data
 *
 * @extends \ArrayIterator<(int|string), mixed>
 */
class CollectionIterator extends ArrayIterator implements IteratorInterface
{
    /**
     * @var \Propel\Runtime\Collection\Collection
     */
    protected Collection $collection;

    /**
     * @var array
     */
    protected array $positions = [];

    /**
     * Constructor
     *
     * @param \Propel\Runtime\Collection\Collection $collection
     */
    public function __construct(Collection $collection)
    {
        parent::__construct($collection->getData());

        $this->collection = $collection;
        $this->refreshPositions();
    }

    /**
     * Returns the collection instance
     *
     * @return \Propel\Runtime\Collection\Collection
     */
    public function getCollection(): Collection
    {
        return $this->collection;
    }

    /**
     * Check if the collection is empty
     *
     * @return bool
     */
    public function isEmpty(): bool
    {
        return $this->count() === 0;
    }

    /**
     * Gets the position of the internal pointer
     * This position can be later used in seek()
     *
     * @return int
     */
    public function getPosition(): int
    {
        if (!$this->key()) {
            return 0;
        }

        return $this->positions[$this->key()];
    }

    /**
     * Move the internal pointer to the beginning of the list
     * And get the first element in the collection
     *
     * @psalm-suppress ReservedWord
     *
     * @return mixed
     */
    #[\ReturnTypeWillChange]
    public function getFirst()
    {
        if ($this->isEmpty()) {
            return null;
        }
        $this->rewind();

        return $this->current();
    }

    /**
     * Check whether the internal pointer is at the beginning of the list
     *
     * @return bool
     */
    public function isFirst(): bool
    {
        return $this->getPosition() === 0;
    }

    /**
     * Move the internal pointer backward
     * And get the previous element in the collection
     *
     * @psalm-suppress ReservedWord
     *
     * @return mixed
     */
    #[\ReturnTypeWillChange]
    public function getPrevious()
    {
        if ($this->isFirst()) {
            return null;
        }

        $this->seek($this->getPosition() - 1);

        return $this->current();
    }

    /**
     * Get the current element in the collection
     *
     * @psalm-suppress ReservedWord
     *
     * @return mixed
     */
    #[\ReturnTypeWillChange]
    public function getCurrent()
    {
        return $this->current();
    }

    /**
     * Move the internal pointer forward
     * And get the next element in the collection
     *
     * @psalm-suppress ReservedWord
     *
     * @return mixed
     */
    #[\ReturnTypeWillChange]
    public function getNext()
    {
        $this->next();

        return $this->current();
    }

    /**
     * Move the internal pointer to the end of the list
     * And get the last element in the collection
     *
     * @psalm-suppress ReservedWord
     *
     * @return mixed
     */
    #[\ReturnTypeWillChange]
    public function getLast()
    {
        if ($this->isEmpty()) {
            return null;
        }

        $this->seek(count($this->positions) - 1);

        return $this->current();
    }

    /**
     * Check whether the internal pointer is at the end of the list
     *
     * @return bool
     */
    public function isLast(): bool
    {
        if ($this->isEmpty()) {
            // empty list... so yes, this is the last
            return true;
        }

        return $this->getPosition() === count($this->positions) - 1;
    }

    /**
     * Check if the current index is an odd integer
     *
     * @return bool
     */
    public function isOdd(): bool
    {
        return (bool)($this->getPosition() % 2);
    }

    /**
     * Check if the current index is an even integer
     *
     * @return bool
     */
    public function isEven(): bool
    {
        return !$this->isOdd();
    }

    /**
     * @param string $index
     * @param string $value
     *
     * @return void
     */
    public function offsetSet($index, $value): void
    {
        $this->collection->offsetSet($index, $value);
        parent::offsetSet($index, $value);
        $this->refreshPositions();
    }

    /**
     * @param string $index
     *
     * @return void
     */
    public function offsetUnset($index): void
    {
        $this->collection->offsetUnset($index);
        parent::offsetUnset($index);
        $this->refreshPositions();
    }

    /**
     * @param mixed $value
     *
     * @return void
     */
    public function append($value): void
    {
        $this->collection->append($value);
        parent::append($value);
        $this->refreshPositions();
    }

    /**
     * @param int $flags Not used
     *
     * @return bool
     */
    public function asort($flags = SORT_REGULAR): bool
    {
        parent::asort();
        $this->refreshPositions();

        return true;
    }

    /**
     * @param int $flags Not used
     *
     * @return bool
     */
    public function ksort($flags = SORT_REGULAR): bool
    {
        parent::ksort();
        $this->refreshPositions();

        return true;
    }

    /**
     * @param string $callback
     *
     * @return bool
     */
    public function uasort($callback): bool
    {
        parent::uasort($callback);
        $this->refreshPositions();

        return true;
    }

    /**
     * @param string $callback
     *
     * @return bool
     */
    public function uksort($callback): bool
    {
        parent::uksort($callback);
        $this->refreshPositions();

        return true;
    }

    /**
     * @return bool
     */
    public function natsort(): bool
    {
        parent::natsort();
        $this->refreshPositions();

        return true;
    }

    /**
     * @return bool
     */
    public function natcasesort(): bool
    {
        parent::natcasesort();
        $this->refreshPositions();

        return true;
    }

    /**
     * @return void
     */
    private function refreshPositions(): void
    {
        $this->positions = array_flip(array_keys($this->getArrayCopy()));
    }
}


text:
#include <Rcpp.h>
using namespace Rcpp;

// This is a simple example of exporting a C++ function to R. You can
// source this function into an R session using the Rcpp::sourceCpp
// function (or via the Source button on the editor toolbar). Learn
// more about Rcpp at:
//
//   http://www.rcpp.org/
//   http://adv-r.had.co.nz/Rcpp.html
//   http://gallery.rcpp.org/
//

// [[Rcpp::export]]
NumericVector timesTwo(NumericVector x) {
  return x * 2;
}

// You can include R code blocks in C++ files processed with sourceCpp
// (useful for testing and development). The R code will be automatically
// run after the compilation.
//

/*** R
timesTwo(42)
*/


text:
function [u,v] = xyz2uv(xyz,format)
% Convert CIE XYZ to uv chromaticity coordinates
%
%   [uprime,vprime] = xyz2uv(xyz,[format])
%
% Convert XYZ to uprime,vprime chromaticity coordinates (uniform
% chromaticity space).
%
% XYZ contains the values in the rows.
% format:  If you want the (u,v), not (uprime,vprime) values, format='uv'
%
% N.B. There are two very closely related (u,v) formats.  These are (u,v)
% and (u',v').  The relationship between them is
%
%    uprime = u and vprime = 1.5*v
%
% The u',v' was an improvement made in the 1960s or so, and this routine
% (by default) returns those values.  The reason is because this is mainly
% what people want. This function returns the (u'v') value because, well,
% it is more modern and it is used in the LUV format.
%
% References See (e.g.) Wyszecki and Stiles, 2cd, page 165.
%
%   X+Y+Z=0 is returned as u=v=0.
%
% See: http://en.wikipedia.org/wiki/CIELUV
%
% Example:
%  wave = 400:10:700;
%  d65 = vcReadSpectra('D65',wave);
%  XYZ = ieXYZFromEnergy(d65',wave);
%  [uP,vP] = xyz2uv(XYZ)
%  u = uP, v = vP/1.5
%
%  [u,v] = xyz2uv(XYZ,'uv')
%
% See also: cct, spd2cct, xyz2srgb, xyz2<TAB>
%
% Copyright ImagEval Consultants, LLC, 2003.

if ieNotDefined('xyz'), error('XYZ values required'); end
if ieNotDefined('format'), format = ''; end

if size(xyz,2) ~= 3, error('XYZ should be n x 3'); end

% Now compute uprime and vprime.  These are the pre-cursors to ustar and
% vstar.  The columns of xyz are X,Y and Z respectively.
B = (xyz(:,1) + 15*xyz(:,2) + 3*xyz(:,3));

u = zeros(size(xyz,1),1);
v = zeros(size(u));

% Whenever B is valid, we set the u,v values to something legitimate. I am
% not sure what they should be when X+Y+Z is zero, as above.  For now, we
% are leaving them as zero.
nz = (B>0);
u(nz) = 4*xyz(nz,1) ./ B(nz);
v(nz) = 9*xyz(nz,2) ./ B(nz);

% Check if the old 1960s (u,v), not (u',v') is being requested.
if isequal(format,'uv'), v = v/1.5; end
end


text:
<?php

/**
 * Config installer
 * @category   Mage
 * @package    Mage_Install
 */
class Mage_Install_Model_Installer_Config extends Mage_Install_Model_Installer_Abstract
{
    const TMP_INSTALL_DATE_VALUE= 'd-d-d-d-d';
    const TMP_ENCRYPT_KEY_VALUE = 'k-k-k-k-k';

    /**
     * Path to local configuration file
     *
     * @var string
     */
    protected $_localConfigFile;

    protected $_configData = array();

    public function __construct()
    {
        $this->_localConfigFile = Mage::getBaseDir('etc') . DS . 'local.xml';
    }

    public function setConfigData($data)
    {
        if (is_array($data)) {
            $this->_configData = $data;
        }
        return $this;
    }

    public function getConfigData()
    {
        return $this->_configData;
    }

    public function install()
    {
        $data = $this->getConfigData();
        foreach (Mage::getModel('core/config')->getDistroServerVars() as $index=>$value) {
            if (!isset($data[$index])) {
                $data[$index] = $value;
            }
        }

        if (isset($data['unsecure_base_url'])) {
            $data['unsecure_base_url'] .= substr($data['unsecure_base_url'], -1) != '/' ? '/' : '';
            if (strpos($data['unsecure_base_url'], 'http') !== 0) {
                $data['unsecure_base_url'] = 'http://' . $data['unsecure_base_url'];
            }
            if (!$this->_getInstaller()->getDataModel()->getSkipBaseUrlValidation()) {
                $this->_checkUrl($data['unsecure_base_url']);
            }
        }
        if (isset($data['secure_base_url'])) {
            $data['secure_base_url'] .= substr($data['secure_base_url'], -1) != '/' ? '/' : '';
            if (strpos($data['secure_base_url'], 'http') !== 0) {
                $data['secure_base_url'] = 'https://' . $data['secure_base_url'];
            }

            if (!empty($data['use_secure'])
                && !$this->_getInstaller()->getDataModel()->getSkipUrlValidation()) {
                $this->_checkUrl($data['secure_base_url']);
            }
        }

        $data['date']   = self::TMP_INSTALL_DATE_VALUE;
        $data['key']    = self::TMP_ENCRYPT_KEY_VALUE;
        $data['var_dir'] = $data['root_dir'] . '/var';

        $data['use_script_name'] = isset($data['use_script_name']) ? 'true' : 'false';

        $this->_getInstaller()->getDataModel()->setConfigData($data);

        $template = file_get_contents(Mage::getBaseDir('etc') . DS . 'local.xml.template');
        foreach ($data as $index => $value) {
            $template = str_replace('{{' . $index . '}}', '<![CDATA[' . $value . ']]>', $template);
        }
        file_put_contents($this->_localConfigFile, $template);
        chmod($this->_localConfigFile, 0777);
    }

    public function getFormData()
    {
        $uri = Zend_Uri::factory(Mage::getBaseUrl('web'));

        $baseUrl = $uri->getUri();
        if ($uri->getScheme() !== 'https') {
            $uri->setPort(null);
            $baseSecureUrl = str_replace('http://', 'https://', $uri->getUri());
        } else {
            $baseSecureUrl = $uri->getUri();
        }

        $connectDefault = Mage::getConfig()
                ->getResourceConnectionConfig(Mage_Core_Model_Resource::DEFAULT_SETUP_RESOURCE);

        $data = Mage::getModel('varien/object')
            ->setDbHost($connectDefault->host)
            ->setDbName($connectDefault->dbname)
            ->setDbUser($connectDefault->username)
            ->setDbModel($connectDefault->model)
            ->setDbPass('')
            ->setSecureBaseUrl($baseSecureUrl)
            ->setUnsecureBaseUrl($baseUrl)
            ->setAdminFrontname('admin')
            ->setEnableCharts('1')
        ;
        return $data;
    }

    protected function _checkHostsInfo($data)
    {
        $url  = $data['protocol'] . '://' . $data['host'] . ':' . $data['port'] . $data['base_path'];
        $surl = $data['secure_protocol'] . '://' . $data['secure_host'] . ':' . $data['secure_port']
            . $data['secure_base_path'];

        $this->_checkUrl($url);
        $this->_checkUrl($surl, true);

        return $this;
    }

    protected function _checkUrl($url, $secure = false)
    {
        $prefix = $secure ? 'install/wizard/checkSecureHost/' : 'install/wizard/checkHost/';
        try {
            $client = new Varien_Http_Client($url . 'index.php/' . $prefix);
            $response = $client->request('GET');
            /* @var $responce Zend_Http_Response */
            $body = $response->getBody();
        }
        catch (Exception $e){
            $this->_getInstaller()->getDataModel()
                ->addError(Mage::helper('install')->__('The URL "%s" is not accessible.', $url));
            throw $e;
        }

        if ($body != Mage_Install_Model_Installer::INSTALLER_HOST_RESPONSE) {
            $this->_getInstaller()->getDataModel()
                ->addError(Mage::helper('install')->__('The URL "%s" is invalid.', $url));
            Mage::throwException(Mage::helper('install')->__('Response from server isn\'t valid.'));
        }
        return $this;
    }

    public function replaceTmpInstallDate($date = null)
    {
        $stamp    = strtotime((string) $date);
        $localXml = file_get_contents($this->_localConfigFile);
        $localXml = str_replace(self::TMP_INSTALL_DATE_VALUE, date('r', $stamp ? $stamp : time()), $localXml);
        file_put_contents($this->_localConfigFile, $localXml);

        return $this;
    }

    public function replaceTmpEncryptKey($key = null)
    {
        if (!$key) {
            $key = md5(Mage::helper('core')->getRandomString(10));
        }
        $localXml = file_get_contents($this->_localConfigFile);
        $localXml = str_replace(self::TMP_ENCRYPT_KEY_VALUE, $key, $localXml);
        file_put_contents($this->_localConfigFile, $localXml);

        return $this;
    }
}


text:
// Generated by CoffeeScript 1.9.3

/*

Returns a copy of array with dulicates removed
 */
module.exports = function(array) {
  var i, item, key, len, obj, value;
  obj = {};
  for (i = 0, len = array.length; i < len; i++) {
    item = array[i];
    obj[item] = item;
  }
  return (function() {
    var results;
    results = [];
    for (key in obj) {
      value = obj[key];
      results.push(value);
    }
    return results;
  })();
};


text:
define([
    'ash'
], function (Ash) {
    var TickProvider = Ash.Class.extend({

        previousTime: 0,
        ticked: new Ash.Signals.Signal(),
        request: null,
        stats: null,
        exceptionCallback: null,
		active: false,

        constructor: function (stats, exceptionCallback) {
            this.stats = stats;
            this.exceptionCallback = exceptionCallback;
        },

        start: function () {
			this.active = true;
            this.request = requestAnimationFrame(this.tick.bind(this));
        },

        stop: function () {
            cancelAnimationFrame(this.request);
            this.request = null;
			this.active = false;
        },

        add: function (listener, context) {
            this.ticked.add(listener, context);
        },

        remove: function (listener, context) {
            this.ticked.remove(listener, context);
        },

        tick: function (timestamp) {
            if (this.stats) {
                this.stats.begin();
            }

            timestamp = timestamp || Date.now();
            var tmp = this.previousTime || timestamp;
            this.previousTime = timestamp;
            var delta = (timestamp - tmp) * 0.001;

            try {
                this.ticked.dispatch(delta);
            } catch (ex) {
                if (this.exceptionCallback) {
                    this.exceptionCallback(ex);
                } else {
                    throw ex;
                }
            }

			if (this.active) {
				this.request = requestAnimationFrame(this.tick.bind(this));
			}

            if (this.stats) {
                this.stats.end();
            }
        }
    });

    return TickProvider;
});


text:
package kr.djsch.dsmhs.beinone.materialcalendar;

import android.content.Context;
import android.content.res.TypedArray;
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;

import java.util.Calendar;

/**
 * Created by BeINone on 2017-04-09.
 */

public class WeekTitleView extends LinearLayout {

    private View mView;

    private TextView mSundayTV;
    private TextView mMondayTV;
    private TextView mTuesdayTV;
    private TextView mWednesdayTV;
    private TextView mThursdayTV;
    private TextView mFridayTV;
    private TextView mSaturdayTV;

    private int mTextColor;
    private int mBackgroundColor;

    public WeekTitleView(Context context) {
        super(context);
        init();
    }

    public WeekTitleView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);

        TypedArray a = context.getTheme().obtainStyledAttributes(attrs, R.styleable.MonthNavigator, 0, 0);
        try {
            int defaultTextColor = ContextCompat.getColor(context, R.color.textColorDisabledLight);
            int defaultBackgroundColor = ContextCompat.getColor(context, R.color.colorPrimaryLight);
            mTextColor = a.getColor(R.styleable.MonthNavigator_textColor, defaultTextColor);
            mBackgroundColor = a.getColor(R.styleable.MonthNavigator_backgroundColor, defaultBackgroundColor);
        } finally {
            a.recycle();
        }

        init();
    }

    public void init() {
        mView = LayoutInflater.from(getContext()).inflate(R.layout.view_weektitle, this, true);

        mSundayTV = (TextView) mView.findViewById(R.id.tv_weektitle_sunday);
        mMondayTV = (TextView) mView.findViewById(R.id.tv_weektitle_monday);
        mTuesdayTV = (TextView) mView.findViewById(R.id.tv_weektitle_tuesday);
        mWednesdayTV = (TextView) mView.findViewById(R.id.tv_weektitle_wednesday);
        mThursdayTV = (TextView) mView.findViewById(R.id.tv_weektitle_thursday);
        mFridayTV = (TextView) mView.findViewById(R.id.tv_weektitle_friday);
        mSaturdayTV = (TextView) mView.findViewById(R.id.tv_weektitle_saturday);

        setBackgroundColor(mBackgroundColor);
    }

    public void setBackgroundColor(int color) {
        mBackgroundColor = color;
        super.setBackgroundColor(color);
    }

    public void setTextColor(int color) {
        mTextColor = color;
        mSundayTV.setTextColor(color);
        mMondayTV.setTextColor(color);
        mTuesdayTV.setTextColor(color);
        mWednesdayTV.setTextColor(color);
        mThursdayTV.setTextColor(color);
        mFridayTV.setTextColor(color);
        mSaturdayTV.setTextColor(color);
    }
}


text:
//----------------------------------*-C++-*-----------------------------------//

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

#include "callow_config.hh"

#ifdef CALLOW_ENABLE_PETSC

#include "PetscSolver.hh"

namespace callow
{

//----------------------------------------------------------------------------//
PetscSolver::PetscSolver(const double  atol,
                         const double  rtol,
                         const int     maxit)
  : LinearSolver(atol, rtol, maxit, "petsc")
{

  // create the petsc object
  PetscErrorCode ierr = KSPCreate(PETSC_COMM_SELF, &d_petsc_solver);
  Insist(!ierr, "Error creating KSP object.");

  // set the convergence criteria (third param is divergence tolerace; skip)
  ierr = KSPSetTolerances(d_petsc_solver, rtol, atol, PETSC_DEFAULT, maxit);
  Insist(!ierr, "Error setting KSP tolerances.");

  // Allow for command line flags.
  ierr = KSPSetFromOptions(d_petsc_solver);
  Insist(!ierr, "Error setting KSP from options.");

  /// set the monitor so we can extract residuals on-the-fly
  ierr = KSPMonitorSet(d_petsc_solver, petsc_ksp_monitor, this, PETSC_NULL);
  Insist(!ierr, "Error setting KSP monitor.");

  ierr = KSPSetInitialGuessNonzero(d_petsc_solver, PETSC_TRUE);
  Insist(!ierr, "Error setting KSP nonzeros initial guess.");
}

//----------------------------------------------------------------------------//
PetscSolver::~PetscSolver()
{
  KSPDestroy(&d_petsc_solver);
}

//----------------------------------------------------------------------------//
void PetscSolver::set_operators(SP_matrix A, SP_db db)
{
  // Preconditions
  Require(A);
  d_A = A;
  Ensure(d_A->number_rows() == d_A->number_columns());

  // Set the db, if present.  Otherwise, d_db is unchanged, which
  // lets us set new operators but maintain old parameters.
  if (db) d_db = db;

  // Default PC settings.
  std::string pc_type = "";
  std::string petsc_pc_type = "ilu";
  int pc_side = RIGHT;

  // Extract the PETSc preconditioner.
  PC pc;
  PetscErrorCode ierr;
  ierr = KSPGetPC(d_petsc_solver, &pc);

  // Check database options
  if (d_db)
  {
    // Get the type
    if (d_db->check("pc_type")) pc_type = d_db->get<std::string>("pc_type");

    // Check for a callow pc type
    if (pc_type != "petsc_pc")
    {
      if (pc_type == "ilu0")
        d_P = new PCILU0(d_A);
      else if (pc_type == "jacobi")
        d_P = new PCJacobi(d_A);
      // Set callow pc as a shell and set the shell operator
      if (d_P)
      {
        ierr = PCSetType(pc, PCSHELL);
        d_P->set_petsc_pc(pc);
      }
    }
    // Check for a PETSc pc type
    else
    {
      if (d_db->check("petsc_pc_type"))
        petsc_pc_type = d_db->get<std::string>("petsc_pc_type");

      // ILU(k)
      if (petsc_pc_type == "ilu")
      {
        PCSetType(pc, PCILU);
        // Set levels
        int levels = 2;
        if (d_db->check("petsc_pc_factor_levels"))
          levels = d_db->get<int>("petsc_pc_factor_levels");
        PCFactorSetLevels(pc, levels);
        // Fill zeros on the diagonal, even if they wouldn't be
        PCFactorSetAllowDiagonalFill(pc);
      }
      // LU
      else if (petsc_pc_type == "lu")
      {
        PCSetType(pc, PCLU);
        PCFactorSetReuseOrdering(pc, PETSC_TRUE);
        PCFactorSetReuseFill(pc, PETSC_TRUE);
//        PCFactorSetMatOrderingType(pc, MATORDERINGND);
//        PCFactorSetMatSolverPackage(pc, MATSOLVERSUPERLU);
      }
      // Add more options, like hypre etc.
      else
      {
        //PCSetType(pc, petsc_pc_type.c_str());
        PCSetFromOptions(pc);
        //THROW("Unsupported PETSc preconditioner: " + petsc_pc_type);
      }
    }
    if (d_db->check("pc_side")) pc_side = d_db->get<int>("pc_side");
  }
  // If not database, we do not set the preconditioner, letting
  // PETSc do its default.
  else
  {
    //std::cout << " WHY NO PETSC HAS PC? " << std::endl;
    PCSetType(pc, PCNONE);
  }

  // Set the operator.  Note, this structure really eliminates
  // the option of using a second matrix for preconditioning.
  // That's fine, though, since any non-A pc's will be shell
  // operations, which are independent of this choice.
  ierr = KSPSetOperators(d_petsc_solver,
                         d_A->petsc_matrix(),
                         d_A->petsc_matrix(),
                         SAME_NONZERO_PATTERN);

  KSPGMRESSetRestart(d_petsc_solver, 30);
  // Set the preconditioner side.
  if (pc_side == Base::LEFT) ierr = KSPSetPCSide(d_petsc_solver, PC_LEFT);
  else
    ierr = KSPSetPCSide(d_petsc_solver, PC_RIGHT);

  // Postconditions
  Ensure(!ierr);
}

//----------------------------------------------------------------------------//
void PetscSolver::set_preconditioner(SP_preconditioner P,
                                     const int         side)
{
  Require(P);
  Require(side == LEFT || side == RIGHT);

  // Keep the pc and its side
  d_P = P;
  d_pc_side = side;

  // Extract the PETSc preconditioner and set P as a shell
  PC pc;
  PetscErrorCode ierr;
  ierr = KSPGetPC(d_petsc_solver, &pc);
  ierr = PCSetType(pc, PCSHELL);
  d_P->set_petsc_pc(pc);

  // Set the preconditioner side.
  if (side == Base::LEFT)
    ierr = KSPSetPCSide(d_petsc_solver, PC_LEFT);
  else
    ierr = KSPSetPCSide(d_petsc_solver, PC_RIGHT);

  Ensure(!ierr);
}

} // end namespace callow

#endif

//----------------------------------------------------------------------------//
//              end of file PetscSolver.cc
//----------------------------------------------------------------------------//


text:
var jp_config = {
  easyPieChart:   [   baseUrl+'/jquery/jquery.easy-pie-chart/dist/jquery.easypiechart.fill.js'],
  sparkline:      [   baseUrl+'/jquery/jquery.sparkline/dist/jquery.sparkline.retina.js'],
  plot:           [   baseUrl+'/jquery/flot/jquery.flot.js',
                      baseUrl+'/jquery/flot/jquery.flot.pie.js',
                      baseUrl+'/jquery/flot/jquery.flot.resize.js',
                      baseUrl+'/jquery/flot.tooltip/js/jquery.flot.tooltip.min.js',
                      baseUrl+'/jquery/flot.orderbars/js/jquery.flot.orderBars.js',
                      baseUrl+'/jquery/flot-spline/js/jquery.flot.spline.min.js'],
  moment:         [   baseUrl+'/jquery/moment/moment.js'],
  screenfull:     [   baseUrl+'/jquery/screenfull/dist/screenfull.min.js'],
  slimScroll:     [   baseUrl+'/jquery/slimscroll/jquery.slimscroll.min.js'],
  sortable:       [   baseUrl+'/jquery/html5sortable/jquery.sortable.js'],
  nestable:       [   baseUrl+'/jquery/nestable/jquery.nestable.js',
                      baseUrl+'/jquery/nestable/jquery.nestable.css'],
  filestyle:      [   baseUrl+'/jquery/bootstrap-filestyle/src/bootstrap-filestyle.js'],
  slider:         [   baseUrl+'/jquery/bootstrap-slider/bootstrap-slider.js',
                      baseUrl+'/jquery/bootstrap-slider/bootstrap-slider.css'],
  chosen:         [   baseUrl+'/jquery/chosen/chosen.jquery.min.js',
                      baseUrl+'/jquery/chosen/bootstrap-chosen.css'],
  TouchSpin:      [   baseUrl+'/jquery/bootstrap-touchspin/dist/jquery.bootstrap-touchspin.min.js',
                      baseUrl+'/jquery/bootstrap-touchspin/dist/jquery.bootstrap-touchspin.min.css'],
  wysiwyg:        [   baseUrl+'/jquery/bootstrap-wysiwyg/bootstrap-wysiwyg.js',
                      baseUrl+'/jquery/bootstrap-wysiwyg/external/jquery.hotkeys.js'],
  dataTable:      [   baseUrl+'/jquery/datatables/media/js/jquery.dataTables.min.js',
                      baseUrl+'/jquery/plugins/integration/bootstrap/3/dataTables.bootstrap.js',
                      baseUrl+'/jquery/plugins/integration/bootstrap/3/dataTables.bootstrap.css'],
  vectorMap:      [   baseUrl+'/jquery/bower-jvectormap/jquery-jvectormap-1.2.2.min.js',
                      baseUrl+'/jquery/bower-jvectormap/jquery-jvectormap-world-mill-en.js',
                      baseUrl+'/jquery/bower-jvectormap/jquery-jvectormap-us-aea-en.js',
                      baseUrl+'/jquery/bower-jvectormap/jquery-jvectormap.css'],
  footable:       [   baseUrl+'/jquery/footable/dist/footable.all.min.js',
                      baseUrl+'/jquery/footable/css/footable.core.css'],
  fullcalendar:   [   baseUrl+'/jquery/moment/moment.js',
                      baseUrl+'/jquery/fullcalendar/dist/fullcalendar.min.js',
                      baseUrl+'/jquery/fullcalendar/dist/fullcalendar.css',
                      baseUrl+'/jquery/fullcalendar/dist/fullcalendar.theme.css'],
  daterangepicker:[   baseUrl+'/jquery/moment/moment.js',
                      baseUrl+'/jquery/bootstrap-daterangepicker/daterangepicker.js',
                      baseUrl+'/jquery/bootstrap-daterangepicker/daterangepicker-bs3.css'],
  tagsinput:      [   baseUrl+'/jquery/bootstrap-tagsinput/dist/bootstrap-tagsinput.js',
                      baseUrl+'/jquery/bootstrap-tagsinput/dist/bootstrap-tagsinput.css']

};


text:
use Carp;
use Time::HiRes qw(time sleep);
use Getopt::Long;

$options{defaultdb} = 'sacred_experiments';
$options{RR_CONTAINER} = 'hmlatapie/reproducible_research';
$options{RR_CONTAINER} = $ENV{RR_CONTAINER}
	if $ENV{RR_CONTAINER};

$usage = <<EOS;
$0 cmd options
	valid commands:
		start name [docker_repo]
			docker_repo
				defaults to $options{RR_CONTAINER}
			--pull
				will pull latest
			--nvidia
				run via nvidia-docker
			--nomongo
				don't create mongodb
		test name
	options:
		--defaultdb=
			defaults to $options{defaultdb}
EOS

GetOptions(
	'stringparam=s' => \$options{stringparam},
	'RR_CONTAINER=s' => \$options{RR_CONTAINER},
	'booleanparam' => \$options{booleanparam},
	'pull' => \$options{pull},
	'nvidia' => \$options{nvidia},
	'nomongo' => \$options{nomongo},
	);

confess $usage
	if !@ARGV;

$command = shift;

if($command eq 'start')
{
	$name = shift;
	$docker_repo = shift;
	confess $usage
		if !$name;

	$options{RR_CONTAINER} = $docker_repo
		if $docker_repo;

	$options{nvidia} = 1
		if $options{RR_CONTAINER} =~ /(hmlatapie\/rr_caffe)/;

	$mongodb = "$name\_mongo";

	`mkdir -p rr`;

	$cmd =<<EOS;
docker pull $options{RR_CONTAINER}
EOS

	execute($cmd)
		if $options{pull};

	execute('docker pull hmlatapie/mongodb')
		if $options{pull};

	execute('docker pull $options{RR_CONTAINER}')
		if $options{pull};

	execute("docker run -d --name $mongodb -e AUTH=no hmlatapie/mongodb")
		if !$options{nomongo};

	$dockercmd = 'docker';
	$dockercmd = 'nvidia-docker'
		if $options{nvidia};

	$cmd =<<EOS;
$dockercmd run -d --name $name --link $mongodb:mongodb --volume=\$(pwd)/rr:/root/rr $options{RR_CONTAINER} /bin/bash -c "while true; do date; sleep 3600; done"
EOS

	execute($cmd);
}
elsif($command eq 'test')
{
	$name = shift;
	confess $usage
		if !$name;

	$mongodb = "$name\_mongo";

	execute("docker exec -it $name /bin/bash -c \"./sacred/examples/01_hello_world.py -m mongodb:27017:$options{defaultdb}\"");
	execute("docker exec -it $mongodb /bin/bash -c \"mongo $options{defaultdb} --eval 'printjson(db.getCollectionNames())'\"");

	$js_cmd =<<EOS;
cursor = db.default.runs.find();
while ( cursor.hasNext() ) {
	printjson( cursor.next() );
}
EOS
	execute("docker exec -it $mongodb /bin/bash -c \"mongo $options{defaultdb} --eval '$js_cmd'\"");
}
else
{
	confess $usage;
}

sub execute
{
	my ($cmd) = @_;

	print "executing command: $cmd\n";
	open my $f, "$cmd |";
	print
		while <$f>;
}


text:
using UnityEngine;
using System.Collections;

public class MouseController : MonoBehaviour {
	StreetViewPoint StreetView_Pointed = null;
	// Use this for initialization
	void Start () {

	}

	// Update is called once per frame
	void Update () {
		RaycastHit hit = new RaycastHit();

		Ray r= Camera.main.ScreenPointToRay(Input.mousePosition);

		Debug.DrawRay(r.origin, r.direction * 1000, Color.red);

		if (Physics.Raycast(r, out hit, Mathf.Infinity))
		{
			if(hit.collider != null)
			{
				if(hit.collider.gameObject.tag == "StreetviewPoint")
				{
					StreetView_Pointed = hit.collider.gameObject.GetComponent<StreetViewPoint>();
					Debug.Log (StreetView_Pointed.name);
					if(StreetView_Pointed != null)
					{
						// TODO : Mouse Enter (SHJO)
						//StreetView_Pointed.gameObject.renderer.material.color=Color.blue;
						StreetView_Pointed.Pointed() ;

					}

				}
				else
				{
                    if(StreetView_Pointed != null)
					    //StreetView_Pointed.gameObject.renderer.material.color=Color.red;
						StreetView_Pointed.PointedOut() ;
					StreetView_Pointed = null;
				}
			}
		}
		else
		{
			// TODO : Mouse Exit (SHJO)
			if(StreetView_Pointed != null)
			{
				//StreetView_Pointed.gameObject.renderer.material.color=Color.red;
				StreetView_Pointed.PointedOut() ;
				StreetView_Pointed = null;
			}
		}

		if (Input.GetMouseButtonDown (0)) {

			if(StreetView_Pointed != null)
			{
				Application.LoadLevel("StreetViewer");
			}

		}

	}
}


text:
<!DOCTYPE html>

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

    <title>Anthony Bisulco's Portfolio</title>

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

    <link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Merriweather:400,300,300italic,400italic,700,700italic,900,900italic' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" href="font-awesome/css/font-awesome.min.css" type="text/css">

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

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

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

                </button>
                Anthony Bisulco

                        About

                        Portfolio

                        Resume

Embedded Design

Robotic Arm Frame

Robotic Arm Programming Movement

Block Diagram

Robotic Arm Final Project

The above is my final project for my embedded design course which introduced principles in digital and software design.  The scope of the project involved creating a moving robotic arm with two modes: computer controlled move mode and wii mote controlled mode. The video above demonstrates the computer controlled moving mode which I was able to make the robotic arm throw the box.
	The design for this system was on a Zedboard which is a FPGA with an additional ARM core for any programming tasks. The FPGA digital design, used in both modes, was developed in Simulink HDL coder which performed clock division and PWM generation. On the other side of things, the ARM core performed state flow to move the arm from position to position.

    All images and text © 2016 Anthony Bisulco


text:
using namespace std;

#define MOSAIK_NUM_NUCLEOTIDES 26
#define GAP '-'

class CSmithWatermanGotoh {
public:
    // constructor
    CSmithWatermanGotoh(float matchScore, float mismatchScore, float gapOpenPenalty, float gapExtendPenalty);
    // destructor
    ~CSmithWatermanGotoh(void);
    // aligns the query sequence to the reference using the Smith Waterman Gotoh algorithm
    void Align(unsigned int& referenceAl, string& cigarAl, const string& s1, const string& s2);
    // enables homo-polymer scoring
    void EnableHomoPolymerGapPenalty(float hpGapOpenPenalty);
    // enables non-repeat gap open penalty
    void EnableEntropyGapPenalty(float enGapOpenPenalty);
    // enables repeat gap extension penalty
    void EnableRepeatGapExtensionPenalty(float rGapExtensionPenalty, float rMaxGapRepeatExtensionPenaltyFactor = 10);
    // record the best score for external use
    float BestScore;
private:
    // creates a simple scoring matrix to align the nucleotides and the ambiguity code N
    void CreateScoringMatrix(void);
    // corrects the homopolymer gap order for forward alignments
    void CorrectHomopolymerGapOrder(const unsigned int numBases, const unsigned int numMismatches);
    // returns the maximum floating point number
    static inline float MaxFloats(const float& a, const float& b, const float& c);
    // our simple scoring matrix
    float mScoringMatrix[MOSAIK_NUM_NUCLEOTIDES][MOSAIK_NUM_NUCLEOTIDES];
    // keep track of maximum initialized sizes
    unsigned int mCurrentMatrixSize;
    unsigned int mCurrentAnchorSize;
    unsigned int mCurrentQuerySize;
    unsigned int mCurrentAQSumSize;
    // define our traceback directions
    // N.B. This used to be defined as an enum, but gcc doesn't like being told
    // which storage class to use
    const static char Directions_STOP;
    const static char Directions_LEFT;
    const static char Directions_DIAGONAL;
    const static char Directions_UP;
    // repeat structure determination
    const static int repeat_size_max;
    // define scoring constants
    const float mMatchScore;
    const float mMismatchScore;
    const float mGapOpenPenalty;
    const float mGapExtendPenalty;
    // store the backtrace pointers
    char* mPointers;
    // store the vertical gap sizes - assuming gaps are not longer than 32768 bases long
    short* mSizesOfVerticalGaps;
    // store the horizontal gap sizes - assuming gaps are not longer than 32768 bases long
    short* mSizesOfHorizontalGaps;
    // score if xi aligns to a gap after yi
    float* mQueryGapScores;
    // best score of alignment x1...xi to y1...yi
    float* mBestScores;
    // our reversed alignment
    char* mReversedAnchor;
    char* mReversedQuery;
    // define static constants
    static const float FLOAT_NEGATIVE_INFINITY;
    // toggles the use of the homo-polymer gap open penalty
    bool mUseHomoPolymerGapOpenPenalty;
    // specifies the homo-polymer gap open penalty
    float mHomoPolymerGapOpenPenalty;
    // toggles the use of the entropy gap open penalty
    bool mUseEntropyGapOpenPenalty;
    // specifies the entropy gap open penalty (multiplier)
    float mEntropyGapOpenPenalty;
    // toggles the use of the repeat gap extension penalty
    bool mUseRepeatGapExtensionPenalty;
    // specifies the repeat gap extension penalty
    float mRepeatGapExtensionPenalty;
    // specifies the max repeat gap extension penalty
    float mMaxRepeatGapExtensionPenalty;
};

// returns the maximum floating point number
inline float CSmithWatermanGotoh::MaxFloats(const float& a, const float& b, const float& c) {
    float max = 0.0f;
    if(a > max) max = a;
    if(b > max) max = b;
    if(c > max) max = c;
    return max;
}


text:
/****************************************************************************************/
/*                                                                                */
/*                                    Pegasus Editor                                    */
/*                                                                                */
/****************************************************************************************/

//! \file	GraphNodeGraphicsItem.h
//! \author	Karolyn Boulanger
//! \date	02nd April 2016
//! \brief	Graphics item representing one node in the graph

#ifndef EDITOR_GRAPHNODEGRAPHICSITEM_H
#define EDITOR_GRAPHNODEGRAPHICSITEM_H

#include <QGraphicsItem>

class QUndoStack;
class GraphNodeInputGraphicsItem;
class GraphNodeOutputGraphicsItem;
class QGraphicsSimpleTextItem;

//! Graphics item representing one node in the graph
class GraphNodeGraphicsItem : public QGraphicsObject
{
    Q_OBJECT

private:

    friend class GraphEditorGraphicsScene;

    //! Constructor
    //! \param scene Scene the item will belong to
    //! \param title Name that appears in the header of the node
    //! \param undoStack Undo stack associated with the item
    //! \warning Use scene for access to the scene, and not scene(),
    //!          as it is not defined yet in the constructor
    GraphNodeGraphicsItem(const QString& title,
                          QGraphicsScene* scene,
                          QUndoStack* undoStack);

    //! Destructor
    virtual ~GraphNodeGraphicsItem();

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

public:

    //! Add an input to the node
    //! \param name Name of the input, needs to be short to fit in the node item,
    //!             starts with an uppercase letter
    //! \warning The node item has to be added to the scene before this function can be called
    void AddInput(const QString& name);

    //! Get the current number of inputs of the node item
    //! \return Current number of inputs
    inline unsigned int GetNumInputs() const { return static_cast<unsigned int>(mInputs.size()); }

    //! Get one of the input items
    //! \param index Index of the input (0 <= index < GetNumInputs())
    //! \return Pointer to the input item if the index is valid, nullptr otherwise
    GraphNodeInputGraphicsItem* GetInputItem(unsigned int index) const;

    //! Get the output item
    //! \return Pointer to the output item
    inline GraphNodeOutputGraphicsItem* GetOutputItem() const { return mOutput.item; }

    //! \todo Document those functions

    QRectF boundingRect() const;
    void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget);

    // Enable the use of qgraphicsitem_cast
    //! \todo Use a common repository of indexes to avoid conflicts
    //! \todo Document those two lines
    enum { Type = UserType + 100 };
    int type() const { return Type; }

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

signals:

    //! Emitted when the node has been moved by the user
    void NodeMoved();

    //! Emitted when the user does a double click to this node
    //void DoubleClicked(Pegasus::Timeline::IBlockProxy * block);

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

protected:

    //! Get the height of the node body depending on the number of inputs
    //! (from the bottom of the header to the top of the footer)
    //! \return Height of the node body in pixels
    float GetBodyHeight() const;

    QVariant itemChange(GraphicsItemChange change, const QVariant &value);

    void mousePressEvent(QGraphicsSceneMouseEvent *event);
    void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
    void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);

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

private:

    //! Name that appears in the header of the node
    const QString mTitle;

    //! Description of an input
    struct Input
    {
        //! Name of the input, needs to be short to fit in the node item, starts with an uppercase letter
        QString name;

        //! Child item representing an input connector
        GraphNodeInputGraphicsItem* item;

        //! Child item representing the text next to the input connector
        QGraphicsSimpleTextItem* labelItem;
    };

    //! List of inputs used by the node
    QList<Input> mInputs;

    //! Description of an output
    struct Output
    {
        //! Child item representing an output connector
        GraphNodeOutputGraphicsItem* item;
    };

    //! Output used by the node
    Output mOutput;

    //! Undo stack associated with this item
    QUndoStack* mUndoStack;

    //! True if undo commands can be sent
    bool mEnableUndo;

    //! Node ID counter, assigned uniquely to each block, used for merging undo commands
    //! (so moving a node does not create a new undo command for each pixel moved)
    static unsigned int sCurrentNodeID;

    //! Node ID, unique to each node, used for merging undo commands
    //! (so moving a node does not create a new undo command for each pixel moved)
    unsigned int mNodeID;

    //! Mouse click ID, unique for each time the click is maintained while moving a node.
    //! Used to create new undo commands each time the mouse click is released.
    static unsigned int sMouseClickID;
};

#endif // EDITOR_GRAPHNODEGRAPHICSITEM_H


text:
module Mastermind
	class Guess
		attr_reader :value
		def initialize(value) #should be Array of size 4 e.g. ["r","g","b","h"]
			@value = value
		end
	end
end


text:
package com.pearson.statsagg.controller.thread_managers;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import com.pearson.statsagg.alerts.EmailThread;
import com.pearson.statsagg.globals.ApplicationConfiguration;
import com.pearson.statsagg.utilities.StackTrace;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author Jeffrey Schmidt
 */
public class SendEmail_ThreadPoolManager {

    private static final Logger logger = LoggerFactory.getLogger(SendEmail_ThreadPoolManager.class.getName());

    private static final Object lock_ = new Object();
    private static ExecutorService threadExecutor_ = null;

    public static void start() {
        synchronized(lock_) {
            if ((threadExecutor_ == null) || ((!threadExecutor_.isShutdown()) && (!threadExecutor_.isTerminated()))) {
                threadExecutor_ = Executors.newCachedThreadPool();
            }
            else {
                logger.info("Can't create new thread pool - current thread pool isn't terminated");
            }
        }
    }

    public static void shutdown() {

        synchronized(lock_) {
            if (threadExecutor_ == null) {
                return;
            }

            try {
                threadExecutor_.shutdown();

                // reusing the termination delay time from the aggregation invokers because it makes sense in this context
                threadExecutor_.awaitTermination((2 * ApplicationConfiguration.getFlushTimeAgg()) + 3000, TimeUnit.MILLISECONDS);
            }
            catch (Exception e) {
                logger.error(e.toString() + System.lineSeparator() + StackTrace.getStringFromStackTrace(e));
            }
        }

    }

    public static void executeThread(EmailThread emailThread) {
        try {
            if ((threadExecutor_ != null) && !threadExecutor_.isShutdown() && !threadExecutor_.isTerminated()) {
                threadExecutor_.execute(emailThread);
            }
            else {
                logger.warn("The thread pool is not in a state that can execute the requested thread.");
            }
        }
        catch (Exception e) {
            logger.error(e.toString() + System.lineSeparator() + StackTrace.getStringFromStackTrace(e));
        }
    }

}


text:
CREATE TABLE [dbo].[vOrganizationDescendants] (
    [id]                INT          IDENTITY (1, 1) NOT NULL,
    [OrgId]             VARCHAR (10) NOT NULL,
    [Name]              VARCHAR (50) NOT NULL,
    [IsActive]          BIT          DEFAULT ((1)) NOT NULL,
    [ImmediateParentId] VARCHAR (10) NULL,
    [RollupParentId]    VARCHAR (10) NULL,
    PRIMARY KEY NONCLUSTERED ([id] ASC)
);

GO
CREATE NONCLUSTERED INDEX [nci_wi_vOrganizationDescendants_6992A67F3973348D2691C195903D58FD]
    ON [dbo].[vOrganizationDescendants]([RollupParentId] ASC);

GO
CREATE CLUSTERED INDEX [nci_wi_vOrganizationDescendants_A9356AAAD0088C1A44FB244F7B890EEA]
    ON [dbo].[vOrganizationDescendants]([OrgId] ASC, [RollupParentId] ASC);


text:
package org.apache.camel.example;

import org.junit.BeforeClass;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SpringJmsAOPClientServerTest extends SpringJmsClientServerTest {

    @BeforeClass
    public static void setUpServer() {
        serverContext = new ClassPathXmlApplicationContext("/META-INF/spring/camel-server-aop.xml");
    }

}


text: module.exports = require('regenerate')().addRange(0xA500, 0xA62B);


text:
require 'spec_helper'

describe 'projects/merge_requests/edit.html.haml' do
  include Devise::Test::ControllerHelpers

  let(:user) { create(:user) }
  let(:project) { create(:project) }
  let(:fork_project) { create(:project, forked_from_project: project) }
  let(:unlink_project) { Projects::UnlinkForkService.new(fork_project, user) }
  let(:milestone) { create(:milestone, project: project) }

  let(:closed_merge_request) do
    create(:closed_merge_request,
      source_project: fork_project,
      target_project: project,
      author: user,
      assignee: user,
      milestone: milestone)
  end

  before do
    assign(:project, project)
    assign(:merge_request, closed_merge_request)

    allow(view).to receive(:can?).and_return(true)
    allow(view).to receive(:current_user)
      .and_return(User.find(closed_merge_request.author_id))
  end

  context 'when a merge request without fork' do
    it "shows editable fields" do
      unlink_project.execute
      closed_merge_request.reload

      render

      expect(rendered).to have_field('merge_request[title]')
      expect(rendered).to have_field('merge_request[description]')
      expect(rendered).to have_selector('#merge_request_assignee_id', visible: false)
      expect(rendered).to have_selector('#merge_request_milestone_id', visible: false)
      expect(rendered).not_to have_selector('#merge_request_target_branch', visible: false)
    end
  end

  context 'when a merge request with an existing source project is closed' do
    it "shows editable fields" do
      render

      expect(rendered).to have_field('merge_request[title]')
      expect(rendered).to have_field('merge_request[description]')
      expect(rendered).to have_selector('#merge_request_assignee_id', visible: false)
      expect(rendered).to have_selector('#merge_request_milestone_id', visible: false)
      expect(rendered).to have_selector('#merge_request_target_branch', visible: false)
    end
  end
end


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.puntodeventa.global.Util.Constants;

/**
 *
 * @author USER
 */
public class VentaColumns {

    public static final String PRODUCT_CODE = "Cód. prod";
    public static final String PRODUCT_DESCR = "Producto";
    public static final String QUANTITY = "Cantidad";
    public static final String UNIT_PRICE = "Precio unitario";
    public static final String SUBTOTAL = "Subtotal";
}