text:
"""distutils.command.bdist_dumb

Implements the Distutils 'bdist_dumb' command (create a "dumb" built
distribution -- i.e., just an archive to be unpacked under $prefix or
$exec_prefix)."""

# This module should be kept compatible with Python 2.1.

__revision__ = "$Id: bdist_dumb.py 37828 2004-11-10 22:23:15Z loewis $"

import os
from distutils.core import Command
from distutils.util import get_platform
from distutils.dir_util import create_tree, remove_tree, ensure_relative
from distutils.errors import *
from distutils import log

class bdist_dumb (Command):

    description = "create a \"dumb\" built distribution"

    user_options = [('bdist-dir=', 'd',
                     "temporary directory for creating the distribution"),
                    ('plat-name=', 'p',
                     "platform name to embed in generated filenames "
                     "(default: %s)" % get_platform()),
                    ('format=', 'f',
                     "archive format to create (tar, ztar, gztar, zip)"),
                    ('keep-temp', 'k',
                     "keep the pseudo-installation tree around after " +
                     "creating the distribution archive"),
                    ('dist-dir=', 'd',
                     "directory to put final built distributions in"),
                    ('skip-build', None,
                     "skip rebuilding everything (for testing/debugging)"),
                    ('relative', None,
                     "build the archive using relative paths"
                     "(default: false)"),
                   ]

    boolean_options = ['keep-temp', 'skip-build', 'relative']

    default_format = { 'posix': 'gztar',
                       'nt': 'zip',
                       'os2': 'zip' }

    def initialize_options (self):
        self.bdist_dir = None
        self.plat_name = None
        self.format = None
        self.keep_temp = 0
        self.dist_dir = None
        self.skip_build = 0
        self.relative = 0

    # initialize_options()

    def finalize_options (self):

        if self.bdist_dir is None:
            bdist_base = self.get_finalized_command('bdist').bdist_base
            self.bdist_dir = os.path.join(bdist_base, 'dumb')

        if self.format is None:
            try:
                self.format = self.default_format[os.name]
            except KeyError:
                raise DistutilsPlatformError, \
                      ("don't know how to create dumb built distributions " +
                       "on platform %s") % os.name

        self.set_undefined_options('bdist',
                                   ('dist_dir', 'dist_dir'),
                                   ('plat_name', 'plat_name'))

    # finalize_options()

    def run (self):

        if not self.skip_build:
            self.run_command('build')

        install = self.reinitialize_command('install', reinit_subcommands=1)
        install.root = self.bdist_dir
        install.skip_build = self.skip_build
        install.warn_dir = 0

        log.info("installing to %s" % self.bdist_dir)
        self.run_command('install')

        # And make an archive relative to the root of the
        # pseudo-installation tree.
        archive_basename = "%s.%s" % (self.distribution.get_fullname(),
                                      self.plat_name)

        # OS/2 objects to any ":" characters in a filename (such as when
        # a timestamp is used in a version) so change them to hyphens.
        if os.name == "os2":
            archive_basename = archive_basename.replace(":", "-")

        pseudoinstall_root = os.path.join(self.dist_dir, archive_basename)
        if not self.relative:
            archive_root = self.bdist_dir
        else:
            if (self.distribution.has_ext_modules() and
                (install.install_base != install.install_platbase)):
                raise DistutilsPlatformError, \
                      ("can't make a dumb built distribution where "
                       "base and platbase are different (%s, %s)"
                       % (repr(install.install_base),
                          repr(install.install_platbase)))
            else:
                archive_root = os.path.join(self.bdist_dir,
                                   ensure_relative(install.install_base))

        # Make the archive
        self.make_archive(pseudoinstall_root,
                          self.format, root_dir=archive_root)

        if not self.keep_temp:
            remove_tree(self.bdist_dir, dry_run=self.dry_run)

    # run()

# class bdist_dumb


text:
package elegit;

import org.eclipse.jgit.errors.UnsupportedCredentialItem;
import org.eclipse.jgit.transport.CredentialItem;
import org.eclipse.jgit.transport.CredentialsProvider;
import org.eclipse.jgit.transport.URIish;

import java.util.Iterator;
import java.util.List;

public class ElegitCredentialsProvider extends CredentialsProvider {

    // Used for unit testing
    private List<String> userCredentials;

    public ElegitCredentialsProvider() {
        super();
        this.userCredentials = null;
    }

    ElegitCredentialsProvider(List<String> userCredentials) {
        super();
        this.userCredentials = userCredentials;
    }

    @Override
    public boolean isInteractive() {
        return true;
    }

    @Override
    public boolean supports(CredentialItem... credentialItems) {
        for(CredentialItem item : credentialItems) {
            System.out.println("Supports: " + item);
        }
        return true;
    }

    @Override
    public boolean get(URIish urIish, CredentialItem... credentialItems) throws UnsupportedCredentialItem {
        if (userCredentials != null) {
            Iterator<String> userCredentialsIterator = userCredentials.iterator();
            for(CredentialItem item : credentialItems) {
                String nextValue = userCredentialsIterator.next();
                if (item instanceof CredentialItem.Username) {
                    ((CredentialItem.Username)item).setValue(nextValue);
                } else if (item instanceof CredentialItem.Password) {
                    ((CredentialItem.Password)item).setValue(nextValue.toCharArray());
                } else if (item instanceof CredentialItem.StringType) {
                    ((CredentialItem.StringType)item).setValue(nextValue);
                } else {
                    System.out.println(item);
                    System.out.println(item.getPromptText());
                    throw new UnsupportedCredentialItem(urIish, "Case not covered in ElegitCredentialsProvider");
                }
            }
        }
        return true;
    }
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

        <meta charset="UTF-8" />
        <meta name="robots" content="index, follow, all" />
        <title>Thelia\Tools\URL | </title>
                    <link rel="stylesheet" type="text/css" href="../../stylesheet.css">

Classes

Namespaces

Interfaces

Traits

Index

Class

Thelia\Tools\URL

    class
    URL

Constants

                PATH_TO_FILE

                WITH_INDEX_PAGE

Methods

                    __construct(ContainerInterface $container = null)

                    static URL

                    getInstance()

Return this class instance, only once instanciated.

                    string

                    getBaseUrl()

Return the base URL, either the baseurl defined in Config, or the URL of the current language, if 'onedomainforeachlang' is enabled.

                    string

                    getIndexPage()

                    string

                    absoluteUrl(string $path, array $parameters = null, boolean $path_only = self::WITH_INDEX_PAGE)

Returns the Absolute URL for a given path relative to web root.

                    string

                    adminViewUrl(string $viewName, array $parameters = array())

Returns the Absolute URL to a administration view

                    string

                    viewUrl(string $viewName, array $parameters = array())

Returns the Absolute URL to a view

                    RewritingRetriever

                    retrieve($view $view, $viewId $viewId, $viewLocale $viewLocale)

Retrieve a rewritten URL from a view, a view id and a locale

                    RewritingRetriever

                    retrieveCurrent(Request $request)

Retrieve a rewritten URL from the current GET parameters

                    RewritingResolver

                    resolve($url $url)

Retrieve a rewritten URL from the current GET parameters or use toString method

Details

at line 45

                    public
    __construct(ContainerInterface $container = null)

Parameters

                ContainerInterface
                $container

at line 65

                static    public            URL
    getInstance()

Return this class instance, only once instanciated.

Return Value

            URL
            the instance.

Exceptions

                RuntimeException
                if the class has not been instanciated.

at line 77

                    public            string
    getBaseUrl()

Return the base URL, either the baseurl defined in Config, or the URL of the current language, if 'onedomainforeachlang' is enabled.

Return Value

            string
            the base URL, with a trailing '/'

at line 100

                    public            string
    getIndexPage()

Return Value

            string
            the index page, which is in fact the base URL.

at line 117

                    public            string
    absoluteUrl(string $path, array $parameters = null, boolean $path_only = self::WITH_INDEX_PAGE)

Returns the Absolute URL for a given path relative to web root.

By default,
the script name (indexdev.php) is added to the URL in devenvironment, use
$path_only = true to get a path without the index script.

Parameters

                string
                $path
                the relative path

                array
                $parameters
                An array of parameters

                boolean
                $path_only
                if true (PATHTOFILE), getIndexPage() will  not be added

Return Value

            string
            The generated URL

at line 173

                    public            string
    adminViewUrl(string $viewName, array $parameters = array())

Returns the Absolute URL to a administration view

Parameters

                string
                $viewName
                the view name (e.g. login for login.html)

                array
                $parameters
                An array of parameters

Return Value

            string
            The generated URL

at line 188

                    public            string
    viewUrl(string $viewName, array $parameters = array())

Returns the Absolute URL to a view

Parameters

                string
                $viewName
                the view name (e.g. login for login.html)

                array
                $parameters
                An array of parameters

Return Value

            string
            The generated URL

at line 204

                    public            RewritingRetriever
    retrieve($view $view, $viewId $viewId, $viewLocale $viewLocale)

Retrieve a rewritten URL from a view, a view id and a locale

Parameters

                $view
                $view

                $viewId
                $viewId

