text:
'use strict';

var WeatherPresentation = module.exports = {};

var nconf = require('nconf');
var path = require('path');

nconf.file(path.resolve(__dirname, '../config/config.json'));

WeatherPresentation.baseURL = nconf.get('externalAPIConfig:baseURL');
WeatherPresentation.icoPath = nconf.get('externalAPIConfig:icoPath');

WeatherPresentation.presentWeatherItem = function presentWeatherItem(weatherBlob) {
  var main = weatherBlob && weatherBlob.main;
  var weather = weatherBlob && weatherBlob.weather[0];
  var json = {
    locationId: weatherBlob.id,
    time: weatherBlob.dt_txt,
    temp: main.temp,
    tempHigh: main.temp_max,
    tempLow: main.temp_min,
    humidity: main.humidity,
    description: weather.description,
    weatherIcon: WeatherPresentation.baseURL + WeatherPresentation.icoPath + weather.icon + '.png'
  }
  return json;
};

WeatherPresentation.presentWeatherList = function presentWeatherList(weatherList) {
  var json = {};
  json.weatherData = weatherList.map(WeatherPresentation.presentWeatherItem);
  return json;
};

WeatherPresentation.presentWeatherWithCity = function presentWeatherList(weatherData) {
  var weatherList = weatherData.list;
  var city = weatherData.city;
  var json = {
    city: {
      cityId: city.id,
      cityName: city.name,
      cityCountryCode: city.country
    }
  }
  json.weatherData = weatherList.map(WeatherPresentation.presentWeatherItem);
  return json;
};


text:
/**
 * Initialization function that validates environment
 * requirements.
 */
angular
  .module('material.core', [
    'ngAnimate',
    'material.core.animate',
    'material.core.layout',
    'material.core.interaction',
    'material.core.gestures',
    'material.core.theming'
  ])
  .config(MdCoreConfigure)
  .run(DetectNgTouch);

/**
 * Detect if the ng-Touch module is also being used.
 * Warn if detected.
 * @ngInject
 */
function DetectNgTouch($log, $injector) {
  if ($injector.has('$swipe')) {
    var msg = "" +
      "You are using the ngTouch module. \n" +
      "AngularJS Material already has mobile click, tap, and swipe support... \n" +
      "ngTouch is not supported with AngularJS Material!";
    $log.warn(msg);
  }
}

/**
 * @ngInject
 */
function MdCoreConfigure($provide, $mdThemingProvider) {

  $provide.decorator('$$rAF', ['$delegate', rAFDecorator]);
  $provide.decorator('$q', ['$delegate', qDecorator]);

  $mdThemingProvider.theme('default')
    .primaryPalette('indigo')
    .accentPalette('pink')
    .warnPalette('deep-orange')
    .backgroundPalette('grey');
}

/**
 * @ngInject
 */
function rAFDecorator($delegate) {
  /**
   * Use this to throttle events that come in often.
   * The throttled function will always use the *last* invocation before the
   * coming frame.
   *
   * For example, window resize events that fire many times a second:
   * If we set to use an raf-throttled callback on window resize, then
   * our callback will only be fired once per frame, with the last resize
   * event that happened before that frame.
   *
   * @param {function} cb function to debounce
   */
  $delegate.throttle = function(cb) {
    var queuedArgs, alreadyQueued, queueCb, context;
    return function debounced() {
      queuedArgs = arguments;
      context = this;
      queueCb = cb;
      if (!alreadyQueued) {
        alreadyQueued = true;
        $delegate(function() {
          queueCb.apply(context, Array.prototype.slice.call(queuedArgs));
          alreadyQueued = false;
        });
      }
    };
  };
  return $delegate;
}

/**
 * @ngInject
 */
function qDecorator($delegate) {
  /**
   * Adds a shim for $q.resolve for AngularJS version that don't have it,
   * so we don't have to think about it.
   *
   * via https://github.com/angular/angular.js/pull/11987
   */

  // TODO(crisbeto): this won't be necessary once we drop AngularJS 1.3
  if (!$delegate.resolve) {
    $delegate.resolve = $delegate.when;
  }
  return $delegate;
}

redpajama_set_name: RedPajamaGithub


text:
package ca.uhn.fhir.rest.server.provider.dstu2hl7org;

import static org.apache.commons.lang3.StringUtils.isBlank;
import static org.apache.commons.lang3.StringUtils.isNotBlank;

import java.util.*;

import org.hl7.fhir.instance.model.*;
import org.hl7.fhir.instance.model.Bundle.*;
import org.hl7.fhir.instance.model.api.*;

import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.context.api.BundleInclusionRule;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.valueset.BundleTypeEnum;
import ca.uhn.fhir.rest.api.Constants;
import ca.uhn.fhir.rest.api.IVersionSpecificBundleFactory;
import ca.uhn.fhir.util.ResourceReferenceInfo;

public class Dstu2Hl7OrgBundleFactory implements IVersionSpecificBundleFactory {

	private String myBase;
	private Bundle myBundle;
	private FhirContext myContext;

	public Dstu2Hl7OrgBundleFactory(FhirContext theContext) {
		myContext = theContext;
	}

	private void addResourcesForSearch(List<? extends IBaseResource> theResult) {
		List<IBaseResource> includedResources = new ArrayList<IBaseResource>();
		Set<IIdType> addedResourceIds = new HashSet<IIdType>();

		for (IBaseResource next : theResult) {
			if (next.getIdElement().isEmpty() == false) {
				addedResourceIds.add(next.getIdElement());
			}
		}

		for (IBaseResource nextBaseRes : theResult) {
			IDomainResource next = (IDomainResource) nextBaseRes;
			Set<String> containedIds = new HashSet<String>();
			for (IBaseResource nextContained : next.getContained()) {
				if (nextContained.getIdElement().isEmpty() == false) {
					containedIds.add(nextContained.getIdElement().getValue());
				}
			}

			List<IBaseReference> references = myContext.newTerser().getAllPopulatedChildElementsOfType(next,
					IBaseReference.class);
			do {
				List<IBaseResource> addedResourcesThisPass = new ArrayList<IBaseResource>();

				for (IBaseReference nextRef : references) {
					IBaseResource nextRes = (IBaseResource) nextRef.getResource();
					if (nextRes != null) {
						if (nextRes.getIdElement().hasIdPart()) {
							if (containedIds.contains(nextRes.getIdElement().getValue())) {
								// Don't add contained IDs as top level resources
								continue;
							}

							IIdType id = nextRes.getIdElement();
							if (id.hasResourceType() == false) {
								String resName = myContext.getResourceDefinition(nextRes).getName();
								id = id.withResourceType(resName);
							}

							if (!addedResourceIds.contains(id)) {
								addedResourceIds.add(id);
								addedResourcesThisPass.add(nextRes);
							}

						}
					}
				}

				// Linked resources may themselves have linked resources
				references = new ArrayList<IBaseReference>();
				for (IBaseResource iResource : addedResourcesThisPass) {
					List<IBaseReference> newReferences = myContext.newTerser().getAllPopulatedChildElementsOfType(iResource,
							IBaseReference.class);
					references.addAll(newReferences);
				}

				includedResources.addAll(addedResourcesThisPass);

			} while (references.isEmpty() == false);

			BundleEntryComponent entry = myBundle.addEntry().setResource((Resource) next);
			populateBundleEntryFullUrl(next, entry);
		}

		/*
		 * Actually add the resources to the bundle
		 */
		for (IBaseResource next : includedResources) {
			BundleEntryComponent entry = myBundle.addEntry();
			entry.setResource((Resource) next).getSearch().setMode(SearchEntryMode.INCLUDE);
			populateBundleEntryFullUrl(next, entry);
		}
	}

	@Override
	public void addResourcesToBundle(List<IBaseResource> theResult, BundleTypeEnum theBundleType, String theServerBase,
			BundleInclusionRule theBundleInclusionRule, Set<Include> theIncludes) {
		ensureBundle();

		List<IBaseResource> includedResources = new ArrayList<IBaseResource>();
		Set<IIdType> addedResourceIds = new HashSet<IIdType>();

		for (IBaseResource next : theResult) {
			if (next.getIdElement().isEmpty() == false) {
				addedResourceIds.add(next.getIdElement());
			}
		}

		for (IBaseResource next : theResult) {

			List<? extends IAnyResource> contained;
			if (next instanceof IDomainResource) {
				IDomainResource nextDomain = (IDomainResource) next;
				contained = nextDomain.getContained();
			} else {
				contained = Collections.emptyList();
			}

			Set<String> containedIds = new HashSet<String>();
			for (IAnyResource nextContained : contained) {
				if (nextContained.getId().isEmpty() == false) {
					containedIds.add(nextContained.getIdElement().getValue());
				}
			}

			List<ResourceReferenceInfo> references = myContext.newTerser().getAllResourceReferences(next);
			do {
				List<IBaseResource> addedResourcesThisPass = new ArrayList<IBaseResource>();

				for (ResourceReferenceInfo nextRefInfo : references) {
					if (!theBundleInclusionRule.shouldIncludeReferencedResource(nextRefInfo, theIncludes))
						continue;

					IBaseResource nextRes = (IBaseResource) nextRefInfo.getResourceReference().getResource();
					if (nextRes != null) {
						if (nextRes.getIdElement().hasIdPart()) {
							if (containedIds.contains(nextRes.getIdElement().getValue())) {
								// Don't add contained IDs as top level resources
								continue;
							}

							IdType id = (IdType) nextRes.getIdElement();
							if (id.hasResourceType() == false) {
								String resName = myContext.getResourceDefinition(nextRes).getName();
								id = id.withResourceType(resName);
							}

							if (!addedResourceIds.contains(id)) {
								addedResourceIds.add(id);
								addedResourcesThisPass.add(nextRes);
							}

						}
					}
				}

				includedResources.addAll(addedResourcesThisPass);

				// Linked resources may themselves have linked resources
				references = new ArrayList<ResourceReferenceInfo>();
				for (IBaseResource iResource : addedResourcesThisPass) {
					List<ResourceReferenceInfo> newReferences = myContext.newTerser().getAllResourceReferences(iResource);
					references.addAll(newReferences);
				}
			} while (references.isEmpty() == false);

			BundleEntryComponent entry = myBundle.addEntry().setResource((Resource) next);
			populateBundleEntryFullUrl(next, entry);

			// BundleEntrySearchModeEnum searchMode =
			// ResourceMetadataKeyEnum.ENTRY_SEARCH_MODE.get(next);
			// if (searchMode != null) {
			// entry.getSearch().getModeElement().setValue(searchMode.getCode());
			// }
		}

		/*
		 * Actually add the resources to the bundle
		 */
		for (IBaseResource next : includedResources) {
			myBundle.addEntry().setResource((Resource) next).getSearch().setMode(SearchEntryMode.INCLUDE);
		}

	}

	@Override
	public void addRootPropertiesToBundle(String theAuthor, String theServerBase, String theLinkSelf, String theLinkPrev, String theLinkNext,
			Integer theTotalResults, BundleTypeEnum theBundleType, IPrimitiveType<Date> theLastUpdated) {
		ensureBundle();

		if (isBlank(myBundle.getId())) {
			myBundle.setId(UUID.randomUUID().toString());
		}

		if (myBundle.getMeta().getLastUpdated() == null) {
			InstantType instantType = new InstantType();
			instantType.setValueAsString(theLastUpdated.getValueAsString());
			myBundle.getMeta().setLastUpdatedElement(instantType);
		}

		if (!hasLink(Constants.LINK_SELF, myBundle) && isNotBlank(theLinkSelf)) {
			myBundle.addLink().setRelation(Constants.LINK_SELF).setUrl(theLinkSelf);
		}
		if (!hasLink(Constants.LINK_NEXT, myBundle) && isNotBlank(theLinkNext)) {
			myBundle.addLink().setRelation(Constants.LINK_NEXT).setUrl(theLinkNext);
		}
		if (!hasLink(Constants.LINK_SELF, myBundle) && isNotBlank(theLinkPrev)) {
			myBundle.addLink().setRelation(Constants.LINK_PREVIOUS).setUrl(theLinkPrev);
		}

		myBase = theServerBase;

		if (myBundle.getTypeElement().isEmpty() && theBundleType != null) {
			myBundle.getTypeElement().setValueAsString(theBundleType.getCode());
		}

		if (myBundle.getTotalElement().isEmpty() && theTotalResults != null) {
			myBundle.getTotalElement().setValue(theTotalResults);
		}
	}

	private void ensureBundle() {
		if (myBundle == null) {
			myBundle = new Bundle();
		}
	}

	@Override
	public IBaseResource getResourceBundle() {
		return myBundle;
	}

	private boolean hasLink(String theLinkType, Bundle theBundle) {
		for (BundleLinkComponent next : theBundle.getLink()) {
			if (theLinkType.equals(next.getRelation())) {
				return true;
			}
		}
		return false;
	}

	@Override
	public void initializeBundleFromResourceList(String theAuthor, List<? extends IBaseResource> theResources,
			String theServerBase, String theCompleteUrl, int theTotalResults, BundleTypeEnum theBundleType) {
		ensureBundle();

		myBundle.setId(UUID.randomUUID().toString());

		myBundle.getMeta().setLastUpdatedElement(InstantType.withCurrentTime());

		myBundle.addLink().setRelation(Constants.LINK_FHIR_BASE).setUrl(theServerBase);
		myBundle.addLink().setRelation(Constants.LINK_SELF).setUrl(theCompleteUrl);
		myBundle.getTypeElement().setValueAsString(theBundleType.getCode());

		if (theBundleType.equals(BundleTypeEnum.TRANSACTION)) {
			for (IBaseResource nextBaseRes : theResources) {
				IBaseResource next = (IBaseResource) nextBaseRes;
				BundleEntryComponent nextEntry = myBundle.addEntry();

				nextEntry.setResource((Resource) next);
				if (next.getIdElement().isEmpty()) {
					nextEntry.getRequest().setMethod(HTTPVerb.POST);
				} else {
					nextEntry.getRequest().setMethod(HTTPVerb.PUT);
					if (next.getIdElement().isAbsolute()) {
						nextEntry.getRequest().setUrl(next.getIdElement().getValue());
					} else {
						String resourceType = myContext.getResourceDefinition(next).getName();
						nextEntry.getRequest().setUrl(new IdType(theServerBase, resourceType, next.getIdElement().getIdPart(),
								next.getIdElement().getVersionIdPart()).getValue());
					}
				}
			}
		} else {
			addResourcesForSearch(theResources);
		}

		myBundle.getTotalElement().setValue(theTotalResults);
	}

	@Override
	public void initializeWithBundleResource(IBaseResource theBundle) {
		myBundle = (Bundle) theBundle;
	}

	private void populateBundleEntryFullUrl(IBaseResource next, BundleEntryComponent entry) {
		if (next.getIdElement().hasBaseUrl()) {
			entry.setFullUrl(next.getIdElement().toVersionless().getValue());
		} else {
			if (isNotBlank(myBase) && next.getIdElement().hasIdPart()) {
				IIdType id = next.getIdElement().toVersionless();
				id = id.withServerBase(myBase, myContext.getResourceDefinition(next).getName());
				entry.setFullUrl(id.getValue());
			}
		}
	}

	@Override
	public List<IBaseResource> toListOfResources() {
		ArrayList<IBaseResource> retVal = new ArrayList<IBaseResource>();
		for (BundleEntryComponent next : myBundle.getEntry()) {
			if (next.getResource() != null) {
				retVal.add(next.getResource());
			} else if (next.getResponse().getLocationElement().isEmpty() == false) {
				IdType id = new IdType(next.getResponse().getLocation());
				String resourceType = id.getResourceType();
				if (isNotBlank(resourceType)) {
					IBaseResource res = (IBaseResource) myContext.getResourceDefinition(resourceType).newInstance();
					res.setId(id);
					retVal.add(res);
				}
			}
		}
		return retVal;
	}

}


text:
class AdminAccessRequired < Merb::ControllerExceptions::Forbidden; end

class Exceptions < Merb::Controller
  def admin_access_required
    render :layout => nil
  end
end


text:
'use strict';

import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation';
import {ICommandService} from 'vs/platform/commands/common/commands';
import {IContextKeyService} from 'vs/platform/contextkey/common/contextkey';
import * as editorCommon from 'vs/editor/common/editorCommon';
import {ICodeEditorService} from 'vs/editor/common/services/codeEditorService';
import {CodeEditorWidget} from 'vs/editor/browser/widget/codeEditorWidget';

export class CodeEditor extends CodeEditorWidget {

	constructor(
		domElement:HTMLElement,
		options:editorCommon.IEditorOptions,
		@IInstantiationService instantiationService: IInstantiationService,
		@ICodeEditorService codeEditorService: ICodeEditorService,
		@ICommandService commandService: ICommandService,
		@IContextKeyService contextKeyService: IContextKeyService
	) {
		super(domElement, options, instantiationService, codeEditorService, commandService, contextKeyService);
	}

}


text:
require File.expand_path('../../../spec_helper', __FILE__)

ruby_version_is "1.9" do
  describe "Symbol#encoding" do
    it "needs to be reviewed for spec completeness"
  end
end


text:
import m from 'mithril';
import mq from 'mithril-query';
import mr from 'mithril-node-render';
import { ExploreSearchFilterSelect } from '../../src/c/explore/explore-search-filter-select';

describe('ExploreFilterSelect', () => {

    describe('view', () => {

        const values = [
            {
                label: 'First Name',
                value: 'first_value'
            },
            {
                label: 'Second Name',
                value: 'second_value'
            },
        ];

        let currentValue = null;

        /** @type {ExploreFilterAttrs} */
        const attrs = {
            onSearch: (searchText) => {},
            onSelect: (item) => currentValue = item,
            selectedItem: (item) => currentValue,
            foundItems: () => values,
            noneSelected: 'NONE_SELECTED',
            mobileLabel: 'MOBILE_LABEL',
            itemToString: (item) => item.label,
            isLoading: () => false,
        };

        let component = null;
        let rawComponent = null;

        beforeEach(() => {
            rawComponent = m(ExploreSearchFilterSelect, attrs);
            component = mq(rawComponent);
        });

        it('should init diplaying none selected label', () => {
            component.should.have(`.explore-span-filter-name > .inline-block:contains("${attrs.noneSelected}")`);
        });

        it('should display the selection of values', () => {
            const event = new Event('click');
            component.click('.explore-span-filter', event);
            component.should.have(`a.fontsize-smallest.link-hidden-light:contains("${values[0].label}")`);
            component.should.have(`a.fontsize-smallest.link-hidden-light:contains("${values[1].label}")`);
        });

        it('should select other values', () => {
            component.click('.explore-span-filter', new Event('click'));
            component.click(`a.fontsize-smallest.link-hidden-light:contains("${values[0].label}")`,  new Event('click'));
            component.should.have(`.explore-span-filter-name > .inline-block:contains("${values[0].label}")`);
        });

        it('should clear selected value', () => {
            currentValue = null;
            component.click('.explore-span-filter', new Event('click'));
            component.click(`a.fontsize-smallest.link-hidden-light:contains("${values[0].label}")`,  new Event('click'));
            component.should.not.have(`a.fontsize-smallest.link-hidden-light`);
            expect(currentValue.value).toBe(values[0].value);
            component.click('.inline-block.far.fa-times', new Event('click'));
            component.should.have(`.explore-span-filter-name > .inline-block:contains("${attrs.noneSelected}")`);
        });

        it('should display none selected when search don\'t find any result and select it', () => {
            currentValue = null;
            component.click('.explore-span-filter', new Event('click'));
            component.click(`a.fontsize-smallest.link-hidden-light:contains("${values[0].label}")`,  new Event('click'));
            component.should.not.have(`a.fontsize-smallest.link-hidden-light`);
            expect(currentValue.value).toBe(values[0].value);
            attrs.foundItems = () => [];
            component.click('.explore-span-filter', new Event('click'));
            component.should.have(`a.fontsize-smallest.link-hidden-light:contains("${attrs.noneSelected}")`);
            component.click(`a.fontsize-smallest.link-hidden-light:contains("${attrs.noneSelected}")`, new Event('click'));
            component.should.have(`.explore-span-filter-name > .inline-block:contains("${attrs.noneSelected}")`);
            component.should.not.have(`a.fontsize-smallest.link-hidden-light`);
        });

        it('should display loader when load time of search delays', () => {
            currentValue = null;
            attrs.foundItems = () => [];
            attrs.isLoading = () => true;
            component.click('.explore-span-filter', new Event('click'));
            component.should.not.have(`a.fontsize-smallest.link-hidden-light`);
            component.should.have('.u-text-center.u-margintop-30.u-marginbottom-30 > img[alt="Loader"]');
        });

    });

});


text:
void RenderModel(FBModel *pModel, bool useMaterials, bool bindColor, const bool recursive);
void DrawSceneModel(FBModel *pModel);

///////////////////////////////////////////////////////////////////////////
// work with property UI browser

void PropertiesClearAll(FBBrowsingProperty *pProperty);
void PropertiesAddExclusive(FBBrowsingProperty *pProperty, FBPlug *pPlug);
void PropertiesAdd(FBBrowsingProperty *pProperty, FBPlug *pPlug);

void PropertyCopy( FBPropertyAnimatableVector4d &to, FBPropertyAnimatableVector4d &from );
void PropertyCopy( FBPropertyAnimatableColor &to, FBPropertyAnimatableColor &from );
void PropertyCopy( FBPropertyAnimatableColorAndAlpha &to, FBPropertyAnimatableColorAndAlpha &from );
void PropertyCopy( FBPropertyAnimatableDouble &to, FBPropertyAnimatableDouble &from );
void PropertyCopy( FBPropertyAnimatableBool &to, FBPropertyAnimatableBool &from );
void PropertyCopy( FBPropertyBool &to, FBPropertyBool &from );
void PropertyCopy( FBPropertyInt &to, FBPropertyInt &from );
void PropertyCopy( FBPropertyDouble &to, FBPropertyDouble &from );

//////////////////////////////////////////////////////////////////////////


text:
package org.opensocial.android;

import android.app.AlertDialog;
import android.app.ListActivity;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import net.oauth.OAuthException;

import org.opensocial.auth.OAuth3LeggedScheme;
import org.opensocial.providers.Provider;

import java.io.IOException;
import java.net.URISyntaxException;

public class OpenSocialChooserActivity extends ListActivity {