                $viewLocale
                $viewLocale

Return Value

            RewritingRetriever
            You can access $url and $rewrittenUrl properties

at line 228

                    public            RewritingRetriever
    retrieveCurrent(Request $request)

Retrieve a rewritten URL from the current GET parameters

Parameters

                Request
                $request

Return Value

            RewritingRetriever
            You can access $url and $rewrittenUrl properties or use toString method

at line 267

                    public            RewritingResolver
    resolve($url $url)

Retrieve a rewritten URL from the current GET parameters or use toString method

Parameters

                $url
                $url

Return Value

            RewritingResolver

        Generated by Sami, the API Documentation Generator.


text:
class PrefService;
class PrefChangeRegistrar;

namespace base {
class Clock;
class DictionaryValue;
}

namespace user_prefs {
class PrefRegistrySyncable;
}

namespace content_settings {

class RuleIterator;

// Represents a single pref for reading/writing content settings of one type.
class ContentSettingsPref {
 public:
  typedef base::Callback<void(const ContentSettingsPattern&,
                              const ContentSettingsPattern&,
                              ContentSettingsType,
                              const std::string&)> NotifyObserversCallback;

  ContentSettingsPref(ContentSettingsType content_type,
                      PrefService* prefs,
                      PrefChangeRegistrar* registrar,
                      const std::string& pref_name,
                      bool incognito,
                      NotifyObserversCallback notify_callback);
  ~ContentSettingsPref();

  scoped_ptr<RuleIterator> GetRuleIterator(
      const ResourceIdentifier& resource_identifier,
      bool incognito) const;

  bool SetWebsiteSetting(const ContentSettingsPattern& primary_pattern,
                         const ContentSettingsPattern& secondary_pattern,
                         const ResourceIdentifier& resource_identifier,
                         base::Value* value);

  void ClearAllContentSettingsRules();

  void UpdateLastUsage(const ContentSettingsPattern& primary_pattern,
                       const ContentSettingsPattern& secondary_pattern,
                       base::Clock* clock);

  base::Time GetLastUsage(const ContentSettingsPattern& primary_pattern,
                          const ContentSettingsPattern& secondary_pattern);

  size_t GetNumExceptions();

  // Tries to lock |lock_|. If successful, returns true and releases the lock.
  bool TryLockForTesting() const;

 private:
  // TODO(msramek): Currently only needed in the unittest to get the
  // corresponding pref name. Remove once pref names are in WebsiteSettingsInfo.
  friend class DeadlockCheckerObserver;

  // Reads all content settings exceptions from the preference and loads them
  // into the |value_map_|. The |value_map_| is cleared first.
  void ReadContentSettingsFromPref();

  // Callback for changes in the pref with the same name.
  void OnPrefChanged();

  // Update the preference that stores content settings exceptions and syncs the
  // value to the obsolete preference. When calling this function, |lock_|
  // should not be held, since this function will send out notifications of
  // preference changes.
  void UpdatePref(
      const ContentSettingsPattern& primary_pattern,
      const ContentSettingsPattern& secondary_pattern,
      const ResourceIdentifier& resource_identifier,
      const base::Value* value);

  static void CanonicalizeContentSettingsExceptions(
      base::DictionaryValue* all_settings_dictionary);

  // In the debug mode, asserts that |lock_| is not held by this thread. It's
  // ok if some other thread holds |lock_|, as long as it will eventually
  // release it.
  void AssertLockNotHeld() const;

  // The type of content settings stored in this pref.
  ContentSettingsType content_type_;

  // Weak; owned by the Profile and reset in ShutdownOnUIThread.
  PrefService* prefs_;

  // Owned by the PrefProvider.
  PrefChangeRegistrar* registrar_;

  // Name of the dictionary preference managed by this class.
  const std::string& pref_name_;

  bool is_incognito_;

  // Whether we are currently updating preferences, this is used to ignore
  // notifications from the preferences service that we triggered ourself.
  bool updating_preferences_;

  OriginIdentifierValueMap value_map_;

  OriginIdentifierValueMap incognito_value_map_;

  NotifyObserversCallback notify_callback_;

  // Used around accesses to the value map objects to guarantee thread safety.
  mutable base::Lock lock_;

  base::ThreadChecker thread_checker_;

  DISALLOW_COPY_AND_ASSIGN(ContentSettingsPref);
};

}  // namespace content_settings

#endif  // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_PREF_H_


text:
import React, { Component, PropTypes } from 'react';
import mui, {CardTitle} from 'material-ui';

class ProjectCardTitle extends Component {
  render() {
    const { title, subtitle } = this.props;
    return (
    	<CardTitle title={title} subtitle={subtitle} style={styles.base} titleStyle={styles.title} subtitleStyle={styles.subtitle} />
    );
  }
}

var styles = {
	base: {
		paddingBottom: 0
	},
	title: {
		WebkitFontSmoothing: 'antialiased',
		borderCollapse: 'separate',
		color: '#333333',
		display: 'block',
		fontFamily: "medium-content-sans-serif-font, 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', Geneva, Verdana, sans-serif",
		fontSize: '22px',
		fontStyle: 'normal',
		fontWeight: 'bold',
		height: '28px',
		letterSpacing: 'normal',
		lineHeight: '28.6000003814697px',
		wordWrap: 'break-word'
	},
	subtitle: {
		WebkitFontSmoothing: 'antialiased',
		borderCollapse: 'separate',
		color: '#8f8f8f',
		display: 'block',
		fontFamily: "medium-content-sans-serif-font, 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', Geneva, Verdana, sans-serif",
		fontSize: '14px',
		fontStyle: 'normal',
		fontWeight: 'normal',
		height: '28px',
		letterSpacing: 'normal',
		wordWrap: 'break-word',
		marginLeft: 0
	}
}

export default ProjectCardTitle;


text:
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
require File.expand_path(File.dirname(__FILE__) + "/representation_spec")

describe Service do
  before(:each) do
    @test_class = Service
    @hash = {}
  end

  def do_new
    @service = Service.new mock(Link), @hash
  end

  describe "connnect" do
    before(:each) do
      @username = 'foo@example.com'
      @password = 'secret'
    end

    def do_connect
      Service.connect(@username, @password)
    end

    describe "when successful" do
      before(:each) do
        @service = mock(Service)
        @link = mock(Link, :get => @service)
        Link.stub!(:new).and_return @link
      end

      it "returns link" do
        do_connect.should == @service
      end
    end
  end

  describe "with all attributes" do
    before(:each) do
      @attributes = {
        'version' => '1.0.0'
      }
    end

    it_should_behave_like "representation with all attributes"
  end

  describe "with all links" do
    before(:each) do
      @resources = {
        'registries' => mock(Index)
      }
    end

    it_should_behave_like "representation with all resources"
  end
end


text:
package com.cleawing.ignite.akka.dispatch

import akka.actor.{ExtendedActorSystem, ActorRef, ActorSystem}
import akka.dispatch.{MailboxType, MessageQueue, ProducesMessageQueue}
import com.cleawing.ignite.Implicits.ConfigOps
import com.cleawing.ignite.akka.dispatch.MessageQueues.IgniteUnboundedQueueBasedMessageQueue
import com.cleawing.ignite.akka.{IgniteExtension, IgniteConfig}
import com.typesafe.config.Config
import org.apache.ignite.cache.{CacheMemoryMode, CacheMode}

case class IgniteUnboundedDistributedMailbox(_memoryMode: CacheMemoryMode, _backups : Int)
  extends MailboxType with ProducesMessageQueue[IgniteUnboundedQueueBasedMessageQueue] {

  def this(settings: ActorSystem.Settings, config: Config) = {
    this(config.getCacheMemoryMode("cache-memory-mode"), config.getInt("backups"))
  }

  final override def create(owner: Option[ActorRef], system: Option[ActorSystem]): MessageQueue = {
    (owner, system) match {
      case (Some(o), Some(s)) =>
        implicit val ignite = IgniteExtension(s)
        val cfg = IgniteConfig.CollectionBuilder()
          .setCacheMode(CacheMode.PARTITIONED)
          .setMemoryMode(_memoryMode)
          .setBackups(_backups)
          .setOffHeapMaxMemory(0)
          .build()
        new IgniteUnboundedQueueBasedMessageQueue(o.path.toStringWithoutAddress, cfg, s.asInstanceOf[ExtendedActorSystem])
      case _ => throw new IllegalStateException("ActorRef and ActorSystem should be defined.")
    }
  }
}


text:
'use strict';

//Start by defining the main module and adding the module dependencies
angular.module(ApplicationConfiguration.applicationModuleName,
  ApplicationConfiguration.applicationModuleVendorDependencies);

// Setting HTML5 Location Mode
angular.module(ApplicationConfiguration.applicationModuleName).config(['$locationProvider',
	function($locationProvider) {
		$locationProvider.hashPrefix('!');
	}])
  // Setting Flash
  .factory('flash',
    function($rootScope) {
      var queue = ['Hello'];
      var currentMessage = '***Flash***';

      $rootScope.$on('$routeChangeSuccess', function() {
        currentMessage = queue.shift() || '';
      });

      return {
        setMessage: function(message) {
          queue.push(message);
        },
        getMessage: function() {
          return currentMessage;
        }
      };
    }
  );

//Then define the init function for starting up the application
angular.element(document).ready(function() {
	//Fixing facebook bug with redirect
	if (window.location.hash === '#_=_') window.location.hash = '#!';

	//Then init the app
	angular.bootstrap(document, [ApplicationConfiguration.applicationModuleName]);
});


text:
<?php

defined('C5_EXECUTE') or die(_("Access Denied."));

class DefunctSocialIconsPackage extends Package {