  private String scheme;
  private String[] providers;

  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    scheme = getIntent().getStringExtra(OpenSocialActivity.SCHEME);
    providers = getIntent().getStringArrayExtra(OpenSocialActivity.PROVIDERS);

    setListAdapter(new ArrayAdapter<String>(this, android.R.layout.
        simple_list_item_single_choice, providers));
  }

  @Override
  protected void onListItemClick(ListView listView, View view, int position,
      long id) {
    final String providerName = providers[position];
    final OAuth3LeggedScheme authScheme = getAuth(providerName);

    if (authScheme != null) {
      final AlertDialog alert = new AlertDialog.Builder(this).create();
      alert.setMessage("To get started, you will need to login to " + providerName);
      alert.setButton("Login", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int whichButton) {
          alert.dismiss();

          String url = null;
          try {
            url = authScheme.getAuthorizationUrl(scheme + "://");
            persistRequestToken(authScheme.getRequestToken(), providerName);
          } catch (IOException e) {
            throw new RuntimeException("Error occured fetching request token: " + e.getMessage(), e);
          } catch (URISyntaxException e) {
            throw new RuntimeException("Error occured fetching request token", e);
          } catch (OAuthException e) {
            throw new RuntimeException("Error occured fetching request token", e);
          }

          Intent i = new Intent(Intent.ACTION_VIEW);
          i.setData(Uri.parse(url));
          startActivity(i);

          finish();
        }
      });
      alert.show();
    }
  }

  private void persistRequestToken(OAuth3LeggedScheme.Token requestToken,
      String providerName) {
    SharedPreferences.Editor editor =
      getSharedPreferences("default", MODE_PRIVATE).edit();

    if (requestToken != null) {
      editor.putString(OpenSocialActivity.SELECTED_PROVIDER, providerName);
      editor.putString(OpenSocialActivity.REQUEST_TOKEN, requestToken.token);
      editor.putString(OpenSocialActivity.REQUEST_TOKEN_SECRET,
          requestToken.secret);
    }

    editor.commit();
  }

  private OAuth3LeggedScheme getAuth(String name) {
    Class<? extends Provider> providerClass = (Class<? extends Provider>)
        getIntent().getSerializableExtra(name + OpenSocialActivity.CLASS);
    String[] credentials = getIntent().getStringArrayExtra(name +
        OpenSocialActivity.CREDENTIALS);

    if (providerClass == null || credentials == null ||
        credentials.length < 2) {
      return null;
    }

    try {
      Provider provider = providerClass.newInstance();

      return new OAuth3LeggedScheme(provider, credentials[0], credentials[1]);
    } catch (InstantiationException e) {
      return null;
    } catch (IllegalAccessException e) {
      return null;
    }
  }
}


text:
package org.jzy3d.plot3d.primitives.graphs.impl;

import javax.media.opengl.GL2;
import javax.media.opengl.glu.GLU;

import org.jzy3d.colors.Color;
import org.jzy3d.maths.BoundingBox3d;
import org.jzy3d.maths.Coord2d;
import org.jzy3d.maths.Coord3d;
import org.jzy3d.plot3d.primitives.graphs.AbstractDrawableGraph2d;
import org.jzy3d.plot3d.rendering.view.Camera;
import org.jzy3d.plot3d.text.align.Halign;
import org.jzy3d.plot3d.text.align.Valign;

public class DefaultDrawableGraph2d<V,E>  extends AbstractDrawableGraph2d<V, E>  {
	public DefaultDrawableGraph2d(){
		super();
		bbox = new BoundingBox3d();
		labelScreenOffset = new Coord2d(0,0);
		labelSceneOffset = new Coord3d(0,0,0);
	}

	/*******************************************************/

	protected void drawVertices(GL2 gl, GLU glu, Camera cam){
		gl.glPointSize(formatter.getVertexWidth());
        gl.glBegin(GL2.GL_POINTS);
		for(V v: graph.getVertices()){
			if(highlights.get(v))
				drawVertexNode(gl, glu, cam, v, layout.get(v), formatter.getHighlightedVertexColor());
			else
				drawVertexNode(gl, glu, cam, v, layout.get(v), formatter.getVertexColor());
		}
		gl.glEnd();
	}

	protected void drawVertexLabels(GL2 gl, GLU glu, Camera cam){
		for(V v: graph.getVertices()){
			if(highlights.get(v))
				drawVertexLabel(gl, glu, cam, v, layout.get(v), formatter.getHighlightedVertexColor());
			else
				drawVertexLabel(gl, glu, cam, v, layout.get(v), formatter.getVertexLabelColor());
		}
	}

	protected void drawEdges(GL2 gl, GLU glu, Camera cam){
		for(E e: graph.getEdges()){
			V v1 = graph.getEdgeStartVertex(e);
			V v2 = graph.getEdgeStopVertex(e);
			drawEdge(gl, glu, cam, e, layout.get(v1), layout.get(v2), formatter.getEdgeColor());
		}
	}

	/*******************************************************/

	protected void drawVertexNode(GL2 gl, GLU glu, Camera cam, V v, Coord2d coord, Color color){
		gl.glColor4f(color.r, color.g, color.b, color.a);
        gl.glVertex3f(coord.x, coord.y, Z);
	}

	protected void drawVertexLabel(GL2 gl, GLU glu, Camera cam, V v, Coord2d coord, Color color){
		Coord3d textPosition = new Coord3d(coord, Z);
        txt.drawText(gl, glu, cam, v.toString(), textPosition, Halign.CENTER, Valign.BOTTOM, color, labelScreenOffset, labelSceneOffset);
	}

	protected void drawEdge(GL2 gl, GLU glu, Camera cam, E e, Coord2d c1, Coord2d c2, Color color){
		gl.glBegin(GL2.GL_LINE_STRIP);
	        gl.glColor4f(color.r, color.g, color.b, color.a);
	        gl.glVertex3f(c1.x, c1.y, Z);
	        gl.glVertex3f(c2.x, c2.y, Z);
		gl.glEnd();
	}
}


text:
const CanList = require('can-list');

const map = new CanList({
  define: {
    Type: CanList
  }
});
CanList();
new CanList();
CanList.prototype.say = function(){};
function speak(MyList) {};
const say = function(MyList) {};
Object.assign({}, CanList);
const secondMap = new CanList({
  MyList: CanList
});


text:
package goarch

const (
	_ArchFamily          = S390X
	_DefaultPhysPageSize = 4096
	_PCQuantum           = 2
	_MinFrameSize        = 8
	_StackAlign          = PtrSize
)


text:
/*************************************************************************/
/*  webrtc_peer.cpp                                                      */
/*************************************************************************/
/*                       This file is part of:                           */
/*                           GODOT ENGINE                                */
/*                      https://godotengine.org                          */
/*************************************************************************/
/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur.                 */
/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md)    */
/*                                                                       */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the       */
/* "Software"), to deal in the Software without restriction, including   */
/* without limitation the rights to use, copy, modify, merge, publish,   */
/* distribute, sublicense, and/or sell copies of the Software, and to    */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions:                                             */
/*                                                                       */
/* The above copyright notice and this permission notice shall be        */
/* included in all copies or substantial portions of the Software.       */
/*                                                                       */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY  */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
/*************************************************************************/

#include "webrtc_peer.h"

WebRTCPeer *(*WebRTCPeer::_create)() = NULL;

Ref<WebRTCPeer> WebRTCPeer::create_ref() {

	if (!_create)
		return Ref<WebRTCPeer>();
	return Ref<WebRTCPeer>(_create());
}

WebRTCPeer *WebRTCPeer::create() {

	if (!_create)
		return NULL;
	return _create();
}

void WebRTCPeer::_bind_methods() {
	ClassDB::bind_method(D_METHOD("create_offer"), &WebRTCPeer::create_offer);
	ClassDB::bind_method(D_METHOD("set_local_description", "type", "sdp"), &WebRTCPeer::set_local_description);
	ClassDB::bind_method(D_METHOD("set_remote_description", "type", "sdp"), &WebRTCPeer::set_remote_description);
	ClassDB::bind_method(D_METHOD("poll"), &WebRTCPeer::poll);
	ClassDB::bind_method(D_METHOD("add_ice_candidate", "media", "index", "name"), &WebRTCPeer::add_ice_candidate);

	ClassDB::bind_method(D_METHOD("was_string_packet"), &WebRTCPeer::was_string_packet);
	ClassDB::bind_method(D_METHOD("set_write_mode", "write_mode"), &WebRTCPeer::set_write_mode);
	ClassDB::bind_method(D_METHOD("get_write_mode"), &WebRTCPeer::get_write_mode);
	ClassDB::bind_method(D_METHOD("get_connection_state"), &WebRTCPeer::get_connection_state);

	ADD_SIGNAL(MethodInfo("offer_created", PropertyInfo(Variant::STRING, "type"), PropertyInfo(Variant::STRING, "sdp")));
	ADD_SIGNAL(MethodInfo("new_ice_candidate", PropertyInfo(Variant::STRING, "media"), PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::STRING, "name")));

	ADD_PROPERTY(PropertyInfo(Variant::INT, "write_mode", PROPERTY_HINT_ENUM), "set_write_mode", "get_write_mode");

	BIND_ENUM_CONSTANT(WRITE_MODE_TEXT);
	BIND_ENUM_CONSTANT(WRITE_MODE_BINARY);

	BIND_ENUM_CONSTANT(STATE_NEW);
	BIND_ENUM_CONSTANT(STATE_CONNECTING);
	BIND_ENUM_CONSTANT(STATE_CONNECTED);
	BIND_ENUM_CONSTANT(STATE_DISCONNECTED);
	BIND_ENUM_CONSTANT(STATE_FAILED);
	BIND_ENUM_CONSTANT(STATE_CLOSED);
}

WebRTCPeer::WebRTCPeer() {
}

WebRTCPeer::~WebRTCPeer() {
}


text:
var LocalStrategy = require('passport-local').Strategy,
    SL = require(process.cwd() + '/lib/happy/sqllib.js');

module.exports = {
    initialize : function(server, Passport) {

    }
    ,getUserByName : function(pgClient, userName, cb){
        var sql = 'SELECT id, name, full_name, pass,admin FROM usr WHERE name = $1';

        console.log(sql)  ;
        pgClient.query(sql, [userName], function(err, user){
            if(err || user.rows.length < 1){
                cb(err || 'no user with this userName', false);
            } else {
                cb(null, user.rows[0]);
            }
        });
    },getUserById : function(pgClient, id, cb){
        var sql = 'SELECT id, name, full_name,admin FROM usr WHERE id = $1';

        console.log(sql)  ;
        pgClient.query(sql, [id], function(err, user){
            if(err || user.rows.length < 1){
                cb(err || 'no user with this id', false);
            } else {
                cb(null, user.rows[0]);
            }
        });
    },setLastLogin : function(pgClient, userId, cb){
        console.log('ahoj now()');
        var sql = new SL.SqlLib('usr');
        sql.whereAnd('id='+userId);
        sql.update(pgClient, {last_login:'now()'}, function(err, data){
            console.log(err ? err : data);
          cb(err, data);
        })
    }
}


text:
const passport = require('passport');
const request = require('request');
const LocalStrategy = require('passport-local').Strategy;

const User = require('../models/User');

passport.serializeUser((user, done) => {
  done(null, user.id);
});

passport.deserializeUser((id, done) => {
  User.findById(id, (err, user) => {
    done(err, user);
  });
});

/**
 * Sign in using Email and Password.
 */
passport.use(new LocalStrategy({ usernameField: 'email' }, (email, password, done) => {
  User.findOne({ email: email.toLowerCase() }, (err, user) => {
    if (err) { return done(err); }
    if (!user) {
      return done(null, false, { msg: `Email ${email} not found.` });
    }
    user.comparePassword(password, (err, isMatch) => {
      if (err) { return done(err); }
      if (isMatch) {
        return done(null, user);
      }
      return done(null, false, { msg: 'Invalid email or password.' });
    });
  });
}));

/**
 * Login Required middleware.
 */
exports.isAuthenticated = (req, res, next) => {
  if (req.isAuthenticated()) {
    return next();
  }
  res.redirect('/login');
};

/**
 * Authorization Required middleware.
 */
exports.isAuthorized = (req, res, next) => {
  const provider = req.path.split('/').slice(-1)[0];
  const token = req.user.tokens.find(token => token.kind === provider);
  if (token) {
    next();
  } else {
    res.redirect(`/auth/${provider}`);
  }
};


text:
#ifndef WINPR_SSPI_NTLM_PRIVATE_H
#define WINPR_SSPI_NTLM_PRIVATE_H

#include <winpr/sspi.h>
#include <winpr/windows.h>

#include <time.h>
#include <openssl/des.h>
#include <openssl/md4.h>
#include <openssl/md5.h>
#include <openssl/sha.h>
#include <openssl/rc4.h>
#include <openssl/hmac.h>
#include <openssl/rand.h>
#include <openssl/engine.h>

#include "../sspi.h"

#define MESSAGE_TYPE_NEGOTIATE					1
#define MESSAGE_TYPE_CHALLENGE					2
#define MESSAGE_TYPE_AUTHENTICATE				3

#define NTLMSSP_NEGOTIATE_56					0x80000000 /* W   (0) */
#define NTLMSSP_NEGOTIATE_KEY_EXCH				0x40000000 /* V   (1) */
#define NTLMSSP_NEGOTIATE_128					0x20000000 /* U   (2) */
#define NTLMSSP_RESERVED1					0x10000000 /* r1  (3) */
#define NTLMSSP_RESERVED2					0x08000000 /* r2  (4) */
#define NTLMSSP_RESERVED3					0x04000000 /* r3  (5) */
#define NTLMSSP_NEGOTIATE_VERSION				0x02000000 /* T   (6) */
#define NTLMSSP_RESERVED4					0x01000000 /* r4  (7) */
#define NTLMSSP_NEGOTIATE_TARGET_INFO				0x00800000 /* S   (8) */
#define NTLMSSP_REQUEST_NON_NT_SESSION_KEY			0x00400000 /* R   (9) */
#define NTLMSSP_RESERVED5					0x00200000 /* r5  (10) */
#define NTLMSSP_NEGOTIATE_IDENTIFY				0x00100000 /* Q   (11) */
#define NTLMSSP_NEGOTIATE_EXTENDED_SESSION_SECURITY		0x00080000 /* P   (12) */
#define NTLMSSP_RESERVED6					0x00040000 /* r6  (13) */
#define NTLMSSP_TARGET_TYPE_SERVER				0x00020000 /* O   (14) */
#define NTLMSSP_TARGET_TYPE_DOMAIN				0x00010000 /* N   (15) */
#define NTLMSSP_NEGOTIATE_ALWAYS_SIGN				0x00008000 /* M   (16) */
#define NTLMSSP_RESERVED7					0x00004000 /* r7  (17) */
#define NTLMSSP_NEGOTIATE_WORKSTATION_SUPPLIED			0x00002000 /* L   (18) */
#define NTLMSSP_NEGOTIATE_DOMAIN_SUPPLIED			0x00001000 /* K   (19) */
#define NTLMSSP_NEGOTIATE_ANONYMOUS				0x00000800 /* J   (20) */
#define NTLMSSP_RESERVED8					0x00000400 /* r8  (21) */
#define NTLMSSP_NEGOTIATE_NTLM					0x00000200 /* H   (22) */
#define NTLMSSP_RESERVED9					0x00000100 /* r9  (23) */
#define NTLMSSP_NEGOTIATE_LM_KEY				0x00000080 /* G   (24) */
#define NTLMSSP_NEGOTIATE_DATAGRAM				0x00000040 /* F   (25) */
#define NTLMSSP_NEGOTIATE_SEAL					0x00000020 /* E   (26) */
#define NTLMSSP_NEGOTIATE_SIGN					0x00000010 /* D   (27) */
#define NTLMSSP_RESERVED10					0x00000008 /* r10 (28) */
#define NTLMSSP_REQUEST_TARGET					0x00000004 /* C   (29) */
#define NTLMSSP_NEGOTIATE_OEM					0x00000002 /* B   (30) */
#define NTLMSSP_NEGOTIATE_UNICODE				0x00000001 /* A   (31) */

enum _NTLM_STATE
{
	NTLM_STATE_INITIAL,
	NTLM_STATE_NEGOTIATE,
	NTLM_STATE_CHALLENGE,
	NTLM_STATE_AUTHENTICATE,
	NTLM_STATE_FINAL
};
typedef enum _NTLM_STATE NTLM_STATE;

enum _NTLM_AV_ID
{
	MsvAvEOL,
	MsvAvNbComputerName,
	MsvAvNbDomainName,
	MsvAvDnsComputerName,
	MsvAvDnsDomainName,
	MsvAvDnsTreeName,
	MsvAvFlags,
	MsvAvTimestamp,
	MsvAvSingleHost,
	MsvAvTargetName,
	MsvChannelBindings
};
typedef enum _NTLM_AV_ID NTLM_AV_ID;

struct _NTLM_AV_PAIR
{
	UINT16 AvId;
	UINT16 AvLen;
};
typedef struct _NTLM_AV_PAIR NTLM_AV_PAIR;

#define MSV_AV_FLAGS_AUTHENTICATION_CONSTRAINED		0x00000001
#define MSV_AV_FLAGS_MESSAGE_INTEGRITY_CHECK		0x00000002
#define MSV_AV_FLAGS_TARGET_SPN_UNTRUSTED_SOURCE	0x00000004

#define WINDOWS_MAJOR_VERSION_5				0x05
#define WINDOWS_MAJOR_VERSION_6				0x06
#define WINDOWS_MINOR_VERSION_0				0x00
#define WINDOWS_MINOR_VERSION_1				0x01
#define WINDOWS_MINOR_VERSION_2				0x02
#define NTLMSSP_REVISION_W2K3				0x0F

struct _NTLM_VERSION_INFO
{
	UINT8 ProductMajorVersion;
	UINT8 ProductMinorVersion;
	UINT16 ProductBuild;
	BYTE Reserved[3];
	UINT8 NTLMRevisionCurrent;
};
typedef struct _NTLM_VERSION_INFO NTLM_VERSION_INFO;

struct _NTLM_SINGLE_HOST_DATA
{
	UINT32 Size;
	UINT32 Z4;
	UINT32 DataPresent;
	UINT32 CustomData;
	BYTE MachineID[32];
};
typedef struct _NTLM_SINGLE_HOST_DATA NTLM_SINGLE_HOST_DATA;

struct _NTLM_RESPONSE
{
	BYTE Response[24];
};
typedef struct _NTLM_RESPONSE NTLM_RESPONSE;

struct _NTLMv2_CLIENT_CHALLENGE
{
	UINT8 RespType;
	UINT8 HiRespType;
	UINT16 Reserved1;
	UINT32 Reserved2;
	BYTE Timestamp[8];
	BYTE ClientChallenge[8];
	UINT32 Reserved3;
	NTLM_AV_PAIR* AvPairs;
};
typedef struct _NTLMv2_CLIENT_CHALLENGE NTLMv2_CLIENT_CHALLENGE;

struct _NTLMv2_RESPONSE
{
	BYTE Response[16];
	NTLMv2_CLIENT_CHALLENGE Challenge;
};
typedef struct _NTLMv2_RESPONSE NTLMv2_RESPONSE;

struct _NTLM_MESSAGE_FIELDS
{
	UINT16 Len;
	UINT16 MaxLen;
	PBYTE Buffer;
	UINT32 BufferOffset;
};
typedef struct _NTLM_MESSAGE_FIELDS NTLM_MESSAGE_FIELDS;

struct _NTLM_MESSAGE_HEADER
{
	BYTE Signature[8];
	UINT32 MessageType;
};
typedef struct _NTLM_MESSAGE_HEADER NTLM_MESSAGE_HEADER;

struct _NTLM_NEGOTIATE_MESSAGE
{
	BYTE Signature[8];
	UINT32 MessageType;
	UINT32 NegotiateFlags;
	NTLM_VERSION_INFO Version;
	NTLM_MESSAGE_FIELDS DomainName;
	NTLM_MESSAGE_FIELDS Workstation;
};
typedef struct _NTLM_NEGOTIATE_MESSAGE NTLM_NEGOTIATE_MESSAGE;

struct _NTLM_CHALLENGE_MESSAGE
{
	BYTE Signature[8];
	UINT32 MessageType;
	UINT32 NegotiateFlags;
	BYTE ServerChallenge[8];
	BYTE Reserved[8];
	NTLM_VERSION_INFO Version;
	NTLM_MESSAGE_FIELDS TargetName;
	NTLM_MESSAGE_FIELDS TargetInfo;
};
typedef struct _NTLM_CHALLENGE_MESSAGE NTLM_CHALLENGE_MESSAGE;

struct _NTLM_AUTHENTICATE_MESSAGE
{
	BYTE Signature[8];
	UINT32 MessageType;
	UINT32 NegotiateFlags;
	NTLM_VERSION_INFO Version;
	NTLM_MESSAGE_FIELDS DomainName;
	NTLM_MESSAGE_FIELDS UserName;
	NTLM_MESSAGE_FIELDS Workstation;
	NTLM_MESSAGE_FIELDS LmChallengeResponse;
	NTLM_MESSAGE_FIELDS NtChallengeResponse;
	NTLM_MESSAGE_FIELDS EncryptedRandomSessionKey;
	BYTE MessageIntegrityCheck[16];
};
typedef struct _NTLM_AUTHENTICATE_MESSAGE NTLM_AUTHENTICATE_MESSAGE;