	protected $pkgHandle = 'defunct_social_icons';
	protected $appVersionRequired = '5.3.2';
	protected $pkgVersion = '1.2';

	public function getPackageDescription() {
		return t("Installs the Social Icons Block");
	}

	public function getPackageName() {
		return t("Social Icons");
	}

	public function install() {
		$pkg = parent::install();

		// install block
		BlockType::installBlockTypeFromPackage('defunct_social_icons', $pkg);

	}
}


text:
using System.ComponentModel.DataAnnotations;

namespace Test.Integration.TestModels.SchoolModels
{
    public class UpdateSchoolViewModel : AddSchoolViewModel
    {
        [Required]
        public int Id { get; set; }
    }
}


text:
package android.kota.com.dribbbleviewer;

import android.app.Application;

import com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator;
import com.nostra13.universalimageloader.cache.memory.impl.LruMemoryCache;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
import com.nostra13.universalimageloader.core.assist.QueueProcessingType;

/**
 * Created by takasakikota on 2014/07/30.
 */
public class MyApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();

        // グローバル設定の生成と初期化を行う
        ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext())
                .threadPoolSize(Thread.NORM_PRIORITY - 2)
                .denyCacheImageMultipleSizesInMemory()
                .diskCacheFileNameGenerator(new Md5FileNameGenerator())
                .diskCacheSize(50 * 1024 * 1024)
                .tasksProcessingOrder(QueueProcessingType.LIFO)
                .writeDebugLogs()
                .build();
        ImageLoader.getInstance().init(config);
    }
}


text:
// ©2006 Transinsight GmbH - www.transinsight.com - All rights reserved.
package brics.automaton;

/**
 * TODO describe me
 *
 */
public class NoopActor implements Actor
{
	/**
     *
     */
    private static final long serialVersionUID = 7137457256934070851L;
	private String name="";

	public NoopActor(){

	}

	public NoopActor(String name){
		this.name = name;
	}

	public void act(char[] chars, int matchStartIndex, int matchEndIndex, StringBuffer outputBuffer)
	{
		for(int i=matchStartIndex;i<=matchEndIndex;i++){
			outputBuffer.append(chars[i]);
		}
		System.out.println("NoopActor.act(): My name is "+name+". Text is: '"+outputBuffer+"'");
	}

	/**
	 * Does nothing.
	 */
	public void merge (Actor actor) {}
}


text:
angular.module('odl').service('server', function ($rootScope, $http) {
    this.getDevices = function() {
        return $http.get('/api/device');
    }

    this.newDevice = function(imei) {
        return $http.post('/api/device', {imei: imei});
    }

    this.deleteDevice = function(guid) {
        return $http.delete('/api/device/' + guid);
    }

    this.checkDevice = function(state, guid) {
        return $http.post('/api/check/' + (state ? 'in' : 'out') + '/' + guid);
    }

    this.getQRs = function() {
        return $http.get('/api/qr');
    }

    this.newQR = function() {
        return $http.post('/api/qr', {});
    }
});


text:
[Week 4 Home](../)

#U2.W4: Group Challenge: Research Methods

## Learning Objectives
- Research and use Ruby methods
- Iterate through data structures and manipulate the content
- Explain how to use an existing Ruby method