struct _NTLM_CONTEXT
{
	BOOL server;
	BOOL NTLMv2;
	BOOL UseMIC;
	NTLM_STATE state;
	int SendSeqNum;
	int RecvSeqNum;
	BYTE MachineID[32];
	BOOL SendVersionInfo;
	BOOL confidentiality;
	RC4_KEY SendRc4Seal;
	RC4_KEY RecvRc4Seal;
	BYTE* SendSigningKey;
	BYTE* RecvSigningKey;
	BYTE* SendSealingKey;
	BYTE* RecvSealingKey;
	UINT32 NegotiateFlags;
	int LmCompatibilityLevel;
	int SuppressExtendedProtection;
	UNICODE_STRING Workstation;
	UNICODE_STRING ServicePrincipalName;
	SEC_WINNT_AUTH_IDENTITY identity;
	BYTE* ChannelBindingToken;
	BYTE ChannelBindingsHash[16];
	SecPkgContext_Bindings Bindings;
	BOOL SendSingleHostData;
	NTLM_SINGLE_HOST_DATA SingleHostData;
	SecBuffer NegotiateMessage;
	SecBuffer ChallengeMessage;
	SecBuffer AuthenticateMessage;
	SecBuffer ChallengeTargetInfo;
	SecBuffer AuthenticateTargetInfo;
	SecBuffer TargetName;
	SecBuffer NtChallengeResponse;
	SecBuffer LmChallengeResponse;
	BYTE Timestamp[8];
	BYTE ChallengeTimestamp[8];
	BYTE ServerChallenge[8];
	BYTE ClientChallenge[8];
	BYTE SessionBaseKey[16];
	BYTE KeyExchangeKey[16];
	BYTE RandomSessionKey[16];
	BYTE ExportedSessionKey[16];
	BYTE EncryptedRandomSessionKey[16];
	BYTE ClientSigningKey[16];
	BYTE ClientSealingKey[16];
	BYTE ServerSigningKey[16];
	BYTE ServerSealingKey[16];
	BYTE MessageIntegrityCheck[16];
};
typedef struct _NTLM_CONTEXT NTLM_CONTEXT;

NTLM_CONTEXT* ntlm_ContextNew();
void ntlm_ContextFree(NTLM_CONTEXT* context);

#ifdef WITH_DEBUG_NLA
#define WITH_DEBUG_NTLM
#endif

#endif /* FREERDP_SSPI_NTLM_PRIVATE_H */


text:
#include "config.h"
#include "public/platform/WebURL.h"

#include "platform/weborigin/KURL.h"

namespace blink {

WebURL::WebURL(const KURL& url)
    : m_string(url.string())
    , m_parsed(url.parsed())
    , m_isValid(url.isValid())
{
}

WebURL& WebURL::operator=(const KURL& url)
{
    m_string = url.string();
    m_parsed = url.parsed();
    m_isValid = url.isValid();
    return *this;
}

WebURL::operator KURL() const
{
    return KURL(m_string, m_parsed, m_isValid);
}

} // namespace blink


text:
#ifndef LTSMIN_PARSE_ENV_H
#define LTSMIN_PARSE_ENV_H

/**
\file ltsmin-parse-env.h
\brief Internal datastructures for ast/lex/lemon.
 */

#include <util-lib/dynamic-array.h>
#include <ltsmin-lib/etf-util.h>
#include <ltsmin-lib/ltsmin-syntax.h>

struct op_info{
    int pattern;
    int token;
    int prio;
};

#define ENV_BUFFER_SIZE 4096

struct ltsmin_parse_env_s{
    stream_t input;
    void* parser;
    string_index_t values; // integer <-> constant mapping
    string_index_t state_vars; // integer <-> state variable name mapping
    string_index_t edge_vars; // integer <-> edge variable name mapping
    string_index_t keywords; // token <-> keywords mapping
    string_index_t idents; // other identifiers
    string_index_t constant_ops; // integer <-> operator mapping
    array_manager_t constant_man;
    struct op_info *constant_info;
    string_index_t unary_ops; // integer <-> operator mapping
    array_manager_t unary_man;
    struct op_info *unary_info;
    string_index_t binary_ops; // integer <-> operator mapping
    array_manager_t binary_man;
    struct op_info *binary_info;
    int lineno;    //line number, maintained by lexer.
    int linebased; /* if 0 then end of line is ignored as white space.
                      Otherwise an EOL token is generated. */
    int                 linepos;
    etf_model_t         etf;
    string_index_t      etf_current_idx;
    ltsmin_expr_t       expr;
    char                buffer[ENV_BUFFER_SIZE];
};

/* Parser Priorities:
 * HIGH
 *     postfix priority 1
 *     prefix priority 1
 *     binary priority 1
 *     postfix priority 2
 *     prefix priority 2
 *     binary priority 2
 *     postfix priority 3
 *     prefix priority 3
 *     binary priority 3
 *     postfix priority 4
 *     prefix priority 4
 *     binary priority 4
 *     postfix priority 5
 *     prefix priority 5
 *     binary priority 5
 *     postfix priority 6
 *     prefix priority 6
 *     binary priority 6
 *     postfix priority 7
 *     prefix priority 7
 *     binary priority 7
 *     postfix priority 8
 *     prefix priority 8
 *     binary priority 8
 *     postfix priority 9
 *     prefix priority 9
 *     Quantifier
 * LOW
 */

#endif


text:
require 'test_helper'

class ImportationAttachmentsControllerTest < ActionController::TestCase
  setup do
    @importation_attachment = importation_attachments(:one)
  end

  test "should get index" do
    get :index
    assert_response :success
    assert_not_nil assigns(:importation_attachments)
  end

  test "should get new" do
    get :new
    assert_response :success
  end

  test "should create importation_attachment" do
    assert_difference('ImportationAttachment.count') do
      post :create, importation_attachment: { collection_name: @importation_attachment.collection_name, content_type: @importation_attachment.content_type, data: @importation_attachment.data, filename: @importation_attachment.filename, importation_id: @importation_attachment.importation_id }
    end

    assert_redirected_to importation_attachment_path(assigns(:importation_attachment))
  end

  test "should show importation_attachment" do
    get :show, id: @importation_attachment
    assert_response :success
  end

  test "should get edit" do
    get :edit, id: @importation_attachment
    assert_response :success
  end

  test "should update importation_attachment" do
    put :update, id: @importation_attachment, importation_attachment: { collection_name: @importation_attachment.collection_name, content_type: @importation_attachment.content_type, data: @importation_attachment.data, filename: @importation_attachment.filename, importation_id: @importation_attachment.importation_id }
    assert_redirected_to importation_attachment_path(assigns(:importation_attachment))
  end

  test "should destroy importation_attachment" do
    assert_difference('ImportationAttachment.count', -1) do
      delete :destroy, id: @importation_attachment
    end

    assert_redirected_to importation_attachments_path
  end
end


text:
require 'test_helper'

class NoteHashTest < ActiveSupport::TestCase
  # test "the truth" do
  #   assert true
  # end
end


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>Alberto Luz</title>

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

    <link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
    <link href='https://fonts.googleapis.com/css?family=Kaushan+Script' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700' rel='stylesheet' type='text/css'>

    <link href="css/agency.css" rel="stylesheet">

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

                        Services

                        Portfolio

                        About

                        Family

                        Contact

Alberto Luz

                More

Skills

HTML

CSS

JavaScript

Projects

Java Game

Graphic Design

My Own Store

Website Design

Creature

Website Design

Drum-Kit

Website Design

Friend List

Website Design

Coming Soon

Website Design

About Me

2001-2016

Who Am I

I am Alberto Luz and i am 16 years old and im going to be ajunior at Arsenal Tech High School.

2016-2017

How I Got To NexTech

I took an Intro to Computer science class because I was interested in learning how to code and program but I really wanted to know how to game design and make video games so when my teacher told me about the NexTech Catapult Program i thought this could be an oppurtunity to help me out with

June 2017

My Family

I really get along with the new tech family I got assigned to and we all have some things in common

Future

What I Want To Do In The Future

Once I gradute from highschool I eithier want to attend IVY TECH or IUPUI and get a degree on game-design and computer programming. I really want to get into the tech field

My Family

Alberto luz

Lead Designer

Alex Correa

Lead Marketer

Lucy Reger

Lead Developer

Ben

Lead Developer

Contact Me

Contact Me

                        <form action="https://formspree.io/albertoluz2001@gmail.com" method="POST">
                            <input type="text" id="cname" class="form-control" name="Name:" placeholder="Name" required="" data-validation-required-message="Please enter your name." aria-invalid="false" style="margin: 5px;">

                            <input type="email" id="cemail" name="Email:" class="form-control" placeholder="Your E-mail" required="" data-validation-required-message="Please enter your email address." style="margin: 5px;">

                            <textarea class="form-control" id="cmessage" name="Message:" rows="7" placeholder="Message" required="" data-validation-required-message="Please enter your message." style="margin: 5px;"></textarea>

                            <input type="submit" class="btn btn-round btn-g" value="Send" style="margin: 5px;">
                        </form>

                    Copyright © Your Website 2016

Privacy Policy

Terms of Use

Project Name

Lorem ipsum dolor sit amet consectetur.

Use this area to describe your project. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Est blanditiis dolorem culpa incidunt minus dignissimos deserunt repellat aperiam quasi sunt officia expedita beatae cupiditate, maiores repudiandae, nostrum, reiciendis facere nemo!

                                    Want these icons in this portfolio item sample?You can download 60 of them for free, courtesy of RoundIcons.com, or you can purchase the 1500 icon set here.

Date: July 2014

Client: Round Icons

Category: Graphic Design

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

Project Heading

Lorem ipsum dolor sit amet consectetur.

Startup Framework is a website builder for professionals. Startup Framework contains components and complex blocks (PSD+HTML Bootstrap themes and templates) which can easily be integrated into almost any design. All of these components are made in the same style, and can easily be integrated into projects, allowing you to create hundreds of solutions for your future projects.

You can preview Startup Framework here.

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

Project Name

Lorem ipsum dolor sit amet consectetur.

Treehouse is a free PSD web template built by Mathavan Jaya. This is bright and spacious design perfect for people or startup companies looking to showcase their apps or other projects.

You can download the PSD template in this portfolio sample item at FreebiesXpress.com.

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

Project Name

Lorem ipsum dolor sit amet consectetur.

Start Bootstrap's Agency theme is based on Golden, a free PSD website template built by Mathavan Jaya. Golden is a modern and clean one page web template that was made exclusively for Best PSD Freebies. This template has a great portfolio, timeline, and meet your team sections that can be easily modified to fit your needs.

You can download the PSD template in this portfolio sample item at FreebiesXpress.com.

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

Project Name

Lorem ipsum dolor sit amet consectetur.

Escape is a free PSD web template built by Mathavan Jaya. Escape is a one page web template that was designed with agencies in mind. This template is ideal for those looking for a simple one page solution to describe your business and offer your services.

You can download the PSD template in this portfolio sample item at FreebiesXpress.com.

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

Project Name

Lorem ipsum dolor sit amet consectetur.

Dreams is a free PSD web template built by Mathavan Jaya. Dreams is a modern one page web template designed for almost any purpose. It's a beautiful template that's designed with the Bootstrap framework in mind.

You can download the PSD template in this portfolio sample item at FreebiesXpress.com.

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


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

namespace ImportRedmine.Api
{
    public class Tracker
    {
        [JsonProperty("id")]
        public int Id { get; set; }
        [JsonProperty("name")]
        public string Name { get; set; }
    }
}


text:
bool CMasternodeSync::UpdatePeerSyncState(const NodeId& id, const char* msg, const int nextSyncStatus)
{
    auto it = peersSyncState.find(id);
    if (it != peersSyncState.end()) {
        auto peerData = it->second;
        auto msgMapIt = peerData.mapMsgData.find(msg);
        if (msgMapIt != peerData.mapMsgData.end()) {
            // exists, let's update the received status and the sync state.

            // future: these boolean will not be needed once the peer syncState status gets implemented.
            msgMapIt->second.second = true;
            LogPrintf("%s: %s message updated peer sync state\n", __func__, msgMapIt->first);

            // Only update sync status if we really need it. Otherwise, it's just good redundancy to verify data several times.
            if (RequestedMasternodeAssets < nextSyncStatus) {
                // todo: this should only happen if more than N peers have sent the data.
                // move overall tier two sync state to the next one if needed.
                LogPrintf("%s: moving to next assset %s\n", __func__, nextSyncStatus);
                RequestedMasternodeAssets = nextSyncStatus;
            }
            return true;
        }
    }
    return false;
}

bool CMasternodeSync::MessageDispatcher(CNode* pfrom, std::string& strCommand, CDataStream& vRecv)
{
    if (strCommand == NetMsgType::GETSPORKS) {
        // send sporks
        sporkManager.ProcessGetSporks(pfrom, strCommand, vRecv);
        return true;
    }

    if (strCommand == NetMsgType::GETMNLIST) {
        // Get Masternode list or specific entry
        CTxIn vin;
        vRecv >> vin;
        int banScore = mnodeman.ProcessGetMNList(pfrom, vin);
        if (banScore > 0) {
            LOCK(cs_main);
            Misbehaving(pfrom->GetId(), banScore);
        }
        return true;
    }

    if (strCommand == NetMsgType::SPORK) {
        // as there is no completion message, this is using a SPORK_INVALID as final message for now.
        // which is just a hack, should be replaced with another message, guard it until the protocol gets deployed on mainnet and
        // add compatibility with the previous protocol as well.
        CSporkMessage spork;
        vRecv >> spork;
        int banScore = sporkManager.ProcessSporkMsg(spork);
        if (banScore > 0) {
            LOCK(cs_main);
            Misbehaving(pfrom->GetId(), banScore);
            return true;
        }
        // All good, Update in-flight message status if needed
        if (!UpdatePeerSyncState(pfrom->GetId(), NetMsgType::GETSPORKS, GetNextAsset(MASTERNODE_SYNC_SPORKS))) {
            // This could happen because of the message thread is requesting the sporks alone..
            // So.. for now, can just update the peer status and move it to the next state if the end message arrives
            if (spork.nSporkID == SPORK_INVALID) {
                if (RequestedMasternodeAssets < MASTERNODE_SYNC_LIST) {
                    // future note: use internal cs for RequestedMasternodeAssets.
                    RequestedMasternodeAssets = MASTERNODE_SYNC_LIST;
                }
            }
        }
        return true;
    }

    if (strCommand == NetMsgType::SYNCSTATUSCOUNT) {
        // Nothing to do.
        if (RequestedMasternodeAssets >= MASTERNODE_SYNC_FINISHED) return true;

        // Sync status count
        int nItemID;
        int nCount;
        vRecv >> nItemID >> nCount;

        // this means we will receive no further communication on the first sync
        switch (nItemID) {
            case MASTERNODE_SYNC_LIST: {
                UpdatePeerSyncState(pfrom->GetId(), NetMsgType::GETMNLIST, GetNextAsset(nItemID));
                return true;
            }
            case MASTERNODE_SYNC_MNW: {
                UpdatePeerSyncState(pfrom->GetId(), NetMsgType::GETMNWINNERS, GetNextAsset(nItemID));
                return true;
            }
            case MASTERNODE_SYNC_BUDGET_PROP: {
                // TODO: This could be a MASTERNODE_SYNC_BUDGET_FIN as well, possibly should decouple the finalization budget sync
                //  from the MASTERNODE_SYNC_BUDGET_PROP (both are under the BUDGETVOTESYNC message)
                UpdatePeerSyncState(pfrom->GetId(), NetMsgType::BUDGETVOTESYNC, GetNextAsset(nItemID));
                return true;
            }
            case MASTERNODE_SYNC_BUDGET_FIN: {
                // No need to handle this one, is handled by the proposals sync message for now..
                return true;
            }
        }
    }

    return false;
}

template <typename... Args>
void CMasternodeSync::PushMessage(CNode* pnode, const char* msg, Args&&... args)
{
    g_connman->PushMessage(pnode, CNetMsgMaker(pnode->GetSendVersion()).Make(msg, std::forward<Args>(args)...));
}

template <typename... Args>
void CMasternodeSync::RequestDataTo(CNode* pnode, const char* msg, bool forceRequest, Args&&... args)
{
    const auto& it = peersSyncState.find(pnode->id);
    bool exist = it != peersSyncState.end();
    if (!exist || forceRequest) {
        // Erase it if this is a forced request
        if (exist) {
            peersSyncState.at(pnode->id).mapMsgData.erase(msg);
        }
        // send the message
        PushMessage(pnode, msg, std::forward<Args>(args)...);

        // Add data to the tier two peers sync state
        TierTwoPeerData peerData;
        peerData.mapMsgData.emplace(msg, std::make_pair(GetTime(), false));
        peersSyncState.emplace(pnode->id, peerData);
    } else {
        // Check if we have sent the message or not
        TierTwoPeerData& peerData = it->second;
        const auto& msgMapIt = peerData.mapMsgData.find(msg);

        if (msgMapIt == peerData.mapMsgData.end()) {
            // message doesn't exist, push it and add it to the map.
            PushMessage(pnode, msg, std::forward<Args>(args)...);
            peerData.mapMsgData.emplace(msg, std::make_pair(GetTime(), false));
        } else {
            // message sent, next step: need to check if it was already answered or not.
            // And, if needed, request it again every certain amount of time.

            // Check if the node answered the message or not
            if (!msgMapIt->second.second) {
                int64_t lastRequestTime = msgMapIt->second.first;
                if (lastRequestTime + 600 < GetTime()) {
                    // ten minutes passed. Let's ask it again.
                    RequestDataTo(pnode, msg, true, std::forward<Args>(args)...);
                }
            }

        }
    }
}

void CMasternodeSync::SyncRegtest(CNode* pnode)
{
    // skip mn list and winners sync if legacy mn are obsolete
    if (deterministicMNManager->LegacyMNObsolete() &&
            (RequestedMasternodeAssets == MASTERNODE_SYNC_LIST || RequestedMasternodeAssets == MASTERNODE_SYNC_MNW)) {
        RequestedMasternodeAssets = MASTERNODE_SYNC_BUDGET;
    }

    // Initial sync, verify that the other peer answered to all of the messages successfully
    if (RequestedMasternodeAssets == MASTERNODE_SYNC_SPORKS) {
        RequestDataTo(pnode, NetMsgType::GETSPORKS, false);
    } else if (RequestedMasternodeAssets == MASTERNODE_SYNC_LIST) {
        RequestDataTo(pnode, NetMsgType::GETMNLIST, false, CTxIn());
    } else if (RequestedMasternodeAssets == MASTERNODE_SYNC_MNW) {
        RequestDataTo(pnode, NetMsgType::GETMNWINNERS, false, mnodeman.CountEnabled());
    } else if (RequestedMasternodeAssets == MASTERNODE_SYNC_BUDGET) {
        // sync masternode votes
        RequestDataTo(pnode, NetMsgType::BUDGETVOTESYNC, false, uint256());
    } else if (RequestedMasternodeAssets == MASTERNODE_SYNC_FINISHED) {
        LogPrintf("REGTEST SYNC FINISHED!\n");
    }
}


text:
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

/*!
 * Computes moves.
 */

use middle::borrowck::*;
use middle::borrowck::gather_loans::move_error::MoveSpanAndPath;
use middle::borrowck::gather_loans::move_error::{MoveError, MoveErrorCollector};
use middle::borrowck::move_data::*;
use middle::expr_use_visitor as euv;
use middle::mem_categorization as mc;
use middle::ty;
use syntax::ast;
use syntax::codemap::Span;
use util::ppaux::Repr;

use std::rc::Rc;

struct GatherMoveInfo<'tcx> {
    id: ast::NodeId,
    kind: MoveKind,
    cmt: mc::cmt<'tcx>,
    span_path_opt: Option<MoveSpanAndPath>
}

pub fn gather_decl(bccx: &BorrowckCtxt,
                   move_data: &MoveData,
                   decl_id: ast::NodeId,
                   _decl_span: Span,
                   var_id: ast::NodeId) {
    let loan_path = Rc::new(LpVar(var_id));
    move_data.add_move(bccx.tcx, loan_path, decl_id, Declared);
}

pub fn gather_move_from_expr<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
                                       move_data: &MoveData,
                                       move_error_collector: &MoveErrorCollector<'tcx>,
                                       move_expr_id: ast::NodeId,
                                       cmt: mc::cmt<'tcx>,
                                       move_reason: euv::MoveReason) {
    let kind = match move_reason {
        euv::DirectRefMove | euv::PatBindingMove => MoveExpr,
        euv::CaptureMove => Captured
    };
    let move_info = GatherMoveInfo {
        id: move_expr_id,
        kind: kind,
        cmt: cmt,
        span_path_opt: None,
    };
    gather_move(bccx, move_data, move_error_collector, move_info);
}

pub fn gather_move_from_pat<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
                                      move_data: &MoveData,
                                      move_error_collector: &MoveErrorCollector<'tcx>,
                                      move_pat: &ast::Pat,
                                      cmt: mc::cmt<'tcx>) {
    let pat_span_path_opt = match move_pat.node {
        ast::PatIdent(_, ref path1, _) => {
            Some(MoveSpanAndPath{span: move_pat.span,
                                 ident: path1.node})
        },
        _ => None,
    };
    let move_info = GatherMoveInfo {
        id: move_pat.id,
        kind: MovePat,
        cmt: cmt,
        span_path_opt: pat_span_path_opt,
    };
    gather_move(bccx, move_data, move_error_collector, move_info);
}

fn gather_move<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
                         move_data: &MoveData,
                         move_error_collector: &MoveErrorCollector<'tcx>,
                         move_info: GatherMoveInfo<'tcx>) {
    debug!("gather_move(move_id={}, cmt={})",
           move_info.id, move_info.cmt.repr(bccx.tcx));

    let potentially_illegal_move =
                check_and_get_illegal_move_origin(bccx, &move_info.cmt);
    match potentially_illegal_move {
        Some(illegal_move_origin) => {
            debug!("illegal_move_origin={}", illegal_move_origin.repr(bccx.tcx));
            let error = MoveError::with_move_info(illegal_move_origin,
                                                  move_info.span_path_opt);
            move_error_collector.add_error(error);
            return
        }
        None => ()
    }

    match opt_loan_path(&move_info.cmt) {
        Some(loan_path) => {
            move_data.add_move(bccx.tcx, loan_path,
                               move_info.id, move_info.kind);
        }
        None => {
            // move from rvalue or unsafe pointer, hence ok
        }
    }
}

pub fn gather_assignment(bccx: &BorrowckCtxt,
                         move_data: &MoveData,
                         assignment_id: ast::NodeId,
                         assignment_span: Span,
                         assignee_loan_path: Rc<LoanPath>,
                         assignee_id: ast::NodeId,
                         mode: euv::MutateMode) {
    move_data.add_assignment(bccx.tcx,
                             assignee_loan_path,
                             assignment_id,
                             assignment_span,
                             assignee_id,
                             mode);
}