## Summary
By now you have had some practice looking through the [Ruby Docs](http://ruby-doc.org/). I'm sure you've had some difficulty trying to figure out what methods do and how they work. You have probably also seen some people using methods you didn't know existed.

In this challenge, each member of your group will have a specific challenge and you will each practice reading through the docs to find existing `Enumerable`, `Hash`, or `Array` methods. You will then apply them to set arrays and hashes.

Research and test these methods out. You may want to play around with them in IRB to figure out exactly how they work before you can implement them properly.

Keep in mind the differences between destructive and non-destructive methods. Some of these methods should be destructive, and others should not. If you are confused about the difference between destructive and non-destructive methods, review the [Pad an Array](../pad-array) challenge.

## Releases

## Release 0:
Refer to your accountability group spreadsheet to find your role.

Each person has a challenge to solve. This does not need to be done in any order.

If you have fewer than five accountability group members, only do as many of the challenges as you have people. Your goal is to learn how to use existing methods and teach others, not to learn specific methods. If you only have three people, only do the first three challenges.

That said, doing only your own release is the minimum. If you have time after finishing the week, we suggest doing all of these.

Use the [Ruby Docs](http://ruby-doc.org/) find methods you can use
on arrays and a hashes, and use them to complete each goal.

Once you complete your challenge, Identify and describe the Ruby method you implemented. Teach your accountability group how to use the methods.

Each person will be working with the following `Array` and `Hash` (These will be permanently modified by some methods, and not by others):

```ruby
i_want_pets = ["I", "want", 3, "pets", "but", "only", "have", 2 ]
my_family_pets_ages = {"Evi" => 6, "Hoobie" => 3, "George" => 12, "Bogart" => 4, "Poly" => 4,
  "Annabelle" => 0, "Ditto" => 3}
```

#### Person 1: Find Matching Data
Create a method `my_array_finding_method` that takes an `Array` and a letter as arguments
and returns a new array of the words that contain that letter.

For example:
```ruby
my_array_finding_method(i_want_pets, "t")
#=> should return ["want","pets","but"]
```

Create a method `my_hash_finding_method` that takes a `Hash` and number as arguments and
returns a new array of pet names by age.
Ex.
```ruby
my_hash_finding_method(my_family_pets_ages, 3)
#=> should return ["Hoobie", "Ditto"]
```

#### Person 2: Modify Existing Data
I recently got a new pet, but I still want another! You'll need to create two destructive methods for this challenge.

Create a `my_array_modification_method!` that takes an array and number to be added to all
internal numbers. (Because you can never have too many pets!) It should permanently alter the original array and hash. For example:

```ruby
my_array_modification_method!(i_want_pets, 1)
#=> ["I", "want", 4, "pets", "but", "only", "have", 3]
```

Two years have passed since I made `my_family_pets_ages`, so the ages need to be updated. I want the original data to change since I can't travel back in time. For Example:

```ruby
my_hash_modification_method!(my_family_pets_ages, 2)
#=> {"Evi" => 8, "Hoobie" => 5, "George" => 14, "Bogart" => 6, "Poly" => 6, "Annabelle" => 2, "Ditto" => 5}
```

#### Person 3: Sort Data
I want to create a sorting method that alphabetizes an array. I also want to create a sorting method that arranges the data in my hash by age (starting with the youngest first). I want to see what happens when I do this, but I don't want it to modify the existing data.

```ruby
my_array_sorting_method(i_want_pets)
#=> [2, 3, "I", "but", "have", "only", "pets", "want"]

my_hash_sorting_method(my_family_pets_ages)
#=> [["Annabelle", 0], ["Ditto", 3], ["Hoobie", 3], ["Bogart", 4], ["Poly", 4], ["Evi", 6], ["George", 12]]

```

#### Person 4: Delete Matching Data
Sometimes you no longer need data that matches something. Create a `my_array_deletion_method!` that takes an array and a letter, and deletes all the strings that contain that letter. This should modify the original because we now permanently hate that letter.

For example:
```ruby
my_array_deletion_method!(i_want_pets, "a")
#=> ["I", 3, "pets", "but", "only", 2]
```

Poor George passed away. He had a good life, but I need to permanently remove him from my list.

```ruby
my_hash_deletion_method!(my_family_pets_ages, "George")
#=> {"Evi" => 6, "Hoobie" => 3, "Bogart" => 4, "Poly" => 4, "Annabelle" => 0, "Ditto" => 3}

```

#### Person 5: Split Data
At times, you will want to split data into two arrays based on a condition.

Create a `my_array_splitting_method` that will split the original array into two separate nested arrays (two arrays within one array). The first nested array should include all integers, and the second nested array should include all other values. This should not alter the original data structure.

For example:
```ruby
my_array_splitting_method(i_want_pets)
#=> [3, 2],["I", "want", "pets", "but", "only", "have"]]
```

Then create a `my_hash_splitting_method` that will separate the hash into two arrays based on the value. It should return two arrays, the first which includes all pets who are four years of age or younger and the second that includes all other pets.T his should not alter the original data structure.

```ruby
my_hash_splitting_method(my_family_pets_ages, 4)
#=> [[["Hoobie", 3], ["Annabelle", 0], ["Ditto", 3], ["Bogart", 4], ["Poly", 4]], [["Evi", 6], ["George", 12]]]
```

## Release 1: Teach Others
Once you complete your challenge, identify and describe the Ruby method you implemented. Teach your
accountability group how to use the methods.

## Release 2: Commit and Push
Push your solution to GitHub!

You may want to email your accountability group your solution (and driver test code if you modified it).

## Release 3: Reflect
Use the [reflection guidelines](https://github.com/Devbootcamp/phase-0-handbook/blob/master/coding-references/reflection-guidelines.md) and also discuss the following in the reflection section of the [my_solution](my_solution.rb) file:

What did you learn about researching and explaining your research to others?

## Release 4: Update your solution
When you get all of the solutions, paste them into your file as well. Review the solutions they created. Which existing methods did they use? Try to use them based on the instructions your group-mate included.

## Release 5: Commit and Push
Push your final solution to GitHub.


text:
package com.veinhorn.scrollgalleryview.loader.picasso;

import android.content.Context;
import android.widget.ImageView;

import com.squareup.picasso.Callback;
import com.squareup.picasso.Picasso;
import com.veinhorn.scrollgalleryview.loader.MediaLoader;

/**
 * Created by veinhorn on 2/4/18.
 */

public class PicassoImageLoader implements MediaLoader {
    private String url;
    private Integer thumbnailWidth;
    private Integer thumbnailHeight;

    public PicassoImageLoader(String url) {
        this.url = url;
    }

    public PicassoImageLoader(String url, Integer thumbnailWidth, Integer thumbnailHeight) {
        this.url = url;
        this.thumbnailWidth = thumbnailWidth;
        this.thumbnailHeight = thumbnailHeight;
    }

    @Override
    public boolean isImage() {
        return true;
    }

    @Override
    public void loadMedia(Context context, final ImageView imageView, final MediaLoader.SuccessCallback callback) {
        Picasso.with(context)
                .load(url)
                .placeholder(R.drawable.placeholder_image)
                .into(imageView, new ImageCallback(callback));
    }

    @Override
    public void loadThumbnail(Context context, final ImageView thumbnailView, final MediaLoader.SuccessCallback callback) {
        Picasso.with(context)
                .load(url)
                .resize(thumbnailWidth == null ? 100 : thumbnailWidth,
                        thumbnailHeight == null ? 100 : thumbnailHeight)
                .placeholder(R.drawable.placeholder_image)
                .centerInside()
                .into(thumbnailView, new ImageCallback(callback));
    }

    private static class ImageCallback implements Callback {
        private final MediaLoader.SuccessCallback callback;

        public ImageCallback(SuccessCallback callback) {
            this.callback = callback;
        }

        @Override
        public void onSuccess() {
            callback.onSuccess();
        }

        @Override
        public void onError() {

        }
    }
}


text:
package main

import (
	"context"
	"fmt"
	"log"
	"os"
	"strings"

	cepubsub "github.com/cloudevents/sdk-go/protocol/pubsub/v2"
	pscontext "github.com/cloudevents/sdk-go/protocol/pubsub/v2/context"
	cloudevents "github.com/cloudevents/sdk-go/v2"
	"github.com/kelseyhightower/envconfig"
)

/*
To setup:
gcloud pubsub topics create demo_cloudevents
gcloud pubsub subscriptions create foo --topic=demo_cloudevents
To test:
gcloud pubsub topics publish demo_cloudevents --message='{"Hello": "world"}'
To fix a bad message:
gcloud pubsub subscriptions pull --auto-ack foo
*/

type envConfig struct {
	ProjectID string `envconfig:"GOOGLE_CLOUD_PROJECT"`

	SubscriptionIDs string `envconfig:"PUBSUB_SUBSCRIPTIONS" default:"foo" required:"true"`
}

type Example struct {
	Sequence int    `json:"id"`
	Message  string `json:"message"`
}

func receive(ctx context.Context, event cloudevents.Event) error {
	fmt.Printf("Event Context: %+v\n", event.Context)

	fmt.Printf("Protocol Context: %+v\n", pscontext.ProtocolContextFrom(ctx))

	data := &Example{}
	if err := event.DataAs(data); err != nil {
		fmt.Printf("Got Data Error: %s\n", err.Error())
	}
	fmt.Printf("Data: %+v\n", data)

	fmt.Printf("----------------------------\n")
	return nil
}

func main() {
	ctx := context.Background()

	var env envConfig
	if err := envconfig.Process("", &env); err != nil {
		log.Printf("[ERROR] Failed to process env var: %s", err)
		os.Exit(1)
	}

	var opts []cepubsub.Option
	opts = append(opts, cepubsub.WithProjectID(env.ProjectID))
	for _, subscription := range strings.Split(env.SubscriptionIDs, ",") {
		opts = append(opts, cepubsub.WithSubscriptionID(subscription))
	}

	t, err := cepubsub.New(context.Background(), opts...)
	if err != nil {
		log.Fatalf("failed to create pubsub transport, %s", err.Error())
	}
	c, err := cloudevents.NewClient(t)
	if err != nil {
		log.Fatalf("failed to create client, %s", err.Error())
	}

	log.Println("Created client, listening...")

	if err := c.StartReceiver(ctx, receive); err != nil {
		log.Fatalf("failed to start pubsub receiver, %s", err.Error())
	}
}


text:
#ifndef UNIFORM_DISTRIBUTION_H
#define UNIFORM_DISTRIBUTION_H

#include "boundedRandomDistribution.h"

namespace Utils
{

class RandomGenerator;

class UniformDistribution : public BoundedRandomDistribution
{
public:
	UniformDistribution(RandomGenerator *gen);
	double draw() override;
private:
	RandomGenerator *gen{nullptr};
};

}

#endif


text:
FOUNDATION_EXPORT double Pods_ReSwiftThunkVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_ReSwiftThunkVersionString[];


text:
"""Mongo osid profile elements for assessment.authoring service packages"""
# -*- coding: utf-8 -*-
# pylint: disable=unused-import
#    importing common values to be used by assessment.authoring.ProfileManger implementation

from ..profile import ID
from ..profile import LANGUAGETYPE
from ..profile import SCRIPTTYPE
from ..profile import FORMATTYPE
from ..profile import VERSIONSCHEME
from ..profile import LOCALES
from ..profile import LICENSE
from ..profile import PROVIDERID
from ..profile import OSIDVERSION

DISPLAYNAME = 'Mongo assessment.authoring'

DESCRIPTION = 'MongoDB based assessment.authoring implementation'

VERSIONCOMPONENTS = [0, 1, 45]

RELEASEDATE = "2018-03-08"

SUPPORTS = [  # 'Remove the # when implementations exist:'
    # 'supports_journal_rollback',
    # 'supports_journal_branching',
    # 'supports_visible_federation',
    'supports_assessment_part_lookup',
    'supports_assessment_part_query',
    # 'supports_assessment_part_search',
    'supports_assessment_part_admin',
    # 'supports_assessment_part_notification',
    'supports_assessment_part_bank',
    'supports_assessment_part_bank_assignment',
    # 'supports_assessment_part_smart_bank',
    'supports_assessment_part_item',
    'supports_assessment_part_item_design',
    'supports_sequence_rule_lookup',
    # 'supports_sequence_rule_query',
    # 'supports_sequence_rule_search',
    'supports_sequence_rule_admin',
    # 'supports_sequence_rule_notification',
    # 'supports_sequence_rule_bank',
    # 'supports_sequence_rule_bank_assignment',
    # 'supports_sequence_rule_smart_bank',
    # 'supports_sequence_rule_enabler_lookup',
    # 'supports_sequence_rule_enabler_query',
    # 'supports_sequence_rule_enabler_search',
    # 'supports_sequence_rule_enabler_admin',
    # 'supports_sequence_rule_enabler_notification',
    # 'supports_sequence_rule_enabler_bank',
    # 'supports_sequence_rule_enabler_bank_assignment',
    # 'supports_sequence_rule_enabler_smart_bank',
    # 'supports_sequence_rule_enabler_rule_lookup',
    # 'supports_sequence_rule_enabler_rule_application',
]


text:
from __future__ import unicode_literals

from django.db import migrations

class Migration(migrations.Migration):

    dependencies = [
        ('taobao', '0007_auto_20180602_0854'),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='maker',
            options={'ordering': ('country',), 'verbose_name': '\u5382\u5546', 'verbose_name_plural': '\u624b\u673a\u5382\u5546'},
        ),
    ]


text:
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

/**
 * upgrade this assignment instance - this function could be skipped but it will be needed later
 * @param int $oldversion The old version of the assign module
 * @return bool
 */
function xmldb_assign_upgrade($oldversion) {
    global $CFG, $DB;

    $dbman = $DB->get_manager();

    if ($oldversion < 2012051700) {

        // Define field to be added to assign.
        $table = new xmldb_table('assign');
        $field = new xmldb_field('sendlatenotifications', XMLDB_TYPE_INTEGER, '2', null,
                                 XMLDB_NOTNULL, null, '0', 'sendnotifications');

        // Conditionally launch add field.
        if (!$dbman->field_exists($table, $field)) {
            $dbman->add_field($table, $field);
        }

        // Assign savepoint reached.
        upgrade_mod_savepoint(true, 2012051700, 'assign');
    }

    // Moodle v2.3.0 release upgrade line.
    // Put any upgrade step following this.

    if ($oldversion < 2012071800) {

        // Define field requiresubmissionstatement to be added to assign.
        $table = new xmldb_table('assign');
        $field = new xmldb_field('requiresubmissionstatement', XMLDB_TYPE_INTEGER, '2', null,
                                 XMLDB_NOTNULL, null, '0', 'timemodified');

        // Conditionally launch add field requiresubmissionstatement.

        if (!$dbman->field_exists($table, $field)) {
            $dbman->add_field($table, $field);
        }

        // Assign savepoint reached.
        upgrade_mod_savepoint(true, 2012071800, 'assign');
    }

    if ($oldversion < 2012081600) {

        // Define field to be added to assign.
        $table = new xmldb_table('assign');
        $field = new xmldb_field('completionsubmit', XMLDB_TYPE_INTEGER, '2', null,
                                 XMLDB_NOTNULL, null, '0', 'timemodified');

        // Conditionally launch add field.
        if (!$dbman->field_exists($table, $field)) {
            $dbman->add_field($table, $field);
        }

        // Assign savepoint reached.
        upgrade_mod_savepoint(true, 2012081600, 'assign');
    }

    // Individual extension dates support.
    if ($oldversion < 2012082100) {

        // Define field cutoffdate to be added to assign.
        $table = new xmldb_table('assign');
        $field = new xmldb_field('cutoffdate', XMLDB_TYPE_INTEGER, '10', null,
                                 XMLDB_NOTNULL, null, '0', 'completionsubmit');

        // Conditionally launch add field cutoffdate.
        if (!$dbman->field_exists($table, $field)) {
            $dbman->add_field($table, $field);
        }
        // If prevent late is on - set cutoffdate to due date.

        // Now remove the preventlatesubmissions column.
        $field = new xmldb_field('preventlatesubmissions', XMLDB_TYPE_INTEGER, '2', null,
                                 XMLDB_NOTNULL, null, '0', 'nosubmissions');
        if ($dbman->field_exists($table, $field)) {
            // Set the cutoffdate to the duedate if preventlatesubmissions was enabled.
            $sql = 'UPDATE {assign} SET cutoffdate = duedate WHERE preventlatesubmissions = 1';
            $DB->execute($sql);

            $dbman->drop_field($table, $field);
        }

        // Define field extensionduedate to be added to assign_grades.
        $table = new xmldb_table('assign_grades');
        $field = new xmldb_field('extensionduedate', XMLDB_TYPE_INTEGER, '10', null,
                                 XMLDB_NOTNULL, null, '0', 'mailed');

        // Conditionally launch add field extensionduedate.
        if (!$dbman->field_exists($table, $field)) {
            $dbman->add_field($table, $field);
        }

        // Assign savepoint reached.
        upgrade_mod_savepoint(true, 2012082100, 'assign');
    }

    // Team assignment support.
    if ($oldversion < 2012082300) {

        // Define field to be added to assign.
        $table = new xmldb_table('assign');
        $field = new xmldb_field('teamsubmission', XMLDB_TYPE_INTEGER, '2', null,
                                 XMLDB_NOTNULL, null, '0', 'cutoffdate');

        // Conditionally launch add field.
        if (!$dbman->field_exists($table, $field)) {
            $dbman->add_field($table, $field);
        }
        $field = new xmldb_field('requireallteammemberssubmit', XMLDB_TYPE_INTEGER, '2', null,
                                 XMLDB_NOTNULL, null, '0', 'teamsubmission');
        // Conditionally launch add field.
        if (!$dbman->field_exists($table, $field)) {
            $dbman->add_field($table, $field);
        }
        $field = new xmldb_field('teamsubmissiongroupingid', XMLDB_TYPE_INTEGER, '10', null,
                                 XMLDB_NOTNULL, null, '0', 'requireallteammemberssubmit');
        // Conditionally launch add field.
        if (!$dbman->field_exists($table, $field)) {
            $dbman->add_field($table, $field);
        }
        $index = new xmldb_index('teamsubmissiongroupingid',
                                 XMLDB_INDEX_NOTUNIQUE,
                                 array('teamsubmissiongroupingid'));
        // Conditionally launch add index.
        if (!$dbman->index_exists($table, $index)) {
            $dbman->add_index($table, $index);
        }
        $table = new xmldb_table('assign_submission');
        $field = new xmldb_field('groupid', XMLDB_TYPE_INTEGER, '10', null,
                                 XMLDB_NOTNULL, null, '0', 'status');
        // Conditionally launch add field.
        if (!$dbman->field_exists($table, $field)) {
            $dbman->add_field($table, $field);
        }
        upgrade_mod_savepoint(true, 2012082300, 'assign');
    }
    if ($oldversion < 2012082400) {

        // Define table assign_user_mapping to be created.
        $table = new xmldb_table('assign_user_mapping');

        // Adding fields to table assign_user_mapping.
        $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);
        $table->add_field('assignment', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');
        $table->add_field('userid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');

        // Adding keys to table assign_user_mapping.
        $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
        $table->add_key('assignment', XMLDB_KEY_FOREIGN, array('assignment'), 'assign', array('id'));
        $table->add_key('user', XMLDB_KEY_FOREIGN, array('userid'), 'user', array('id'));

        // Conditionally launch create table for assign_user_mapping.
        if (!$dbman->table_exists($table)) {
            $dbman->create_table($table);
        }

        // Define field blindmarking to be added to assign.
        $table = new xmldb_table('assign');
        $field = new xmldb_field('blindmarking', XMLDB_TYPE_INTEGER, '2', null,
                                 XMLDB_NOTNULL, null, '0', 'teamsubmissiongroupingid');

        if (!$dbman->field_exists($table, $field)) {
            $dbman->add_field($table, $field);
        }

        // Define field revealidentities to be added to assign.
        $table = new xmldb_table('assign');
        $field = new xmldb_field('revealidentities', XMLDB_TYPE_INTEGER, '2', null,
                                 XMLDB_NOTNULL, null, '0', 'blindmarking');

        if (!$dbman->field_exists($table, $field)) {
            $dbman->add_field($table, $field);
        }

        // Assignment savepoint reached.
        upgrade_mod_savepoint(true, 2012082400, 'assign');
    }

    // Moodle v2.4.0 release upgrade line.
    // Put any upgrade step following this.

    if ($oldversion < 2013030600) {
        upgrade_set_timeout(60*20);

        // Some assignments (upgraded from 2.2 assignment) have duplicate entries in the assign_submission
        // and assign_grades tables for a single user. This needs to be cleaned up before we can add the unique indexes
        // below.

        // Only do this cleanup if the attempt number field has not been added to the table yet.
        $table = new xmldb_table('assign_submission');
        $field = new xmldb_field('attemptnumber', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0', 'groupid');
        if (!$dbman->field_exists($table, $field)) {
            // OK safe to cleanup duplicates here.

            $sql = 'SELECT assignment, userid, groupid from {assign_submission} ' .
                   'GROUP BY assignment, userid, groupid HAVING (count(id) > 1)';
            $badrecords = $DB->get_recordset_sql($sql);

            foreach ($badrecords as $badrecord) {
                $params = array('userid'=>$badrecord->userid,
                                'groupid'=>$badrecord->groupid,
                                'assignment'=>$badrecord->assignment);
                $duplicates = $DB->get_records('assign_submission', $params, 'timemodified DESC', 'id, timemodified');
                if ($duplicates) {
                    // Take the first (last updated) entry out of the list so it doesn't get deleted.
                    $valid = array_shift($duplicates);
                    $deleteids = array();
                    foreach ($duplicates as $duplicate) {
                        $deleteids[] = $duplicate->id;
                    }

                    list($sqlids, $sqlidparams) = $DB->get_in_or_equal($deleteids);
                    $DB->delete_records_select('assign_submission', 'id ' . $sqlids, $sqlidparams);
                }
            }

            $badrecords->close();
        }

        // Same cleanup required for assign_grades
        // Only do this cleanup if the attempt number field has not been added to the table yet.
        $table = new xmldb_table('assign_grades');
        $field = new xmldb_field('attemptnumber', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0', 'grade');
        if (!$dbman->field_exists($table, $field)) {
            // OK safe to cleanup duplicates here.

            $sql = 'SELECT assignment, userid from {assign_grades} GROUP BY assignment, userid HAVING (count(id) > 1)';
            $badrecords = $DB->get_recordset_sql($sql);

            foreach ($badrecords as $badrecord) {
                $params = array('userid'=>$badrecord->userid,
                                'assignment'=>$badrecord->assignment);
                $duplicates = $DB->get_records('assign_grades', $params, 'timemodified DESC', 'id, timemodified');
                if ($duplicates) {
                    // Take the first (last updated) entry out of the list so it doesn't get deleted.
                    $valid = array_shift($duplicates);
                    $deleteids = array();
                    foreach ($duplicates as $duplicate) {
                        $deleteids[] = $duplicate->id;
                    }

                    list($sqlids, $sqlidparams) = $DB->get_in_or_equal($deleteids);
                    $DB->delete_records_select('assign_grades', 'id ' . $sqlids, $sqlidparams);
                }
            }

            $badrecords->close();
        }

        // Define table assign_user_flags to be created.
        $table = new xmldb_table('assign_user_flags');

        // Adding fields to table assign_user_flags.
        $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);
        $table->add_field('userid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');
        $table->add_field('assignment', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');
        $table->add_field('locked', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');
        $table->add_field('mailed', XMLDB_TYPE_INTEGER, '4', null, XMLDB_NOTNULL, null, '0');
        $table->add_field('extensionduedate', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');

        // Adding keys to table assign_user_flags.
        $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
        $table->add_key('userid', XMLDB_KEY_FOREIGN, array('userid'), 'user', array('id'));
        $table->add_key('assignment', XMLDB_KEY_FOREIGN, array('assignment'), 'assign', array('id'));

        // Adding indexes to table assign_user_flags.
        $table->add_index('mailed', XMLDB_INDEX_NOTUNIQUE, array('mailed'));

        // Conditionally launch create table for assign_user_flags.
        if (!$dbman->table_exists($table)) {
            $dbman->create_table($table);

            // Copy the flags from the old table to the new one.
            $sql = 'INSERT INTO {assign_user_flags}
                        (assignment, userid, locked, mailed, extensionduedate)
                    SELECT assignment, userid, locked, mailed, extensionduedate
                    FROM {assign_grades}';
            $DB->execute($sql);
        }

        // And delete the old columns.
        // Define index mailed (not unique) to be dropped form assign_grades.
        $table = new xmldb_table('assign_grades');
        $index = new xmldb_index('mailed', XMLDB_INDEX_NOTUNIQUE, array('mailed'));

        // Conditionally launch drop index mailed.
        if ($dbman->index_exists($table, $index)) {
            $dbman->drop_index($table, $index);
        }

        // Define field locked to be dropped from assign_grades.
        $table = new xmldb_table('assign_grades');
        $field = new xmldb_field('locked');

        // Conditionally launch drop field locked.
        if ($dbman->field_exists($table, $field)) {
            $dbman->drop_field($table, $field);
        }

        // Define field mailed to be dropped from assign_grades.
        $table = new xmldb_table('assign_grades');
        $field = new xmldb_field('mailed');

        // Conditionally launch drop field mailed.
        if ($dbman->field_exists($table, $field)) {
            $dbman->drop_field($table, $field);
        }

        // Define field extensionduedate to be dropped from assign_grades.
        $table = new xmldb_table('assign_grades');
        $field = new xmldb_field('extensionduedate');

        // Conditionally launch drop field extensionduedate.
        if ($dbman->field_exists($table, $field)) {
            $dbman->drop_field($table, $field);
        }

        // Define field attemptreopenmethod to be added to assign.
        $table = new xmldb_table('assign');
        $field = new xmldb_field('attemptreopenmethod', XMLDB_TYPE_CHAR, '10', null,
                                 XMLDB_NOTNULL, null, 'none', 'revealidentities');

        // Conditionally launch add field attemptreopenmethod.
        if (!$dbman->field_exists($table, $field)) {
            $dbman->add_field($table, $field);
        }

        // Define field maxattempts to be added to assign.
        $table = new xmldb_table('assign');
        $field = new xmldb_field('maxattempts', XMLDB_TYPE_INTEGER, '6', null, XMLDB_NOTNULL, null, '-1', 'attemptreopenmethod');

        // Conditionally launch add field maxattempts.
        if (!$dbman->field_exists($table, $field)) {
            $dbman->add_field($table, $field);
        }

        // Define field attemptnumber to be added to assign_submission.
        $table = new xmldb_table('assign_submission');
        $field = new xmldb_field('attemptnumber', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0', 'groupid');

        // Conditionally launch add field attemptnumber.
        if (!$dbman->field_exists($table, $field)) {
            $dbman->add_field($table, $field);
        }

        // Define index attemptnumber (not unique) to be added to assign_submission.
        $table = new xmldb_table('assign_submission');
        $index = new xmldb_index('attemptnumber', XMLDB_INDEX_NOTUNIQUE, array('attemptnumber'));
        // Conditionally launch add index attemptnumber.
        if (!$dbman->index_exists($table, $index)) {
            $dbman->add_index($table, $index);
        }

        // Define field attemptnumber to be added to assign_grades.
        $table = new xmldb_table('assign_grades');
        $field = new xmldb_field('attemptnumber', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0', 'grade');

        // Conditionally launch add field attemptnumber.
        if (!$dbman->field_exists($table, $field)) {
            $dbman->add_field($table, $field);
        }

        // Define index attemptnumber (not unique) to be added to assign_grades.
        $table = new xmldb_table('assign_grades');
        $index = new xmldb_index('attemptnumber', XMLDB_INDEX_NOTUNIQUE, array('attemptnumber'));

        // Conditionally launch add index attemptnumber.
        if (!$dbman->index_exists($table, $index)) {
            $dbman->add_index($table, $index);
        }

        // Define index uniqueattemptsubmission (unique) to be added to assign_submission.
        $table = new xmldb_table('assign_submission');
        $index = new xmldb_index('uniqueattemptsubmission',
                                 XMLDB_INDEX_UNIQUE,
                                 array('assignment', 'userid', 'groupid', 'attemptnumber'));

        // Conditionally launch add index uniqueattempt.
        if (!$dbman->index_exists($table, $index)) {
            $dbman->add_index($table, $index);
        }

        // Define index uniqueattemptgrade (unique) to be added to assign_grades.
        $table = new xmldb_table('assign_grades');
        $index = new xmldb_index('uniqueattemptgrade', XMLDB_INDEX_UNIQUE, array('assignment', 'userid', 'attemptnumber'));

        // Conditionally launch add index uniqueattempt.
        if (!$dbman->index_exists($table, $index)) {
            $dbman->add_index($table, $index);
        }

        // Module assign savepoint reached.
        upgrade_mod_savepoint(true, 2013030600, 'assign');
    }

    // Moodle v2.5.0 release upgrade line.
    // Put any upgrade step following this.

    if ($oldversion < 2013061101) {
        // Define field markingworkflow to be added to assign.
        $table = new xmldb_table('assign');
        $field = new xmldb_field('markingworkflow', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL, null, '0', 'maxattempts');

        // Conditionally launch add field markingworkflow.
        if (!$dbman->field_exists($table, $field)) {
            $dbman->add_field($table, $field);
        }

        // Define field markingallocation to be added to assign.
        $field = new xmldb_field('markingallocation', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL, null, '0', 'markingworkflow');
        if (!$dbman->field_exists($table, $field)) {
            $dbman->add_field($table, $field);
        }

        // Define field workflowstate to be added to assign_grades.
        $table = new xmldb_table('assign_user_flags');
        $field = new xmldb_field('workflowstate', XMLDB_TYPE_CHAR, '20', null, null, null, null, 'extensionduedate');

        // Conditionally launch add field workflowstate.
        if (!$dbman->field_exists($table, $field)) {
            $dbman->add_field($table, $field);
        }

        // Define field allocatedmarker to be added to assign_grades.
        $field = new xmldb_field('allocatedmarker', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0', 'workflowstate');
        // Conditionally launch add field workflowstate.
        if (!$dbman->field_exists($table, $field)) {
            $dbman->add_field($table, $field);
        }
        upgrade_mod_savepoint(true, 2013061101, 'assign');
    }

    // Moodle v2.6.0 release upgrade line.
    // Put any upgrade step following this.

    if ($oldversion < 2014010801) {

        // Define field sendstudentnotifications to be added to assign.
        $table = new xmldb_table('assign');
        $field = new xmldb_field('sendstudentnotifications',
                                 XMLDB_TYPE_INTEGER,
                                 '2',
                                 null,
                                 XMLDB_NOTNULL,
                                 null,
                                 '1',
                                 'markingallocation');

        // Conditionally launch add field sendstudentnotifications.
        if (!$dbman->field_exists($table, $field)) {
            $dbman->add_field($table, $field);
        }

        // Assign savepoint reached.
        upgrade_mod_savepoint(true, 2014010801, 'assign');
    }

    // Moodle v2.7.0 release upgrade line.
    // Put any upgrade step following this.

    if ($oldversion < 2014051201) {

        // Cleanup bad database records where assignid is missing.

        $DB->delete_records('assign_user_mapping', array('assignment'=>0));
        // Assign savepoint reached.
        upgrade_mod_savepoint(true, 2014051201, 'assign');
    }
    if ($oldversion < 2014072400) {

        // Add "latest" column to submissions table to mark the latest attempt.
        $table = new xmldb_table('assign_submission');
        $field = new xmldb_field('latest', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL, null, '0', 'attemptnumber');

        // Conditionally launch add field latest.
        if (!$dbman->field_exists($table, $field)) {
            $dbman->add_field($table, $field);
        }

        // Assign savepoint reached.
        upgrade_mod_savepoint(true, 2014072400, 'assign');
    }
    if ($oldversion < 2014072401) {

         // Define index latestattempt (not unique) to be added to assign_submission.
        $table = new xmldb_table('assign_submission');
        $index = new xmldb_index('latestattempt', XMLDB_INDEX_NOTUNIQUE, array('assignment', 'userid', 'groupid', 'latest'));

        // Conditionally launch add index latestattempt.
        if (!$dbman->index_exists($table, $index)) {
            $dbman->add_index($table, $index);
        }

        // Assign savepoint reached.
        upgrade_mod_savepoint(true, 2014072401, 'assign');
    }
    if ($oldversion < 2014072405) {

        // Prevent running this multiple times.

        $countsql = 'SELECT COUNT(id) FROM {assign_submission} WHERE latest = ?';

        $count = $DB->count_records_sql($countsql, array(1));
        if ($count == 0) {

            // Mark the latest attempt for every submission in mod_assign.
            $maxattemptsql = 'SELECT assignment, userid, groupid, max(attemptnumber) AS maxattempt
                                FROM {assign_submission}
                            GROUP BY assignment, groupid, userid';

            $maxattemptidssql = 'SELECT souter.id
                                   FROM {assign_submission} souter
                                   JOIN (' . $maxattemptsql . ') sinner
                                     ON souter.assignment = sinner.assignment
                                    AND souter.userid = sinner.userid
                                    AND souter.groupid = sinner.groupid
                                    AND souter.attemptnumber = sinner.maxattempt';

            // We need to avoid using "WHERE ... IN(SELECT ...)" clause with MySQL for performance reason.
            // TODO MDL-29589 Remove this dbfamily exception when implemented.
            if ($DB->get_dbfamily() === 'mysql') {
                $params = array('latest' => 1);
                $sql = 'UPDATE {assign_submission}
                    INNER JOIN (' . $maxattemptidssql . ') souterouter ON souterouter.id = {assign_submission}.id
                           SET latest = :latest';
                $DB->execute($sql, $params);
            } else {
                $select = 'id IN(' . $maxattemptidssql . ')';
                $DB->set_field_select('assign_submission', 'latest', 1, $select);
            }

            // Look for grade records with no submission record.
            // This is when a teacher has marked a student before they submitted anything.
            $records = $DB->get_records_sql('SELECT g.id, g.assignment, g.userid
                                               FROM {assign_grades} g
                                          LEFT JOIN {assign_submission} s
                                                 ON s.assignment = g.assignment
                                                AND s.userid = g.userid
                                              WHERE s.id IS NULL');
            $submissions = array();
            foreach ($records as $record) {
                $submission = new stdClass();
                $submission->assignment = $record->assignment;
                $submission->userid = $record->userid;
                $submission->status = 'new';
                $submission->groupid = 0;
                $submission->latest = 1;
                $submission->timecreated = time();
                $submission->timemodified = time();
                array_push($submissions, $submission);
            }

            $DB->insert_records('assign_submission', $submissions);
        }

        // Assign savepoint reached.
        upgrade_mod_savepoint(true, 2014072405, 'assign');
    }

    // Moodle v2.8.0 release upgrade line.
    // Put any upgrade step following this.

    if ($oldversion < 2014122600) {
        // Delete any entries from the assign_user_flags and assign_user_mapping that are no longer required.
        if ($DB->get_dbfamily() === 'mysql') {
            $sql1 = "DELETE {assign_user_flags}
                       FROM {assign_user_flags}
                  LEFT JOIN {assign}
                         ON {assign_user_flags}.assignment = {assign}.id
                      WHERE {assign}.id IS NULL";

            $sql2 = "DELETE {assign_user_mapping}
                       FROM {assign_user_mapping}
                  LEFT JOIN {assign}
                         ON {assign_user_mapping}.assignment = {assign}.id
                      WHERE {assign}.id IS NULL";
        } else {
            $sql1 = "DELETE FROM {assign_user_flags}
                WHERE NOT EXISTS (
                          SELECT 'x' FROM {assign}
                           WHERE {assign_user_flags}.assignment = {assign}.id)";

            $sql2 = "DELETE FROM {assign_user_mapping}
                WHERE NOT EXISTS (
                          SELECT 'x' FROM {assign}
                           WHERE {assign_user_mapping}.assignment = {assign}.id)";
        }

        $DB->execute($sql1);
        $DB->execute($sql2);

        upgrade_mod_savepoint(true, 2014122600, 'assign');
    }

    if ($oldversion < 2015022300) {

        // Define field preventsubmissionnotingroup to be added to assign.
        $table = new xmldb_table('assign');
        $field = new xmldb_field('preventsubmissionnotingroup',
            XMLDB_TYPE_INTEGER,
            '2',
            null,
            XMLDB_NOTNULL,
            null,
            '0',
            'sendstudentnotifications');

        // Conditionally launch add field preventsubmissionnotingroup.
        if (!$dbman->field_exists($table, $field)) {
            $dbman->add_field($table, $field);
        }

        // Assign savepoint reached.
        upgrade_mod_savepoint(true, 2015022300, 'assign');
    }

    // Moodle v2.9.0 release upgrade line.
    // Put any upgrade step following this.

    // Moodle v3.0.0 release upgrade line.
    // Put any upgrade step following this.

    return true;
}


text:
* Fixed the unexpected behaviour when decorating the signature heatmap with colData elements

## Other notes

* Some alignments of the UI elements in the `ideal()` app, to harmonize the content of the page
* Updated the icons in the user interface to match recent changes in the names from FontAwesome

# ideal 1.16.0

## New features

* It is now possible to export the processed data (count data, results, functional enrichment table) into a combined list object, which can be seamlessly fed into `GeneTonic` (http://bioconductor.org/packages/release/bioc/html/GeneTonic.html).
* Adjusted the behavior for the modeling with LRT, with extra notifications to inform the user on how to make the most out of the functionality.

## Other notes

* The manuscript of `ideal` is now published in BMC Bioinformatics! The citation file has been updated accordingly.
* A full round of `styler` has been applied to the codebase.

# ideal 1.14.0

## Other notes

* Replaced dependency from `d3heatmap` with the functionality of `heatmaply`
* Additional notifications are returned when closing the app while saving the state to the R environment - both in the console as a `message`, and in the UI via `showNotification`
* The vignette and the tour contain a section about the format required to run `ideal` correctly
* The vignette also indicates some exemplary steps after exporting the values to the R environment, showcasing how to perform additional functional enrichment analyses e.g. via `fgsea` or `gprofiler2`

# ideal 1.12.0

## New features

* Implemented a series of gentle fail mechanisms to avoid abrupt crashing of the app if the expected objects or formats are not provided

## Other notes

* Alignments of UI elements have been adjusted
* Updated citation info - the preprint for `ideal`, "ideal: an R/Bioconductor package for Interactive Differential Expression Analysis", is now published at bioRxiv, https://doi.org/10.1101/2020.01.10.901652
* Data transformation (for table viewing and visualizations, where homoscedastic data is expected) is now taken care of with the variance stabilizing transformation (`vst`), instead of the `rlog`
* The installation information in the `README.md` includes a troubleshooting section to solve some common issues one might encounter
* Added a collapsible element in the Data Setup panel, to remind users to perform proper Exploratory Data Analysis (e.g. with `pcaExplorer`) before testing for Differential Expression

# ideal 1.10.0

## New features

* `ggplotCounts` gains a new parameter, `labels_repel`, to control the placement of the different labels in the plot - this can be useful when a large number of samples is available

## Bug fixes

* Fixed an error in the initialization of the app due to a new behavior introduced by `shinyAce` in version >= 0.4.0 - occurred in the same way as for `pcaExplorer`

## Other notes

* Better class checks via `is(...)` as per `BiocCheck` suggestion

# ideal 1.8.0

## New features

* `plot_ma` gains an additional parameter, `labels_repel`, for better placing the labels on the features to mark
* The pairwise correlation plots can now use logarithmic scale in the axes, use smaller subsets of the data for quicker inspection, and resizes the correlation info proportionally to its intensity
* The id types can now be chosen among the `keytypes` of the corresponding annotation packages (which still need to be installed when `ideal` is launched). Other input fields that specify id types also behave in a similar manner (e.g. in the Signature Explorer tab). This caused a problem for scenarios where common id types such as `ENSEMBL` are not available, like in Arabidopsis (where ids are provided often as `TAIR`) - thanks to Marc Galland for picking this up in https://github.com/federicomarini/ideal/issues/1
* The Signatures Explorer tab also has a fully fledged tour for first-time users, together with a collapsible help panel to describe its functionality in brief
* The zoomed MA-plot gains a new widget to control the labels size for the names of the genes
* It is possible to export the input data together with the results in a combined `SummarizedExperiment` object, which can be seamlessly fed into `iSEE` (http://bioconductor.org/packages/release/bioc/html/iSEE.html).
  This leverages a new function, `wrapup_for_iSEE`, which is available and exported from `ideal`.

## Other notes

* An information box has been added to provide detailed information on the required input formats
* Added notification to specify how to install the airway package for demonstration purposes if not already available
* The Signatures Explorer tab is now displayed in a conditional panel, i.e. only when the required inputs are provided

# ideal 1.6.0

## New features

* Added extra diagnostic to results exploration (stratified pvalues histograms, schweder-spjotvoll plot)
* Added functionality for the tab Signatures Explorer: read in gmt files, and explore signatures for all/DE genes visually as heatmaps. The signatures can also be provided in the main call of the function as an argument, on top of uploading at runtime
* Different handling of the selection of ids/gene names, now not requiring anymore that the result is computed, but based on the dds object (and on the presence or not of the annotation object)

## Other notes

* Built project website via pkgdown, with customized reference structure
* Added a `NEWS.md` file to track changes to the package
* Updated the report template as well for including new functionality, and also updated vignette entry
* Correctly adding the resources to shinyBS, loaded via `.onLoad`
* Replaced the first tour structure and call
* New skin for the app, also with logo in the title header
* Instructions start collapsed for more compact main page
* Edited link in button to provide feedback, with subject specified

## Bug fixes

* Fixed behavior of rendering inline the content of the report - did not work properly for server deployed instances

# ideal 1.4.0

## New features

* Specified single go term selection for generating heatmaps of gene signatures
* Added support for logFC shrinkage, following the latest devels of DESeq2

## Bug fixes

* Corrected output for the vignette, as html_document2 is now deprecated
* Menus are back in the expanded form
* Fixed the behavior with addMLE

## Other notes

* Added further progress indicators to give feedback during lengthy steps
* Improved ggplotCounts for better scale display, using exact arg matching, defaulting to the transformed counts

# ideal 0.99.0

## New features

* Ready for Bioc submission
* Completed the news

# ideal 0.9.1

## New features

* Added Instructions fully from rendered version of the vignette to have available at runtime
* Added support for downloading all plots and tables

# ideal 0.9.0

## New features

* Interactive tours are covering now all tabs, with extensive walkthroughs for the user
* Added all screenshots to vignette

# ideal 0.6.2

## New features

* Interactive tours are now available, coded in external files
* Travis-CI is now supported

# ideal 0.6.0

## New features

* Added MA plot with extra custom list to avoid manual selection of many genes
* MA plot function now automatically supports subset of gene to be extra plotted
* Added documentation with roxygen to all functions
* Heatmap functions for genes annotated to a GO term as signature
* Template report also provided
* Full draft of vignette now available, working towards bioc submission
* Added textual help to all sections, with collapsible element
* Added proof of principle to have interactive tours based on rintrojs

# ideal 0.4.0

## New features

* Gene box info added, based on rentrez
* New look for MA plots and volcano plots

# ideal 0.3.0

## New features

* Restructuring of the folders done, package can be correctly installed, loaded - namespace, description are set up

# ideal 0.2.0

## New features

* Correct structure of the package

# ideal 0.1.0

## New features

* Package created!


text:
<?php

namespace Application\Migrations;

use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;

/**
 * Auto-generated Migration: Please modify to your needs!
 */
class Version20170125113220 extends AbstractMigration
{
    /**
     * @param Schema $schema
     */
    public function up(Schema $schema)
    {
        // this up() migration is auto-generated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');

        $this->addSql('ALTER TABLE insoles ALTER person_id DROP NOT NULL');
        $this->addSql('ALTER TABLE insoles ALTER appointment_id DROP NOT NULL');
        $this->addSql('ALTER TABLE services ALTER alias SET NOT NULL');
        $this->addSql('ALTER TABLE person_services ADD number INT DEFAULT 1');
        $this->addSql('ALTER TABLE appointments ADD flyer BOOLEAN DEFAULT FALSE');
    }

    /**
     * @param Schema $schema
     */
    public function down(Schema $schema)
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');

        $this->addSql('CREATE SCHEMA public');
        $this->addSql('ALTER TABLE services ALTER alias DROP NOT NULL');
        $this->addSql('ALTER TABLE insoles ALTER person_id SET NOT NULL');
        $this->addSql('ALTER TABLE insoles ALTER appointment_id SET NOT NULL');
        $this->addSql('ALTER TABLE person_services DROP number');
        $this->addSql('ALTER TABLE appointments DROP flyer');
    }
}


text:
require 'net/http'

module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    module Integrations #:nodoc:
      module Dwolla
        class Notification < ActiveMerchant::Billing::Integrations::Notification
          def complete?
            status == "Completed"
          end

          def status
            params["Status"]
          end

          def transaction_id
            params['TransactionId']
          end

          def item_id
            params['OrderId']
          end

          def currency
            "USD"
          end

          def gross
            params['Amount']
          end

          def error
            params['Message']
          end

          # Was this a test transaction?
          def test?
            params['TestMode']
          end

          def acknowledge
            true
          end
 private
          # Take the posted data and move the relevant data into a hash
          def parse(post)
            @raw = post.to_s
            json_post = JSON.parse(post)
            params.merge!(json_post)
          end
        end
      end
    end
  end
end


text:
OC.L10N.register(
    "dav",
    {
    "Contact birthdays" : "Contact birthdays",
    "User disabled" : "User disabled",
    "Personal" : "Personal",
    "Contacts" : "Contacts",
    "Technical details" : "Technical details",
    "Remote Address: %s" : "Remote Address: %s",
    "Request ID: %s" : "Request ID: %s"
},
"nplurals=2; plural=(n != 1);");


text:
const mongoose = require('mongoose');
const config = require('./../config');
const driver = require('./../db/mongoose');
mongoose.Promise = require('bluebird');

const logger = config.logger;

async function clean(dbUri) {
  await driver.connectToDatabase(dbUri);
  logger.info(`Cleaning up database ${dbUri}`);
  await mongoose.connection.db.dropDatabase();
  await mongoose.disconnect();
}

if (require.main === module) {
  const dbUri = config.dbUri;
  clean(dbUri);
}


text:
import re
import requests
import discord
import io
from datetime import datetime

_USER_ID_MATCH = re.compile(r"<@(\d+)>")

_EMOTE_ID_MATCH = re.compile(r"<:(.+?):(\d+)>")

py = "```py\n{}```"

xl = "```xl\n{}```"

diff = "```diff\n{}```"

def write_file(filename, contents):
    with open(filename, "w", encoding="utf8") as file:
        for item in contents:
            file.write(str(item))
            file.write("\n")

def download_file(url, destination):
    req = requests.get(url)
    file = open(destination, "wb")
    for chunk in req.iter_content(100000):
        file.write(chunk)
    file.close()

def extract_emote_id(arg):
    match = _EMOTE_ID_MATCH.match(arg)
    if match:
        return str(match.group(2))

def get_avatar(user, animate=True):
    if user.avatar_url:
        avatar = user.avatar_url
    else:
        avatar = user.default_avatar_url
    if not animate:
        avatar = avatar.replace(".gif", ".png")
    return avatar

def make_message_embed(author, color, message, *, formatUser=False, useNick=False):
    if formatUser:
        name = str(author)
    elif useNick:
        name = author.display_name
    else:
        name = author.name
    embed = discord.Embed(color=color, description=message)
    embed.set_author(name=name, icon_url=get_avatar(author))
    return embed

def remove_html(arg):
    arg = arg.replace(""", "\"").replace("<br />", "").replace("[i]", "*").replace("[/i]", "*")
    arg = arg.replace("“", "\"").replace("”", "\"").replace("'", "'").replace("—", "—")
    arg = arg.replace("–", "–")
    return arg

def make_list_embed(fields):
    embed = discord.Embed(description="\u200b")
    for key, value in fields.items():
        embed.add_field(name=key, value=value, inline=True)
    return embed

def format_time(time):
    return time.strftime("%B %d, %Y at %I:%M:%S %p")

def convert_to_bool(arg):
    arg = str(arg).lower()
    if arg in ["yes", "y", "true", "t", "1", "enable", "on"]:
        return True
    elif arg in ["no", "n", "false", "f", "0", "disable", "off"]:
        return False
    else:
        raise ValueError

def strip_global_mentions(message, ctx=None):
    if ctx:
        perms = ctx.message.channel.permissions_for(ctx.message.author)
        if perms.mention_everyone:
            return message
    remove_everyone = re.compile(re.escape("@everyone"), re.IGNORECASE)
    remove_here = re.compile(re.escape("@here"), re.IGNORECASE)
    message = remove_everyone.sub("everyone", message)
    message = remove_here.sub("here", message)
    return message

def format_number(number):
    return "{:,d}".format(number)

def url_to_bytes(url):
    data = requests.get(url)
    content = io.BytesIO(data.content)
    filename = url.rsplit("/", 1)[-1]
    return {"content":content, "filename":filename}


text:
using System;
using System.Collections.Generic;
using System.IO;
using Newtonsoft.Json;

namespace BitcoinLite.Tests
{
	static class StringExtensions
	{
		public static string Clean(this string s)
		{
			return s.Replace("\t", "").Replace("\n", "").Replace("\r", "").Replace(" ", "");
		}
	}

	class JsonFile
	{
		public static IEnumerable<object[]> GetData(string fileName)
		{
			var basePath = AppDomain.CurrentDomain.BaseDirectory;
			using (var file = File.OpenText(Path.Combine(basePath, "_Resources", fileName)))
			{
				var serializer = new JsonSerializer();
				var array = (object[][])serializer.Deserialize(file, typeof (object[][]));
				return array;
			}
		}
	}
}