fn check_and_get_illegal_move_origin<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
                                               cmt: &mc::cmt<'tcx>)
                                               -> Option<mc::cmt<'tcx>> {
    match cmt.cat {
        mc::cat_deref(_, _, mc::BorrowedPtr(..)) |
        mc::cat_deref(_, _, mc::Implicit(..)) |
        mc::cat_deref(_, _, mc::UnsafePtr(..)) |
        mc::cat_static_item => {
            Some(cmt.clone())
        }

        mc::cat_rvalue(..) |
        mc::cat_local(..) |
        mc::cat_upvar(..) => {
            None
        }

        mc::cat_downcast(ref b) |
        mc::cat_interior(ref b, _) => {
            match b.ty.sty {
                ty::ty_struct(did, _) | ty::ty_enum(did, _) => {
                    if ty::has_dtor(bccx.tcx, did) {
                        Some(cmt.clone())
                    } else {
                        check_and_get_illegal_move_origin(bccx, b)
                    }
                }
                _ => {
                    check_and_get_illegal_move_origin(bccx, b)
                }
            }
        }

        mc::cat_deref(ref b, _, mc::OwnedPtr) => {
            check_and_get_illegal_move_origin(bccx, b)
        }
    }
}


text:
OCamlMakeProjDefaults(pcregrep.exe)

InstantiateOCamlEnv()


text: Rails.application.config.session_store :cookie_store, key: '_SnapCatcher_session'


text:
Ext.define('sisprod.model.LocationModel', {
    extend: 'Ext.data.Model',

    require: [
        'Ext.data.Model'
    ],

    fields:[
        {name: 'idLocation', type: 'int', visible: false}, // Ext.data.Types.FLOAT
        {name: 'locationName', type: 'string', visible: true},
        {name: 'locationAcronym', type: 'string', visible: true},
        {name: 'locationParent.idLocation', type: 'int', visible: false, mapping:'locationParent.idLocation'},
        {name: 'locationParent.locationName', type: 'string', visible: true, mapping:'locationParent.locationName'},
        {name: 'locationType.idLocationType', type: 'int', visible: false, mapping:'locationType.idLocationType'},
        {name: 'locationType.locationTypeName', type: 'string', visible: true, mapping:'locationType.locationTypeName'},
        {name: 'lot.idLot', type: 'int', visible: false, mapping:'lot.idLot'},
        {name: 'lot.lotName', type: 'string', visible: true, mapping:'lot.lotName'}
    ],

    idProperty: 'idLocation'
});


text:
package org.apache.camel.itest.springboot;

import org.apache.camel.itest.springboot.util.ArquillianPackager;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.Archive;
import org.junit.Test;
import org.junit.runner.RunWith;

@RunWith(Arquillian.class)
public class CamelSjmsTest extends AbstractSpringBootTestSupport {

    @Deployment
    public static Archive<?> createSpringBootPackage() throws Exception {
        return ArquillianPackager.springBootPackage(createTestConfig());
    }

    public static ITestConfig createTestConfig() {
        return new ITestConfigBuilder()
                .module(inferModuleName(CamelSjmsTest.class))
                .exclusion("com.atomikos:transactions-jta")
//                // to run unit tests
//                .dependency("com.atomikos:transactions-jdbc:3.9.3")
//                .dependency("com.atomikos:transactions-jms:3.9.3")
//                .dependency("com.atomikos:transactions-api:3.9.3")
//                .dependency("javax.transaction:javax.transaction-api:1.2")
//                .disableJmx("org.apache.activemq:*")
                .build();
    }

    @Test
    public void componentTests() throws Exception {
        //this.runComponentTest(config);

        // Unit tests can be enabled if required
        //this.runModuleUnitTestsIfEnabled(config);
    }

}


text:
{
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" é uma expressão opcional como "campo1=\'novovalor\'". Você não pode atualizar ou apagar os resultados de um JOIN',
'%Y-%m-%d': '%Y-%m-%d',
'%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S',
'%s rows deleted': '%s linhas apagadas',
'%s rows updated': '%s linhas atualizadas',
'Available databases and tables': 'Bancos de dados e tabelas disponíveis',
'Cannot be empty': 'Não pode ser vazio',
'Check to delete': 'Marque para apagar',
'Client IP': 'Client IP',
'Controller': 'Controller',
'Copyright': 'Copyright',
'Current request': 'Requisição atual',
'Current response': 'Resposta atual',
'Current session': 'Sessão atual',
'DB Model': 'DB Model',
'Database': 'Database',
'Delete:': 'Apagar:',
'Description': 'Description',
'E-mail': 'E-mail',
'Edit': 'Edit',
'Edit This App': 'Edit This App',
'Edit current record': 'Editar o registro atual',
'First name': 'First name',
'Group ID': 'Group ID',
'Hello World': 'Olá Mundo',
'Import/Export': 'Importar/Exportar',
'Index': 'Index',
'Internal State': 'Estado Interno',
'Invalid Query': 'Consulta Inválida',
'Invalid email': 'Invalid email',
'Last name': 'Last name',
'Layout': 'Layout',
'Login': 'Autentique-se',
'Lost Password': 'Esqueceu sua senha?',
'Main Menu': 'Main Menu',
'Menu Model': 'Menu Model',
'Name': 'Name',
'New Record': 'Novo Registro',
'No databases in this application': 'Sem bancos de dados nesta aplicação',
'Origin': 'Origin',
'Password': 'Password',
'Powered By': 'Powered By',
'Powered by': 'Powered by',
'Project listings': 'Project listings',
'Query:': 'Consulta:',
'Record ID': 'Record ID',
'Register': 'Registre-se',
'Registration key': 'Registration key',
'Reset Password key': 'Reset Password key',
'Role': 'Role',
'Rows in table': 'Linhas na tabela',
'Rows selected': 'Linhas selecionadas',
'Stylesheet': 'Stylesheet',
'Sure you want to delete this object?': 'Está certo(a) que deseja apagar esse objeto ?',
'Table name': 'Table name',
'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': 'Uma "consulta" é uma condição como "db.tabela1.campo1==\'valor\'". Expressões como "db.tabela1.campo1==db.tabela2.campo2" resultam em um JOIN SQL.',
'Timestamp': 'Timestamp',
'Update:': 'Atualizar:',
'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...)  for NOT to build more complex queries.': 'Use (...)&(...) para AND, (...)|(...) para OR, e ~(...)  para NOT para construir consultas mais complexas.',
'User ID': 'User ID',
'View': 'View',
'Welcome': 'Welcome',
'Welcome %s': 'Welcome %s',
'Welcome to web2py': 'Bem vindo ao web2py',
'appadmin is disabled because insecure channel': 'appadmin is disabled because insecure channel',
'cache': 'cache',
'change password': 'change password',
'click here for online examples': 'clique aqui para ver alguns exemplos',
'click here for the administrative interface': 'clique aqui para acessar a interface administrativa',
'customize me!': 'Personalize-me!',
'data uploaded': 'dados enviados',
'database': 'banco de dados',
'database %s select': 'Selecionar banco de dados %s',
'db': 'db',
'design': 'design',
'done!': 'concluído!',
'ecology - computing - health': 'ecology - computing - health',
'edit profile': 'edit profile',
'export as csv file': 'exportar como um arquivo csv',
'insert new': 'inserir novo',
'insert new %s': 'inserir novo %s',
'invalid request': 'requisição inválida',
'login': 'login',
'logout': 'logout',
'new record inserted': 'novo registro inserido',
'next 100 rows': 'próximas 100 linhas',
'nicopresto': 'nicopresto',
'or import from csv file': 'ou importar de um arquivo csv',
'previous 100 rows': '100 linhas anteriores',
'projects - projects - projects': 'projects - projects - projects',
'record': 'record',
'record does not exist': 'registro não existe',
'record id': 'id do registro',
'register': 'register',
'selected': 'selecionado',
'state': 'estado',
'table': 'tabela',
'unable to parse csv file': 'não foi possível analisar arquivo csv',
}


text:
{{#section 'writing'}}

 {{{sectionTitle "writing" "Publications"}}}

    {{#each r.writing}}
      {{#if url}}

{{title}}, {{publisher.name}}

      {{else}}

{{title}}, {{publisher.name}}

      {{/if}}
      Published on: {{formatDate safe.date 'YYYY-MM'}}
      {{#unless @last}}

{{/unless}}
    {{/each}}

{{/section}}


text:
module DateCasually

  # Contains global configuration options for DateCasually. These options
  # may be changed globally at runtime by using the designated class method.
  # For example:
  #
  #   DateCasually::Config.as :years
  #   (Date.today + 2).casual
  #   #=> "less than a year from now"
  #
  module Config

    class << self

      # Gets and sets a map that tells DateCasually which translation options to use
      # when translating the current date. Values should be passed as an array of symbols.
      # Possible values are :day, :week, :month, :year, :day_of_week.
      #
      # Examples:
      #
      #   date = Date.new(2010, 8, 30)
      #
      #   (date + 6).casual(:day_of_week)
      #   #=> 'next week'
      #
      #   (date + 1).casual(:months)
      #   #=> 'less than a month from now'
      #
      #   (date + 660).casual(:months)
      #   #=> '21 months from now'
      #
      #   (date + 660).casual(:months, :years)
      #   #=> 'a couple of years from now'
      #
      attr_accessor :as
    end

    # Resets the classes configuration options back to their defaults. Used
    # primarily to reset the class configuration options when the module
    # gets loaded.
    #
    # Example:
    #
    #   self.reset
    #
    # Returns nothing.
    def self.reset
      self.as = [:days, :weeks, :months, :years]
    end

    # Reset the first time we are loaded.
    self.reset

  end
end


text:
<!doctype html>

    <meta charset="utf-8" />
    <link rel="stylesheet" type="text/css" href="../../../../support/github-web/physcomp.css" />
    <title>Exercise: Voltage Divider</title>

Exercise: Voltage Divider

Objective

Measure voltages and compute current flow in a resistive voltage divider.

Many sensor circuits we use will be built around an arrangement of series
      resistances called a voltage divider.  This is a fundamental
      construction will will appear again and again.

Two resistors in series form a single current pathway, so a voltage
      applied across the pair will cause the same current to flow through each
      of them.  However, the voltage drop across each resistor resulting from
      that current is proportional to the resistance (V = i *
      R), so the voltage at the intermediate node depends on the relative
      resistances.  In the simplest case, if both resistances are the same, the
      voltage in the middle will be the average of the voltage at each end.

We will use the voltage divider structure to allow a variable resistance
      (e.g. sensor or switch) to control the voltage at the intermediate point.
      This is useful for us because the analog-to-digital converter on the
      Arduino senses applied voltage.

Steps and observations

Measure the exact resistance of each resistor.

Carefully measure the voltage Vin applied across the series pair of
      resistors.

Compute the expected voltage V1 across the grounded
	resistor: V1 = Vin * (R1 / (R1+R2)), where R2
	is the 'upper' resistor connected to the positive supply and R1 is the
	'lower' resistor connected to ground.

Vary the input voltage and repeat; you should be able to convince
	yourself that the intermediate voltage scales proportionately.

Open the circuit and measure the actual current through the divider.
	Compare against the predicted value i = Vin / (R1+R2).

Comments

Also see Wikipedia.

Other Files

1.a.i.4_voltage-divider.fzz


text:
/* @flow */

import React from 'react'
import { TouchableWithoutFeedback, View } from 'react-native'
import MediaContent from './MediaContent'
import styles from './styles'

type Props = {
  active: boolean,
  image: string,
  bookmarked?: boolean,
  onPress?: Function,
  tileNumber?: number,
  tileText?: string,
  tileTitle?: string,
  style?: StyleSheet | number,
  period?: string,
}

const Media = (props: Props): React$Element<any> => {
  const { active, bookmarked, image, onPress, tileNumber, tileText, tileTitle, style, period } = props
  return (
    <TouchableWithoutFeedback onPress={onPress}>
      <View style={[styles.container, style]}>
        <MediaContent
          active={active}
          bookmarked={bookmarked}
          image={image}
          tileNumber={tileNumber}
          tileText={tileText}
          tileTitle={tileTitle}
          period={period}
          style={style}
        />
      </View>
    </TouchableWithoutFeedback>
  )
}

export default Media


text:
(function (module) {
	'use strict';

	module.exports = function (grunt) {
		grunt.loadTasks('tasks');
		grunt.registerTask('compile', ['ngtemplates', 'compass', 'concat', 'uglify', 'cssmin']);
	};

})(module);


text:
# ! usr/bin/python
# -*- coding: utf-8 -*-

import tornado.ioloop
import tornado.web
from urllib import urlencode
import requests
import json
import sys
import time

reload(sys)
sys.setdefaultencoding('utf8')
from selenium import webdriver
from scrapy.item import Item, Field
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

import urllib2

# 代理服务器
proxyHost = "proxy.abuyun.com"
proxyPort = "9010"

# 代理隧道验证信息
proxyUser = "H2479Q462XD77ZMD"
proxyPass = "C78200FF07A18904"

proxyMeta = "http://%(user)s:%(pass)s@%(host)s:%(port)s" % {
    "host": proxyHost,
    "port": proxyPort,
    "user": proxyUser,
    "pass": proxyPass,
}

proxies = {
    "http": proxyMeta,
    "https": proxyMeta,
}

g_cname_split = "-----&&&&&&&&&&&&&&&&&&------"

class CollectorInfo():

    def __init__(self):
        #self.driver = webdriver.Firefox()
        #self.driver = webdriver.Remote("http://localhost:4444/wd/hub", webdriver.DesiredCapabilities.FIREFOX.copy())
        self.maxHtmlstoFetch = 1

    def doPicker(self,cname):

        listinfos = []
        if cname is not None:

            company_name = cname
            url_prefix = "http://www.tianyancha.com/search?"
            params = {
                "checkFrom": "searchBox",
                "key": company_name,
            }
            URLRefer = url_prefix + urlencode(params)

            url_prefix = "http://www.tianyancha.com/search/"

            params = {
                "": company_name
            }
            URL = url_prefix + urlencode(params) + ".json?"
            URL = URL.replace('=', '')

            headers = {
                'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0',
                #'User-Agent': 'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0',
                'Content-Type': 'application/x-www-form-urlencoded',
                'Connection': 'keep-alive',
                'Accept-Encoding': 'gzip,deflate',
                'Accept-Language': 'zh-CN,zh;q=0.8',
                'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
                'Host': 'www.tianyancha.com',
                'Referer': URLRefer,
            }

            # 'User-Agent', 'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0',
            #('User-Agent', 'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0'),
            header0 = [
                ('User-Agent', 'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0'),
                ('Content-Type', 'application/x-www-form-urlencoded'),
                ('Connection', 'keep-alive'),
                ('Accept-Encoding', 'gzip,deflate'),
                ('Accept-Language', 'zh-CN,zh;q=0.8'),
                ('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'),
                ('Host', 'www.tianyancha.com'),
                ('Referer', URLRefer)
            ]

            #resp = requests.get(URL, headers= headers)

            try:
                #proxy_support = urllib2.ProxyHandler({"http":proxyMeta})
                #opener = urllib2.build_opener(proxy_support)
                #opener.addheaders = header0
                #urllib2.install_opener(opener)
                resp = urllib2.urlopen(URL).read()
                content = resp
                if str(content).find('无数据') > 0:
                    return

                json_data = json.loads(content)
                listcount= len(json_data['data'])

            except Exception as e:
                print("encounter error when open search ulr for company list")
                print(e)
                raise e
                return None

            try:
                kappa = {}
                kappa['platform'] = 'LINUX'
                kappa['browserName'] = 'phantomjs'
                kappa['maxInstances'] = 10
                kappa['seleniumProtocol'] = 'webDriver'

                self.driver = webdriver.Remote(
                    command_executor='http://65e005891169.sn.mynetname.net:6666/wd/hub',
                    desired_capabilities=kappa)
            except Exception as e:
                print("encounter error when open selenium grid")
                print(e)
                raise e
                return None

            #xrange is a generator
            print "number of cnames is :" + str(listcount)
            irange = min(listcount, self.maxHtmlstoFetch)
            for i in xrange(0,irange):

                infos = ""
                try:
                    company_id = json_data['data'][i]['id']
                    #print str(company_id)
                    time.sleep(1)

                    company_url = "http://www.tianyancha.com/company/" + str(company_id)
                    self.driver.get(company_url)

                    WebDriverWait(self.driver, 3).until(EC.presence_of_element_located((By.XPATH, '//div[@class="company_info_text"]/span[1]')))

                    #company_item = tianyanItem()

                    try:
                        company_name = self.driver.find_element_by_xpath('//div[@class="company_info_text"]/p').text
                    except:
                        company_name = self.driver.find_element_by_xpath('//div[@class="company_info_text"]/div').text
                    finally:
                       if company_name is None:
                           company_name = "can not get"

                    #print company_name
                    infos += company_name + g_cname_split + "\n"

                    telephone = self.driver.find_element_by_xpath('//div[@class="company_info_text"]/span[1]').text

                    #print telephone
                    infos += telephone + "\n"

                    email = self.driver.find_element_by_xpath('//div[@class="company_info_text"]/span[2]').text

                    #print email
                    infos +=  email + "\n"

                    website = self.driver.find_element_by_xpath('//div[@class="company_info_text"]/span[3]').text

                    #print website
                    infos +=  website + "\n"

                    address = self.driver.find_element_by_xpath('//div[@class="company_info_text"]/span[4]').text

                    #print address
                    infos += address + "\n"

                    legalPerson = self.driver.find_element_by_xpath('//a[@ng-if="company.legalPersonName"]').text

                    #print legalPerson
                    infos +=legalPerson + "\n"

                    #regCapital = self.driver.find_element_by_xpath('//td[@class="td-regCapital-value"]/p').text

                    #print regCapital
                    #infos += regCapital + "\n"

                    #status = self.driver.find_element_by_xpath('//td[@class="td-regStatus-value"]/p').text
                    #print status
                    #infos += status + "\n"

                    #regTime = self.driver.find_element_by_xpath('//td[@class="td-regTime-value"]/p').text
                    #print regTime
                    #infos += regTime + "\n"

                    c8span = self.driver.find_elements_by_xpath('//div[@class="c8"]/span')

                    business_register_no = c8span[0].text
                    #print  business_register_no
                    infos += business_register_no + "\n"

                    org_code = c8span[1].text
                    #print org_code
                    infos += org_code + "\n"

                    social_security_code = c8span[2].text
                    #print social_security_code
                    infos += social_security_code + "\n"

                    company_type = c8span[3].text
                    #print company_type
                    infos +=  company_type + "\n"

                    domain = c8span[4].text
                    #print domain
                    infos += domain + "\n"

                    open_period = c8span[5].text
                    #print open_period
                    infos += open_period + "\n"

                    check_date = c8span[6].text
                    #print check_date
                    infos += check_date + "\n"

                    authorize_org = c8span[7].text
                    #print authorize_org
                    infos +=  authorize_org + "\n"

                    register_address = c8span[8].text
                    #print register_address
                    infos += register_address + "\n"

                    business_scope  = c8span[9].text
                    #print business_scope
                    infos +=  business_scope + "\n"

                except Exception as e:
                    print "exception in extract info from html"
                    print e
                finally:
                    pass

                print infos
                listinfos.append(infos)

        self.driver.close()
        self.driver.quit()

        return listinfos


text:
/*
 * 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.
 */
package com.facebook.presto.hive;

import com.facebook.presto.spi.SchemaTableName;
import com.facebook.presto.spi.security.ConnectorAccessControl;
import com.facebook.presto.spi.security.Identity;

import javax.inject.Inject;

import static com.facebook.presto.spi.security.AccessDeniedException.denyDropTable;
import static com.facebook.presto.spi.security.AccessDeniedException.denyRenameTable;
import static java.util.Objects.requireNonNull;

public class NoAccessControl
        implements ConnectorAccessControl
{
    private final boolean allowDropTable;
    private final boolean allowRenameTable;

    @Inject
    public NoAccessControl(HiveClientConfig hiveClientConfig)
    {
        requireNonNull(hiveClientConfig, "hiveClientConfig is null");
        allowDropTable = hiveClientConfig.getAllowDropTable();
        allowRenameTable = hiveClientConfig.getAllowRenameTable();
    }

    @Override
    public void checkCanCreateTable(Identity identity, SchemaTableName tableName)
    {
    }

    @Override
    public void checkCanDropTable(Identity identity, SchemaTableName tableName)
    {
        if (!allowDropTable) {
            denyDropTable(tableName.toString());
        }
    }

    @Override
    public void checkCanRenameTable(Identity identity, SchemaTableName tableName, SchemaTableName newTableName)
    {
        if (!allowRenameTable) {
            denyRenameTable(tableName.toString(), newTableName.toString());
        }
    }

    @Override
    public void checkCanSelectFromTable(Identity identity, SchemaTableName tableName)
    {
    }

    @Override
    public void checkCanInsertIntoTable(Identity identity, SchemaTableName tableName)
    {
    }

    @Override
    public void checkCanDeleteFromTable(Identity identity, SchemaTableName tableName)
    {
    }

    @Override
    public void checkCanCreateView(Identity identity, SchemaTableName viewName)
    {
    }

    @Override
    public void checkCanDropView(Identity identity, SchemaTableName viewName)
    {
    }

    @Override
    public void checkCanSelectFromView(Identity identity, SchemaTableName viewName)
    {
    }

    @Override
    public void checkCanSetCatalogSessionProperty(Identity identity, String propertyName)
    {
    }
}


text:
namespace views {
class View;
}  // namespace views

class Profile;

// This bubble is implemented as a WebUI page rendered inside a native bubble.
// After the bubble is closed, a IPH for profile switching may be shown.
class ProfileCustomizationBubbleView : public views::BubbleDialogDelegateView {
 public:
  METADATA_HEADER(ProfileCustomizationBubbleView);
  ProfileCustomizationBubbleView(const ProfileCustomizationBubbleView& other) =
      delete;
  ProfileCustomizationBubbleView& operator=(
      const ProfileCustomizationBubbleView& other) = delete;
  ~ProfileCustomizationBubbleView() override;

  // Creates and shows the bubble.
  static ProfileCustomizationBubbleView* CreateBubble(Profile* profile,
                                                      views::View* anchor_view);

 private:
  FRIEND_TEST_ALL_PREFIXES(ProfileBubbleInteractiveUiTest,
                           CustomizationBubbleFocus);
  FRIEND_TEST_ALL_PREFIXES(ProfileCustomizationBubbleBrowserTest, IPH);

  ProfileCustomizationBubbleView(Profile* profile, views::View* anchor_view);

  // Called when the "Done" button is clicked in the inner WebUI.
  void OnDoneButtonClicked();
};

#endif  // CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_CUSTOMIZATION_BUBBLE_VIEW_H_