text:
Adventure instead of candy for kids at Easter.

## Idea

Take Lego kits and repackage them in plastic Easter eggs for the kids to find. (It would be awesome if the Lego company took this idea and sold this directly to the public as a seasonal item before Easter.)

Lego Company sells boxes of Legos that come with an instruction manual on how to use the pieces in the kits to make one or more toys. This idea is for an individual to repurpose the kits into a collection of easter eggs that can be hidden and found by kids at easter. Instead of eating candy at the end of the hunt they build toys.

### Product Setup / Creation

- Take a kit of (say) 110 Lego pieces
- Get 10 same-colored plastic easter eggs. If possible also get one large plastic easter egg.
- Seperate the 110 pieces into 11 piles. Put all the large pieces that won't fit in the small easter eggs in the same pile.
- Put each pile into an easter egg. Put the large pieces into a large plastic easter egg or keep aside as the bonus bundle that is given once all eggs are collected. The instruction book goes in here as well.
  - It may be necessary to put the pieces in a tiny zip lock bag inside the egg so that they are not lost when the egg is opened.
- Label the eggs with letters and numbers.
  - The letters can be anything you select or an acronym for the toy.
  - The letters are intended to group the eggs if multiple children are playing so they need to be the same for each kit.
  - The number should be ordinal representing one of a set and also indicate the total in the set. For example TC-3/9 would mean Toy Car #3 of 9.
- You should now have a collection of identically-colored Easter Eggs with the same letters and numbered 1 through N.

### Rules of Play

- As per usual the easter eggs are hidden by an adult.
- Children are told the color and letters of the eggs that they are looking for. The letters are irrelevant if there is only one color for each child.
- Instead of competitive grabbing as many eggs from each other during the hunt children are encouraged to engage in team-work by shouting out when they find an egg that's not their's to help each other find the eggs.
- Younger children should be assigned an older peer to help with numbers and letters and the older child given the team-lead title.
- Eggs should not be opened until they have all been found and brought back to HQ.
- Once all the eggs are found the kids will discover what toy they'll be building and able to build it.

Monetization
============

Sell the kits


text:
package me.kevingleason.androidrtc.adapters;

import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.List;

import me.kevingleason.androidrtc.R;
import me.kevingleason.androidrtc.adt.ChatMessage;

/**
 * Created by GleasonK on 6/25/15.
 */
public class ChatAdapter extends ArrayAdapter<ChatMessage> {
    private static final long FADE_TIMEOUT = 3000;

    private final Context context;
    private LayoutInflater inflater;
    private List<ChatMessage> values;

    public ChatAdapter(Context context, List<ChatMessage> values) {
        super(context, R.layout.chat_message_row_layout, android.R.id.text1, values);
        this.context = context;
        this.inflater = LayoutInflater.from(context);
        this.values=values;
    }

    class ViewHolder {
        TextView sender;
        TextView message;
        TextView timeStamp;
        ChatMessage chatMsg;
    }

    @Override
    public View getView(final int position, View convertView, ViewGroup parent) {
        ChatMessage chatMsg;
        if(position >= values.size()){ chatMsg = new ChatMessage("","",0); } // Catch Edge Case
        else { chatMsg = this.values.get(position); }
        ViewHolder holder;
        if (convertView == null) {
            holder = new ViewHolder();
            convertView = inflater.inflate(R.layout.chat_message_row_layout, parent, false);
            holder.sender = (TextView) convertView.findViewById(R.id.chat_user);
            holder.message = (TextView) convertView.findViewById(R.id.chat_message);
            holder.timeStamp = (TextView) convertView.findViewById(R.id.chat_timestamp);
            convertView.setTag(holder);
            Log.d("Adapter", "Recreating fadeout.");
        } else {
            holder = (ViewHolder) convertView.getTag();
        }
        holder.sender.setText(chatMsg.getSender() + ": ");
        holder.message.setText(chatMsg.getMessage());
        holder.timeStamp.setText(formatTimeStamp(chatMsg.getTimeStamp()));
        holder.chatMsg=chatMsg;
        setFadeOut3(convertView, chatMsg);
        return convertView;
    }

    @Override
    public int getCount() {
        return this.values.size();
    }

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

    @Override
    public long getItemId(int position){
        if (position >= values.size()){ return -1; }
        return values.get(position).hashCode();
    }

    public void removeMsg(int loc){
        this.values.remove(loc);
        notifyDataSetChanged();
    }

    public void addMessage(ChatMessage chatMsg){
        this.values.add(chatMsg);
        notifyDataSetChanged();
    }

    private void setFadeOut2(final View view, final ChatMessage message){
        Log.i("AdapterFade", "Caling Fade2");
        view.animate().setDuration(1000).setStartDelay(2000).alpha(0)
        .withEndAction(new Runnable() {
            @Override
            public void run() {
                if (values.contains(message))
                    values.remove(message);
                notifyDataSetChanged();
                view.setAlpha(1);
            }
        });
    }

    private void setFadeOut3(final View view, final ChatMessage message){
        Log.i("AdapterFade", "Caling Fade3");
        long elapsed = System.currentTimeMillis() - message.getTimeStamp();
        if (elapsed >= FADE_TIMEOUT){
            if (values.contains(message))
                values.remove(message);
            notifyDataSetChanged();
            return;
        }
        view.animate().setStartDelay(FADE_TIMEOUT - elapsed).setDuration(1500).alpha(0)
                .withEndAction(new Runnable() {
                    @Override
                    public void run() {
                        if (values.contains(message)){
                            values.remove(message);
                        }
                        notifyDataSetChanged();
                        view.setAlpha(1);
                    }
                });
    }

    private void setFadeOut(final View view, final ChatMessage message){
        long elapsed = System.currentTimeMillis() - message.getTimeStamp();
        if (elapsed >= FADE_TIMEOUT){
            if (values.contains(message))
                values.remove(message);
            notifyDataSetChanged();
            return;
        }

        view.setHasTransientState(true);
        Animation fadeOut = new AlphaAnimation(1, 0);
        fadeOut.setInterpolator(new AccelerateInterpolator()); //and this
        fadeOut.setStartOffset(FADE_TIMEOUT - elapsed);
        fadeOut.setDuration(1000);

        AnimationSet animation = new AnimationSet(false);
        animation.addAnimation(fadeOut);
        animation.setRepeatCount(1);

        view.setAnimation(animation);
        animation.setAnimationListener(new Animation.AnimationListener() {
            @Override
            public void onAnimationStart(Animation animation) {}

            @Override
            public void onAnimationEnd(Animation animation) {
                if (values.contains(message)){
                    values.remove(message);
                }
                notifyDataSetChanged();
                view.setAlpha(1);
                view.setHasTransientState(false);
            }

            @Override
            public void onAnimationRepeat(Animation animation) {}
        });

    }

    /**
     * Format the long System.currentTimeMillis() to a better looking timestamp. Uses a calendar
     *   object to format with the user's current time zone.
     * @param timeStamp
     * @return
     */
    public static String formatTimeStamp(long timeStamp){
        // Create a DateFormatter object for displaying date in specified format.
        SimpleDateFormat formatter = new SimpleDateFormat("h:mm.ss a");

        // Create a calendar object that will convert the date and time value in milliseconds to date.
        Calendar calendar = Calendar.getInstance();
        calendar.setTimeInMillis(timeStamp);
        return formatter.format(calendar.getTime());
    }

}

redpajama_set_name: RedPajamaGithub


text:
'use strict';

var grunt = require('grunt');

exports.email_templates = {
  default_options: function(test) {
    test.expect(2);

    var actualHtml = grunt.file.read('tmp/template1/html.html');
    var actualTxt = grunt.file.read('tmp/template1/text.txt');
    var expectedHtml = grunt.file.read('test/expected/template1/html.html');
    var expectedTxt = grunt.file.read('test/expected/template1/text.txt');

    test.equal(actualHtml, expectedHtml, 'should generate html file');
    test.equal(actualTxt, expectedTxt, 'should generate text file');

    test.done();
  },
  custom_options: function(test) {
    test.expect(2);

    var actualHtml = grunt.file.read('tmp/template2/index.html');
    var actualTxt = grunt.file.read('tmp/template2/index.txt');
    var expectedHtml = grunt.file.read('test/expected/template2/index.html');
    var expectedTxt = grunt.file.read('test/expected/template2/index.txt');

    test.equal(actualHtml, expectedHtml, 'should generate html file');
    test.equal(actualTxt, expectedTxt, 'should generate text file');

    test.done();
  }
};


text:
<?php

namespace Brickoo\Tests\Component\Http;

use Brickoo\Component\Http\Header\GenericHeaderField;
use Brickoo\Component\Http\HttpMessageHeader;
use PHPUnit_Framework_TestCase;

/**
 * HttpMessageHeaderTest
 *
 * Test suite for the HttpMessageHeader class.
 * @see Brickoo\Component\Http\HttpMessageHeader
 * @author Celestino Diaz <celestino.diaz@gmx.de>
 */
class HttpMessageHeaderTest extends PHPUnit_Framework_TestCase {

    /**
     * @covers Brickoo\Component\Http\HttpMessageHeader::__construct
     * @covers Brickoo\Component\Http\HttpMessageHeader::importHeaderFieldList
     */
    public function testImportHeaderFields() {
        $headerField = new GenericHeaderField("Host", "brickoo.com");
        $messageHeader = new HttpMessageHeader([$headerField]);
        $this->assertSame($headerField, $messageHeader->getField("Host"));
    }

    /**
     * @covers Brickoo\Component\Http\HttpMessageHeader::__construct
     * @covers Brickoo\Component\Http\HttpMessageHeader::addField
     * @covers Brickoo\Component\Http\HttpMessageHeader::getField
     */
    public function testAddAndGetHeaderField() {
        $headerField = new GenericHeaderField("Host", "brickoo.com");
        $messageHeader = new HttpMessageHeader();
        $messageHeader->addField($headerField);
        $this->assertSame($headerField, $messageHeader->getField("Host"));
    }

    /**
     * @covers Brickoo\Component\Http\HttpMessageHeader::toString
     * @covers Brickoo\Component\Http\HttpHeaderFieldNameNormalizer::normalize
     */
    public function testToString() {
        $expectedString = "Host: brickoo.com\r\n";
        $messageHeader = new HttpMessageHeader();
        $messageHeader->addField(new GenericHeaderField("Host", "brickoo.com"));
        $this->assertEquals($expectedString, $messageHeader->toString());
    }

}


text:
#define DEBUG_LOG

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.ServiceBus;
using Microsoft.ServiceBus.Messaging;
using Newtonsoft.Json;

namespace WorkerHost
{
    public class EventHubReader
    {
        private EventHubReceiver[] _receivers = null;
        private string _consumerGroupPrefix;

        private Task[] _tasks = null;
        private Action<string> _onMessage;

        internal ManualResetEvent FailureEvent = new ManualResetEvent(false);

        public EventHubReader(string consumerGroupPrefix, Action<string> onMessage)
        {
            _consumerGroupPrefix = consumerGroupPrefix;
            _onMessage = onMessage;
        }

        public void Close()
        {
            if (_receivers != null)
            {
                foreach (var r in _receivers)
                {
                    r.CloseAsync();
                }
            }
        }

        public void Run(string connectionString, string hubName, string measureNameFilter)
        {
            NamespaceManager nsmgr = NamespaceManager.CreateFromConnectionString(connectionString);
            EventHubDescription desc = nsmgr.GetEventHub(hubName);

            //we use already defined consumerGroup name to not reach limit on CG count
            string consumerGroupName = _consumerGroupPrefix;
            ConsumerGroupDescription consumerGroupDesc = nsmgr.CreateConsumerGroupIfNotExists(new ConsumerGroupDescription(hubName, consumerGroupName));

            EventHubClient client = EventHubClient.CreateFromConnectionString(connectionString, hubName);

            int numPartitions = desc.PartitionCount;
            _receivers = new EventHubReceiver[numPartitions];

            _tasks = new Task[numPartitions];

            for (int iPart = 0; iPart < desc.PartitionCount; iPart++)
            {
                EventHubReceiver receiver = client.GetConsumerGroup(consumerGroupName).CreateReceiver(
                    desc.PartitionIds[iPart], DateTime.UtcNow - TimeSpan.FromMinutes(2));
                _receivers[iPart] = receiver;

                int part = iPart;
                Task.Factory.StartNew((state) =>
                {
                    try
                    {
                        while (true)
                        {
                            var messages = _receivers[part].Receive(1000, TimeSpan.FromSeconds(1));
                            Process(messages);
                        }
                    }
                    catch (Exception ex)
                    {
                        //FailureEvent.Set();
                        Trace.TraceError("Ignored invalid event data: {0}");
                    }
                }, iPart);
            }
        }

        void Process(IEnumerable<EventData> batch)
        {
            UTF8Encoding enc = new UTF8Encoding();
            foreach (EventData e in batch)
            {
                string body = enc.GetString(e.GetBytes());
                string[] lines = body.Split(new char[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);

                foreach (var line in lines)
                {
                    try
                    {
                        _onMessage(line);
                    }
                    catch (Exception)
                    {
#if DEBUG_LOG
                        Trace.TraceError("Ignored invalid event data: {0}", line);
#endif
                    }
                }
            }
        }
    }
}


text:
package com.mxixm.fastboot.weixin.module.message.processor;

import com.mxixm.fastboot.weixin.module.media.WxMedia;
import com.mxixm.fastboot.weixin.module.media.WxMediaManager;
import com.mxixm.fastboot.weixin.module.message.WxMessageBody;
import com.mxixm.fastboot.weixin.module.message.parameter.WxMessageParameter;
import com.mxixm.fastboot.weixin.util.WxUrlUtils;
import org.springframework.core.io.FileSystemResource;

/**
 * FastBootWeixin WxMiniProgramMessageProcessor
 *
 * @author Guangshan
 * @date 2017/8/20 22:53
 * @since 0.1.2
 */
public class WxMiniProgramMessageProcessor extends AbstractWxMessageBodyProcessor<WxMessageBody.MiniProgram> {

    protected WxMediaManager wxMediaManager;

    public WxMiniProgramMessageProcessor(WxMediaManager wxMediaManager) {
        this.wxMediaManager = wxMediaManager;
    }

    @Override
    protected WxMessageBody.MiniProgram processBody(WxMessageParameter WxMessageParameter, WxMessageBody.MiniProgram body) {
        processMiniProgramBody(WxMessageParameter, body);
        return body;
    }

    protected WxMessageBody.MiniProgram processMiniProgramBody(WxMessageParameter WxMessageParameter, WxMessageBody.MiniProgram body) {
        // 为了避免重复代码提示,两个地方用了相同的逻辑的不同写法,todo 待优化
        if (body.getThumbMediaId() == null) {
            // 优先使用path
            if (body.getThumbMediaPath() != null) {
                String thumbMediaId = wxMediaManager.addTempMedia(WxMedia.Type.IMAGE, new FileSystemResource(body.getThumbMediaPath()));
                body.setThumbMediaId(thumbMediaId);
            } else if (body.getThumbMediaUrl() != null) {
                String url = WxUrlUtils.absoluteUrl(WxMessageParameter.getRequestUrl(), body.getThumbMediaUrl());
                String thumbMediaId = wxMediaManager.addTempMediaByUrl(WxMedia.Type.IMAGE, url);
                body.setThumbMediaId(thumbMediaId);
            }
        }
        return body;
    }

}


text:
<?php
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;

/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model \common\models\LoginForm */

$this->title = 'Login';
$this->params['breadcrumbs'][] = $this->title;
?>

<?= Html::encode($this->title) ?>

Please fill out the following fields to login:

                <?php $form = ActiveForm::begin(['id' => 'login-form']); ?>
                    <?= $form->field($model, 'username') ?>
                    <?= $form->field($model, 'password')->passwordInput() ?>
                    <?= $form->field($model, 'rememberMe')->checkbox() ?>

                        <?= Html::submitButton('Login', ['class' => 'btn btn-primary', 'name' => 'login-button']) ?>

                <?php ActiveForm::end(); ?>


text:
angular.module('ShoutOut.Shared.Services')

.service('surveyService', ['$http',
  function($http) {

    return {
      getDraft: function() {
        return $http.get('/api/survey/draft');
      },

      publish: function(draft) {
        return $http.post('/api/survey/publish/draft', draft);
      },

      getCurrentSurvey: function() {
        return $http.get('/api/survey/current');
      },

      submitSurvey: function(survey) {
        return $http.post('/api/survey/submit', survey);
      },

      getSurveyResults: function() {
        return $http.get('/api/survey/results');
      },

      getAllSurveyResults: function(){
        return $http.get('/api/survey/all-results');
      },

      getEmployeeSurveyResults: function(){
        return $http.get('/api/survey/employee-results');
      }
    }
  }]
);


text:
class SpeechInstance : public common::Instance {
 public:
  SpeechInstance();
  virtual ~SpeechInstance();

 private:
  // common::Instance implementation.
  virtual void HandleMessage(const char* msg);
  virtual void HandleSyncMessage(const char* message);

  const picojson::value::object
      HandleVocalizeString(const picojson::value& msg);
  const picojson::value::object
      HandleListenVoice(const picojson::value& msg);

  static void ProxyResultCb(TizenSrs *, const gchar *const *, void*);

  TizenSrs*    tts_proxy_;  // text to speech proxy
  TizenSrs*    stt_proxy_;  // speech to text proxy
#ifdef TIZEN
  static void SetupMainloop(void *data);
  GMainLoop*   main_loop_;
  std::thread  thread_;
#endif  // TIZEN
};

#endif  // SPEECH_SPEECH_INSTANCE_H_


text:
START_ATF_NAMESPACE
    typedef tagLOGPEN *NPLOGPEN;
END_ATF_NAMESPACE


text:
require 'active_record'
require 'mysql2'
require 'rsolr'

puts ">>>> Start <<<<"
puts '== Configuring database connection...'
ActiveRecord::Base.establish_connection(
  :adapter => "mysql2",
  :host => "localhost",
  :database => "viatgemjunts", #viatgemjunts
  username: 'root', #root
  password: 'hackaton' #hackaton
)

puts '== Configuring tables...'
class Travel < ActiveRecord::Base
  self.table_name = 'Travel'
end
class Route < ActiveRecord::Base
  self.table_name = 'Route'
end

puts "===== Travels ====="
puts '== Configuring Solr connection...'
solr = RSolr.connect :url => 'http://localhost:8983/solr/travels'

puts '== Deleting all...'
solr.delete_by_query '*:*'
solr.commit

puts '== Synchronizing...'
Travel.find_each do |travel|
  solr.add :id => travel.id,
    :tra_origin => travel.tra_origin,
    :tra_destination => travel.tra_destination,
    :tra_num_days => travel.tra_num_days,
    :tra_budget_max => travel.tra_budget_max,
    :tra_budget_min => travel.tra_budget_min,
    :tra_date => travel.tra_date,
    :tra_planning_limit => travel.tra_planning_limit,
    :tra_persons_min => travel.tra_persons_min,
    :tra_persons_max => travel.tra_persons_max,
    :tra_description => travel.tra_description,
    :tra_usr_id => travel.tra_usr_id,
    :tra_lat => travel.tra_lat,
    :tra_long => travel.tra_lat
  print '.'
end
solr.commit
puts ""

puts "===== Routes ====="
puts "WIP..."
puts ">>>> Finish <<<<"


text:
package com.ionitetechnologies.mutualcontacts.gcm;

import java.io.IOException;
import java.util.ArrayList;

import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.provider.ContactsContract;
import android.util.Log;

import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.services.s3.AmazonS3Client;
import com.amazonaws.services.s3.model.PutObjectRequest;
import com.ionitetechnologies.mutualcontacts.Devices;
import com.ionitetechnologies.mutualcontacts.R;
import com.ionitetechnologies.mutualcontacts.servertools.ServerUtilities;
import com.ionitetechnologies.mutualcontacts.verification.VerifyActivity;
import com.google.android.gcm.GCMBaseIntentService;

/**
 * IntentService responsible for handling GCM messages.
 */
public class GCMIntentService extends GCMBaseIntentService {

	SharedPreferences pref;
	private static final String TAG = "GCMIntentService";
	String fromNumber;

	public GCMIntentService() {
		super();

	}

	@Override
	protected void onRegistered(Context context, String registrationId) {
		Log.d(TAG, "Device is registering with gcm: regId = " + registrationId);

		SharedPreferences p = getSharedPreferences("pref", MODE_PRIVATE);
		String number = p.getString("PhnNumber", "0");
		VerifyActivity.setRegId(registrationId);

		try {
			ServerUtilities.register(context, registrationId, number);
			ArrayList<Devices> devi = RetrieveContacts();
			ServerUtilities.uploadNumbers(devi, number);
		} catch (IOException e) {
			// if Entry is duplicate of gcm, update the number only.
			e.printStackTrace();
		}

		// now only the dialog in verify activity should dismiss.
		if (VerifyActivity.dialog != null) {
			if (VerifyActivity.dialog.isShowing()) {
				VerifyActivity.dialog.dismiss();
			} else {
				Log.e("dialog", "It is NOT SHOWING");
			}
		}

		Intent imp = new Intent("COM.IONITETECHNOLOGIES.MUTUALCONTACTS.notify.DEVICELIST");
		imp.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
		imp.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		startActivity(imp);

	}

	ArrayList<Devices> RetrieveContacts() {

		Cursor cursor = getContentResolver().query(
				ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, null,
				null, ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME);
		ArrayList<Devices> device = new ArrayList<Devices>();

		for (cursor.moveToFirst(); !cursor.isAfterLast(); cursor.moveToNext()) {
			String phoneNumber = cursor
					.getString(cursor
							.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
			Log.v("contact for", phoneNumber);
			Devices dev = new Devices();
			dev.setPhn(phoneNumber);
			device.add(dev);
		}

		return device;

	}

	@Override
	protected void onUnregistered(Context context, String registrationId) {
		Log.i(TAG, "Device unregistered");
		// displayMessage(context, getString(R.string.gcm_unregistered));
		/*
		 * if (GCMRegistrar.isRegisteredOnServer(context)) {
		 * ServerUtilities.unregister(context, registrationId);
		 * Log.i("GCMRegistrar", "implement unregister method"); } else { //
		 * This callback results from the call to unregister made on //
		 * ServerUtilities when the registration to the server failed.
		 * Log.i(TAG, "Ignoring unregister callback"); }
		 */
	}

	@Override
	protected void onMessage(Context context, Intent intent) {
		Log.i(TAG, "Received message");

		String msg = intent.getStringExtra("message");
		generateNotification(context, msg);
		Log.v("GCM", "Received: " + msg);
	}

	@Override
	protected void onDeletedMessages(Context context, int total) {
		Log.i(TAG, "Received deleted messages notification");
	}

	@Override
	public void onError(Context context, String errorId) {
		Log.i(TAG, "Received error: " + errorId);
	}

	@Override
	protected boolean onRecoverableError(Context context, String errorId) {
		Log.i(TAG, "Received recoverable error: " + errorId);
		return super.onRecoverableError(context, errorId);
	}

	/**
	 * Issues a notification to inform the user that server has sent a message.
	 */
	private static void generateNotification(Context context, String message) {
		int icon = R.drawable.ic_stat_gcm;
		long when = System.currentTimeMillis();

		NotificationManager notificationManager = (NotificationManager) context
				.getSystemService(Context.NOTIFICATION_SERVICE);

		Notification notification = new Notification(icon, message, when);

		Intent notificationIntent = new Intent(context, DisplayActivity.class);
		notificationIntent.putExtra("message", message);
		// startActivity(notificationIntent);

		PendingIntent intent = PendingIntent.getActivity(context, 0,
				notificationIntent, 0);
		notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP
				| Intent.FLAG_ACTIVITY_SINGLE_TOP);
		notification.flags |= Notification.FLAG_AUTO_CANCEL;

		notification.setLatestEventInfo(context, "Event Reminder", message,
				intent);

		notificationManager.notify(0, notification);
	}

}


text:
package definitions

type ExtensionInfo_Request_ContactInfo_RegionalSettings struct {
	FormattingLocale ExtensionInfo_Request_ContactInfo_RegionalSettings_FormattingLocale `json:"formattingLocale,omitempty"`
	GreetingLanguage ExtensionInfo_Request_ContactInfo_RegionalSettings_GreetingLanguage `json:"greetingLanguage,omitempty"`
	Language         ExtensionInfo_Request_ContactInfo_RegionalSettings_Language         `json:"language,omitempty"`
	Timezone         ExtensionInfo_Request_ContactInfo_RegionalSettings_Timezone         `json:"timezone,omitempty"`
}


text:
[![Build Status](https://travis-ci.org/galaxyproject/tools-iuc.svg?branch=master)](https://travis-ci.org/galaxyproject/tools-iuc)

Galaxy Tools maintained by IUC
==============================

This repo contains a subset of Galaxy repositories used in the Tool Shed (https://toolshed.g2.bx.psu.edu/).

These repositories are maintained and developed by the [Intergalactic Utilities Commission](https://wiki.galaxyproject.org/IUC) ([Github Org](https://github.com/galaxy-iuc/))

Other repositories with Galaxy tools:
 * [Björn Grüning repo](https://github.com/bgruening/galaxytools)
 * [Galaxy devteam repo](https://github.com/galaxyproject/tools-devteam)


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectModuleManager">
    <modules>
      <module fileurl="file://$PROJECT_DIR$/BeEyes.iml" filepath="$PROJECT_DIR$/BeEyes.iml" />
      <module fileurl="file://$PROJECT_DIR$/QMCamera.iml" filepath="$PROJECT_DIR$/QMCamera.iml" />
      <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
      <module fileurl="file://$PROJECT_DIR$/lib-zxing/lib-zxing.iml" filepath="$PROJECT_DIR$/lib-zxing/lib-zxing.iml" />
      <module fileurl="file://$PROJECT_DIR$/library/library.iml" filepath="$PROJECT_DIR$/library/library.iml" />
    </modules>
  </component>
</project>


text:
class Admin::Shopping::Checkout::BillingAddressesController < Admin::Shopping::Checkout::BaseController
  helper_method :countries, :select_countries
  def index
    @billing_address = Address.new
    if !GlobalConstants::REQUIRE_STATE_IN_ADDRESS  && countries.size == 1
      @billing_address.country = countries.first
    end
    form_info
    respond_to do |format|
      format.html # index.html.erb
    end
  end

  def new
    old_address       = Address.find_by_id(params[:old_address_id])
    attributes        = old_address.try(:address_attributes)
    @billing_address = session_admin_cart.customer.addresses.new(attributes)
    if !GlobalConstants::REQUIRE_STATE_IN_ADDRESS  && countries.size == 1
      @billing_address.country = countries.first
    end
    form_info
    respond_to do |format|
      format.html # new.html.erb
    end
  end

  # POST /shopping/addresses
  # POST /shopping/addresses.xml
  def create
    if params[:address].present?
      @billing_address = checkout_user.addresses.new(params[:address])
      @billing_address.default = true          if checkout_user.default_billing_address.nil?
      @billing_address.billing_default = true  if checkout_user.default_billing_address.nil?
      @billing_address.save
    elsif params[:billing_address_id].present?
      @billing_address = checkout_user.addresses.find(params[:billing_address_id])
    end
    respond_to do |format|

      if @billing_address.id
        update_order_address_id(@billing_address.id)
        format.html { redirect_to(admin_shopping_checkout_order_url, :notice => 'Address was successfully created.') }
      else
        form_info
        format.html { render :action => "index" }
      end
    end
  end

  # PUT /shopping/addresses/1
  # PUT /shopping/addresses/1.xml
  def update
    @billing_address = checkout_user.addresses.new(params[:address])

    # if we are editing the current default address then this is the default address
    @billing_address.default = true if params[:id] == checkout_user.default_billing_address.try(:id)

    respond_to do |format|
      if @billing_address.valid? && @billing_address.save_default_address(checkout_user, params[:address])
        old_billing_address = checkout_user.addresses.find(params[:id])
        old_billing_address.update_attributes(:active => false)
        update_order_address_id(@billing_address.id)
        format.html { redirect_to(admin_shopping_checkout_order_url, :notice => 'Address was successfully updated.') }
      else
        @billing_address = checkout_user.addresses.find(params[:id])
        @billing_address.update_attributes(params[:address])
        @states     = State.form_selector
        format.html { render :action => "edit" }
      end
    end
  end

  def select_address
    address = checkout_user.addresses.find(params[:id])
    update_order_address_id(address.id)
    respond_to do |format|
      format.html { redirect_to admin_shopping_checkout_order_url }
    end
  end

  private

  def form_info
    @billing_addresses = session_admin_cart.customer.billing_addresses
    @states     = State.form_selector
  end
  def countries
    @countries ||= Country.active.all
  end
  def select_countries
    countries.map{|sz| [sz.name, sz.id]}
  end
  def update_order_address_id(id)
    session_admin_order.update_attributes( :bill_address_id => id )
  end
end


text:
package twitter4jads.models.ads.cards;

import com.google.gson.annotations.SerializedName;

/**
 * @author meghanajain
 */
public class TwitterLeadGenerationStat {
    @SerializedName("id")
    private String id;

    @SerializedName("start_time")
    private String startTime;

    @SerializedName("end_time")
    private String endTime;

    @SerializedName("granularity")
    private String granularity;

    @SerializedName("billed_per_card_response")
    private int[] billedPerCardResponse;

    @SerializedName("promotion_card_responses")
    private int[] promotionCardResponses;

    @SerializedName("billed_charge_local_micro")
    private int[] billedChargeLocalMicro;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public String getGranularity() {
        return granularity;
    }

    public void setGranularity(String granularity) {
        this.granularity = granularity;
    }

    public int[] getBilledPerCardResponse() {
        return billedPerCardResponse;
    }

    public void setBilledPerCardResponse(int[] billedPerCardResponse) {
        this.billedPerCardResponse = billedPerCardResponse;
    }

    public int[] getPromotionCardResponses() {
        return promotionCardResponses;
    }

    public void setPromotionCardResponses(int[] promotionCardResponses) {
        this.promotionCardResponses = promotionCardResponses;
    }

    public int[] getBilledChargeLocalMicro() {
        return billedChargeLocalMicro;
    }

    public void setBilledChargeLocalMicro(int[] billedChargeLocalMicro) {
        this.billedChargeLocalMicro = billedChargeLocalMicro;
    }
}


text:
using System;

namespace LinqToDB.DataProvider.Firebird
{
	using Mapping;
	using SqlQuery;

	public class FirebirdMappingSchema : MappingSchema
	{
		public FirebirdMappingSchema() : this(ProviderName.Firebird)
		{
		}

		protected FirebirdMappingSchema(string configuration) : base(configuration)
		{
			SetDataType(typeof(string), new SqlDataType(DataType.NVarChar, typeof(string), 255));
		}
	}
}


text:
/*Generated! Do not modify!*/ package generated.fliesenui.screen;
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/ import java.util.List;
/*Generated! Do not modify!*/ import java.util.Collection;
/*Generated! Do not modify!*/ import java.util.TreeSet;
/*Generated! Do not modify!*/ import java.util.Set;
/*Generated! Do not modify!*/ import java.util.ArrayList;
/*Generated! Do not modify!*/ import java.util.HashSet;
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/ import generated.fliesenui.core.FLUIAbstractReply;
/*Generated! Do not modify!*/ import generated.fliesenui.core.FLUIUtil;
/*Generated! Do not modify!*/ import generated.fliesenui.core.FLUIString.StringLanguage;
/*Generated! Do not modify!*/ import generated.fliesenui.core.TextHighlighting;
/*Generated! Do not modify!*/ import generated.fliesenui.core.CursorPos;
/*Generated! Do not modify!*/ import generated.fliesenui.core.ContextAssist;
/*Generated! Do not modify!*/ import generated.fliesenui.core.IDLabelImageAssetList;
/*Generated! Do not modify!*/ import generated.fliesenui.core.IDLabelList;
/*Generated! Do not modify!*/ import generated.fliesenui.core.FLUIReplyAction.ReplyActionType;
/*Generated! Do not modify!*/ import generated.fliesenui.core.InputDialogParameters;
/*Generated! Do not modify!*/ import generated.fliesenui.core.ConfirmDialogParameters;
/*Generated! Do not modify!*/ import generated.fliesenui.core.ListChooserParameters;
/*Generated! Do not modify!*/ import generated.fliesenui.core.IDLabel;
/*Generated! Do not modify!*/ import generated.fliesenui.core.IDLabelImageAsset;
/*Generated! Do not modify!*/ import generated.fliesenui.core.ListChooserItem;
/*Generated! Do not modify!*/ import generated.fliesenui.core.BrightMarkdown;
/*Generated! Do not modify!*/ import generated.fliesenui.core.FLUIMarkdownFormatting;
/*Generated! Do not modify!*/ import generated.fliesenui.core.FLUIImageAssets.ImageAsset;
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/ import generated.fliesenui.dto.DetailsParameterDTO;
/*Generated! Do not modify!*/ import generated.fliesenui.dto.DetailsParameterListDTO;
/*Generated! Do not modify!*/ import generated.fliesenui.dto.EditStateDTO;
/*Generated! Do not modify!*/ import generated.fliesenui.dto.EditStateListDTO;
/*Generated! Do not modify!*/ import generated.fliesenui.dto.IdAndLabelDTO;
/*Generated! Do not modify!*/ import generated.fliesenui.dto.IdAndLabelListDTO;
/*Generated! Do not modify!*/ import generated.fliesenui.dto.IdAndLabelListListDTO;
/*Generated! Do not modify!*/ import generated.fliesenui.dto.OverviewItemDTO;
/*Generated! Do not modify!*/ import generated.fliesenui.dto.OverviewItemListDTO;
/*Generated! Do not modify!*/ import generated.fliesenui.dto.OverviewListDTO;
/*Generated! Do not modify!*/ import generated.fliesenui.dto.OverviewListListDTO;
/*Generated! Do not modify!*/ import generated.fliesenui.dto.OverviewParameterDTO;
/*Generated! Do not modify!*/ import generated.fliesenui.dto.OverviewParameterListDTO;
/*Generated! Do not modify!*/ import generated.fliesenui.dto.DetailsParameterDTOBuilder;
/*Generated! Do not modify!*/ import generated.fliesenui.dto.DetailsParameterListDTOBuilder;
/*Generated! Do not modify!*/ import generated.fliesenui.dto.EditStateDTOBuilder;
/*Generated! Do not modify!*/ import generated.fliesenui.dto.EditStateListDTOBuilder;
/*Generated! Do not modify!*/ import generated.fliesenui.dto.IdAndLabelDTOBuilder;
/*Generated! Do not modify!*/ import generated.fliesenui.dto.IdAndLabelListDTOBuilder;
/*Generated! Do not modify!*/ import generated.fliesenui.dto.IdAndLabelListListDTOBuilder;
/*Generated! Do not modify!*/ import generated.fliesenui.dto.OverviewItemDTOBuilder;
/*Generated! Do not modify!*/ import generated.fliesenui.dto.OverviewItemListDTOBuilder;
/*Generated! Do not modify!*/ import generated.fliesenui.dto.OverviewListDTOBuilder;
/*Generated! Do not modify!*/ import generated.fliesenui.dto.OverviewListListDTOBuilder;
/*Generated! Do not modify!*/ import generated.fliesenui.dto.OverviewParameterDTOBuilder;
/*Generated! Do not modify!*/ import generated.fliesenui.dto.OverviewParameterListDTOBuilder;
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/ public class AboutReply extends FLUIAbstractReply {
/*Generated! Do not modify!*/     public AboutReply(boolean recordMode, StringLanguage currentLanguage) {
/*Generated! Do not modify!*/         super(recordMode, currentLanguage);
/*Generated! Do not modify!*/     }
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/     protected String getJSON() {
/*Generated! Do not modify!*/         return gson.toJson(replyDTO);
/*Generated! Do not modify!*/     }
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/     public void setBackButtonText(String text){
/*Generated! Do not modify!*/         replyDTO.getVariablesToSet().add("about_backButton_propertyText");
/*Generated! Do not modify!*/         if (text == null) {
/*Generated! Do not modify!*/             replyDTO.getVariableValues().remove("about_backButton_propertyText");
/*Generated! Do not modify!*/         } else {
/*Generated! Do not modify!*/             replyDTO.getVariableValues().put("about_backButton_propertyText", text);
/*Generated! Do not modify!*/         }
/*Generated! Do not modify!*/         if (recordMode){
/*Generated! Do not modify!*/             addRecordedAction("setBackButtonText(" + escapeString(text) + ");");
/*Generated! Do not modify!*/         }
/*Generated! Do not modify!*/     }
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/     public void setBackButtonVisible(boolean visible){
/*Generated! Do not modify!*/         replyDTO.getVariablesToSet().add("about_backButton_propertyVisible");
/*Generated! Do not modify!*/         replyDTO.getVariableValues().put("about_backButton_propertyVisible", visible);
/*Generated! Do not modify!*/         if (recordMode){
/*Generated! Do not modify!*/             addRecordedAction("setBackButtonVisible(" + visible + ");");
/*Generated! Do not modify!*/         }
/*Generated! Do not modify!*/     }
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/     public void setInfoText(String text){
/*Generated! Do not modify!*/         replyDTO.getVariablesToSet().add("about_info_propertyText");
/*Generated! Do not modify!*/         if (text == null) {
/*Generated! Do not modify!*/             replyDTO.getVariableValues().remove("about_info_propertyText");
/*Generated! Do not modify!*/         } else {
/*Generated! Do not modify!*/             replyDTO.getVariableValues().put("about_info_propertyText", text);
/*Generated! Do not modify!*/         }
/*Generated! Do not modify!*/         if (recordMode){
/*Generated! Do not modify!*/             addRecordedAction("setInfoText(" + escapeString(text) + ");");
/*Generated! Do not modify!*/         }
/*Generated! Do not modify!*/     }
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/     public void setInfoVisible(boolean visible){
/*Generated! Do not modify!*/         replyDTO.getVariablesToSet().add("about_info_propertyVisible");
/*Generated! Do not modify!*/         replyDTO.getVariableValues().put("about_info_propertyVisible", visible);
/*Generated! Do not modify!*/         if (recordMode){
/*Generated! Do not modify!*/             addRecordedAction("setInfoVisible(" + visible + ");");
/*Generated! Do not modify!*/         }
/*Generated! Do not modify!*/     }
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/     public void setAboutTextText(String text){
/*Generated! Do not modify!*/         setAboutTextText(text, null);
/*Generated! Do not modify!*/     }
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/     public void setAboutTextText(String text, FLUIMarkdownFormatting formatting){
/*Generated! Do not modify!*/         replyDTO.getVariablesToSet().add("about_aboutText_propertyText");
/*Generated! Do not modify!*/         if (text == null) {
/*Generated! Do not modify!*/             replyDTO.getMarkdownViewTexts().remove("aboutText");
/*Generated! Do not modify!*/             replyDTO.getVariableValues().remove("about_aboutText_propertyText");
/*Generated! Do not modify!*/         } else {
/*Generated! Do not modify!*/             String html = "";
/*Generated! Do not modify!*/             try{
/*Generated! Do not modify!*/                 BrightMarkdown markdown = new BrightMarkdown();
/*Generated! Do not modify!*/                 FLUIUtil.applyFormatting(markdown, formatting);
/*Generated! Do not modify!*/                 html = markdown.createHTML(text);
/*Generated! Do not modify!*/             } catch (Exception e){
/*Generated! Do not modify!*/                 html = "
Error: " + e + "

text:

" + text + "
";
/*Generated! Do not modify!*/             }
/*Generated! Do not modify!*/             replyDTO.getMarkdownViewTexts().put("aboutText", html);
/*Generated! Do not modify!*/             replyDTO.getVariableValues().put("about_aboutText_propertyText", html);
/*Generated! Do not modify!*/         }
/*Generated! Do not modify!*/         if (recordMode){
/*Generated! Do not modify!*/             addRecordedAction("setAboutTextText(" + escapeString(text) + ");");
/*Generated! Do not modify!*/         }
/*Generated! Do not modify!*/     }
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/     public void setAboutTextVisible(boolean visible){
/*Generated! Do not modify!*/         replyDTO.getVariablesToSet().add("about_aboutText_propertyVisible");
/*Generated! Do not modify!*/         replyDTO.getVariableValues().put("about_aboutText_propertyVisible", visible);
/*Generated! Do not modify!*/         if (recordMode){
/*Generated! Do not modify!*/             addRecordedAction("setAboutTextVisible(" + visible + ");");
/*Generated! Do not modify!*/         }
/*Generated! Do not modify!*/     }
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/ /** @param color background color in format '#aabbcc' or null for transparent/default */
/*Generated! Do not modify!*/     public void setAboutTextBackgroundColor(String color){
/*Generated! Do not modify!*/         replyDTO.getVariablesToSet().add("about_aboutText_propertyBackgroundColor");
/*Generated! Do not modify!*/         replyDTO.getVariableValues().put("about_aboutText_propertyBackgroundColor", color == null ? "" : "background: " + color);
/*Generated! Do not modify!*/         if (recordMode){
/*Generated! Do not modify!*/             addRecordedAction("setAboutTextBackgroundColor(" + escapeString(color) + ");");
/*Generated! Do not modify!*/         }
/*Generated! Do not modify!*/     }
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/     public void setBackButtonImageAsset(ImageAsset imageAsset){
/*Generated! Do not modify!*/         replyDTO.getVariablesToSet().add("about_backButton_propertyImageSource");
/*Generated! Do not modify!*/         replyDTO.getVariableValues().put("about_backButton_propertyImageSource", imageAsset.getFilename());
/*Generated! Do not modify!*/         if (recordMode){
/*Generated! Do not modify!*/             addRecordedAction(ReplyActionType.SET_IMAGE_ASSET, "setBackButtonImageAsset(", imageAsset);
/*Generated! Do not modify!*/         }
/*Generated! Do not modify!*/     }
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/     public void setParameterDTO(OverviewParameterDTO dto){
/*Generated! Do not modify!*/         replyDTO.getDTOsToSet().add("parameter");
/*Generated! Do not modify!*/         if (dto == null){
/*Generated! Do not modify!*/             replyDTO.getDTOValues().remove("parameter");
/*Generated! Do not modify!*/         } else {
/*Generated! Do not modify!*/             replyDTO.getDTOValues().put("parameter", dto);
/*Generated! Do not modify!*/         }
/*Generated! Do not modify!*/         if (recordMode){
/*Generated! Do not modify!*/             addRecordedAction(ReplyActionType.SET_DTO, "setParameterDTO(", gson.toJson(dto), getClassName(dto));
/*Generated! Do not modify!*/         }
/*Generated! Do not modify!*/     }
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/     public void openScreenAbout(OverviewParameterDTO parameter){
/*Generated! Do not modify!*/         replyDTO.setOpenParameter(parameter);
/*Generated! Do not modify!*/         replyDTO.setScreenToOpen("about");
/*Generated! Do not modify!*/         if (recordMode){
/*Generated! Do not modify!*/             addRecordedAction(ReplyActionType.OPEN_SCREEN, "openScreenAbout(", gson.toJson(parameter), getClassName(parameter));
/*Generated! Do not modify!*/         }
/*Generated! Do not modify!*/     }
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/     public void openScreenDetails(DetailsParameterDTO parameter){
/*Generated! Do not modify!*/         replyDTO.setOpenParameter(parameter);
/*Generated! Do not modify!*/         replyDTO.setScreenToOpen("details");
/*Generated! Do not modify!*/         if (recordMode){
/*Generated! Do not modify!*/             addRecordedAction(ReplyActionType.OPEN_SCREEN, "openScreenDetails(", gson.toJson(parameter), getClassName(parameter));
/*Generated! Do not modify!*/         }
/*Generated! Do not modify!*/     }
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/     public void openScreenLogin(){
/*Generated! Do not modify!*/         replyDTO.setScreenToOpen("login");
/*Generated! Do not modify!*/         if (recordMode){
/*Generated! Do not modify!*/             addRecordedAction(ReplyActionType.OPEN_SCREEN, "openScreenLogin(");
/*Generated! Do not modify!*/         }
/*Generated! Do not modify!*/     }
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/     public void openScreenMarkdownHelp(OverviewParameterDTO parameter){
/*Generated! Do not modify!*/         replyDTO.setOpenParameter(parameter);
/*Generated! Do not modify!*/         replyDTO.setScreenToOpen("markdownHelp");
/*Generated! Do not modify!*/         if (recordMode){
/*Generated! Do not modify!*/             addRecordedAction(ReplyActionType.OPEN_SCREEN, "openScreenMarkdownHelp(", gson.toJson(parameter), getClassName(parameter));
/*Generated! Do not modify!*/         }
/*Generated! Do not modify!*/     }
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/     public void openScreenOverview(OverviewParameterDTO parameter){
/*Generated! Do not modify!*/         replyDTO.setOpenParameter(parameter);
/*Generated! Do not modify!*/         replyDTO.setScreenToOpen("overview");
/*Generated! Do not modify!*/         if (recordMode){
/*Generated! Do not modify!*/             addRecordedAction(ReplyActionType.OPEN_SCREEN, "openScreenOverview(", gson.toJson(parameter), getClassName(parameter));
/*Generated! Do not modify!*/         }
/*Generated! Do not modify!*/     }
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/     public void openScreenAbout(String password) {
/*Generated! Do not modify!*/         openScreenAbout(OverviewParameterDTOBuilder.construct(password));
/*Generated! Do not modify!*/     }
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/     public void openScreenDetails(String noteName, String password) {
/*Generated! Do not modify!*/         openScreenDetails(DetailsParameterDTOBuilder.construct(noteName, password));
/*Generated! Do not modify!*/     }
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/     public void openScreenMarkdownHelp(String password) {
/*Generated! Do not modify!*/         openScreenMarkdownHelp(OverviewParameterDTOBuilder.construct(password));
/*Generated! Do not modify!*/     }
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/     public void openScreenOverview(String password) {
/*Generated! Do not modify!*/         openScreenOverview(OverviewParameterDTOBuilder.construct(password));
/*Generated! Do not modify!*/     }
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/     public AboutStringInputDialogOptions showInputDialog(String referenceID, String title, String textContent, String label, String initialValueText, String okText, String cancelText){
/*Generated! Do not modify!*/         InputDialogParameters inputDialogParameters = new InputDialogParameters();
/*Generated! Do not modify!*/         inputDialogParameters.setReferenceID(referenceID);
/*Generated! Do not modify!*/         inputDialogParameters.setTitle(title);
/*Generated! Do not modify!*/         inputDialogParameters.setTextContent(textContent);
/*Generated! Do not modify!*/         inputDialogParameters.setLabel(label);
/*Generated! Do not modify!*/         inputDialogParameters.setInitialValueText(initialValueText);
/*Generated! Do not modify!*/         inputDialogParameters.setOkText(okText);
/*Generated! Do not modify!*/         inputDialogParameters.setCancelText(cancelText);
/*Generated! Do not modify!*/         replyDTO.setInputDialogParameters(inputDialogParameters);
/*Generated! Do not modify!*/         if (recordMode){
/*Generated! Do not modify!*/         	addRecordedAction("showInputDialog(" + escapeString(referenceID) + ", " + escapeString(title) + ", " + escapeString(textContent)
/*Generated! Do not modify!*/         			+ ", " + escapeString(label) + ", " + escapeString(initialValueText) + ", " + escapeString(okText)
/*Generated! Do not modify!*/         			+ ", " + escapeString(cancelText)+ ");");
/*Generated! Do not modify!*/         }
/*Generated! Do not modify!*/         return new AboutStringInputDialogOptions(this, inputDialogParameters);
/*Generated! Do not modify!*/     }
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/     public AboutConfirmDialogOptions showConfirmDialog(String referenceID, String title, String textContent, String okText, String cancelText){
/*Generated! Do not modify!*/         ConfirmDialogParameters confirmDialogParameters = new ConfirmDialogParameters();
/*Generated! Do not modify!*/         confirmDialogParameters.setReferenceID(referenceID);
/*Generated! Do not modify!*/         confirmDialogParameters.setTitle(title);
/*Generated! Do not modify!*/         confirmDialogParameters.setTextContent(textContent);
/*Generated! Do not modify!*/         confirmDialogParameters.setOkText(okText);
/*Generated! Do not modify!*/         confirmDialogParameters.setCancelText(cancelText);
/*Generated! Do not modify!*/         replyDTO.setConfirmDialogParameters(confirmDialogParameters);
/*Generated! Do not modify!*/         if (recordMode){
/*Generated! Do not modify!*/             addRecordedAction("showConfirmDialog(" + escapeString(referenceID) + ", " + escapeString(title) + ", " + escapeString(textContent)
/*Generated! Do not modify!*/         			+ ", " + escapeString(okText) + ", " + escapeString(cancelText)+ ");");
/*Generated! Do not modify!*/         }
/*Generated! Do not modify!*/         return new AboutConfirmDialogOptions(this, confirmDialogParameters);
/*Generated! Do not modify!*/     }
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/     public AboutListChooserDialogOptions showListChooser(String referenceID, boolean multiSelect, boolean showFilter, String title, IDLabelImageAssetList items, Collection<String> selectedIDs){
/*Generated! Do not modify!*/         return showListChooser(referenceID, multiSelect, showFilter, title, DEFAULT_OK_TEXT, DEFAULT_CANCEL_TEXT, items, selectedIDs);
/*Generated! Do not modify!*/     }
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/     public AboutListChooserDialogOptions showListChooser(String referenceID, boolean multiSelect, boolean showFilter, String title, IDLabelList items, Collection<String> selectedIDs){
/*Generated! Do not modify!*/         return showListChooser(referenceID, multiSelect, showFilter, title, DEFAULT_OK_TEXT, DEFAULT_CANCEL_TEXT, items, selectedIDs);
/*Generated! Do not modify!*/     }
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/     public AboutListChooserDialogOptions showListChooser(String referenceID, boolean multiSelect, boolean showFilter, String title, String okText, String cancelText, IDLabelImageAssetList items, Collection<String> selectedIDs){
/*Generated! Do not modify!*/     	ListChooserParameters parameters = createListChooserParameters(referenceID, multiSelect, showFilter, title, okText, cancelText);
/*Generated! Do not modify!*/     	Set<String> selectedIDsSet = new HashSet<String>();
/*Generated! Do not modify!*/     	if (selectedIDs != null){
/*Generated! Do not modify!*/     		selectedIDsSet = new HashSet<String>(selectedIDs);
/*Generated! Do not modify!*/     	}
/*Generated! Do not modify!*/     	List<ListChooserItem> chooserItems = new ArrayList<ListChooserItem>();
/*Generated! Do not modify!*/     	for (IDLabelImageAsset i: items.getItems()){
/*Generated! Do not modify!*/     		chooserItems.add(createItem(i.getID(), i.getLabel(), i.getImageAssetID(), selectedIDsSet.contains(i.getID())));
/*Generated! Do not modify!*/     	}
/*Generated! Do not modify!*/     	parameters.setShowIcons(true);
/*Generated! Do not modify!*/     	parameters.setItems(chooserItems);
/*Generated! Do not modify!*/     	replyDTO.setListChooserParameters(parameters);
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/         if (recordMode){
/*Generated! Do not modify!*/             addRecordedAction(ReplyActionType.SHOW_LIST_CHOOSER_IMGS, "showListChooser(" + escapeString(referenceID) + ", " + multiSelect + ", " + showFilter + ", " + escapeString(title)
/*Generated! Do not modify!*/         			+ ", " + escapeString(okText) + ", " + escapeString(cancelText) + ", ", gson.toJson(items), selectedIDs);
/*Generated! Do not modify!*/         }
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/         return new AboutListChooserDialogOptions(this, parameters);
/*Generated! Do not modify!*/     }
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/     public AboutListChooserDialogOptions showListChooser(String referenceID, boolean multiSelect, boolean showFilter, String title, String okText, String cancelText, IDLabelList items, Collection<String> selectedIDs){
/*Generated! Do not modify!*/     	ListChooserParameters parameters = createListChooserParameters(referenceID, multiSelect, showFilter, title, okText, cancelText);
/*Generated! Do not modify!*/     	Set<String> selectedIDsSet = new HashSet<String>();
/*Generated! Do not modify!*/     	if (selectedIDs != null){
/*Generated! Do not modify!*/     		selectedIDsSet = new HashSet<String>(selectedIDs);
/*Generated! Do not modify!*/     	}
/*Generated! Do not modify!*/     	List<ListChooserItem> chooserItems = new ArrayList<ListChooserItem>();
/*Generated! Do not modify!*/     	for (IDLabel i: items.getItems()){
/*Generated! Do not modify!*/     		chooserItems.add(createItem(i.getID(), i.getLabel(), null, selectedIDsSet.contains(i.getID())));
/*Generated! Do not modify!*/     	}
/*Generated! Do not modify!*/     	parameters.setShowIcons(false);
/*Generated! Do not modify!*/     	parameters.setItems(chooserItems);
/*Generated! Do not modify!*/     	replyDTO.setListChooserParameters(parameters);
/*Generated! Do not modify!*/         if (recordMode){
/*Generated! Do not modify!*/         	addRecordedAction(ReplyActionType.SHOW_LIST_CHOOSER_TEXTS, "showListChooser(" + escapeString(referenceID) + ", " + multiSelect + ", " + showFilter + ", " + escapeString(title)
/*Generated! Do not modify!*/         			+ ", " + escapeString(okText) + ", " + escapeString(cancelText) + ", ", gson.toJson(items), selectedIDs);
/*Generated! Do not modify!*/         }
/*Generated! Do not modify!*/         return new AboutListChooserDialogOptions(this, parameters);
/*Generated! Do not modify!*/ }
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/     private ListChooserParameters createListChooserParameters(String referenceID, boolean multiSelect, boolean showFilter, String title, String okText, String cancelText) {
/*Generated! Do not modify!*/         ListChooserParameters parameters = new ListChooserParameters();
/*Generated! Do not modify!*/         parameters.setReferenceID(referenceID);
/*Generated! Do not modify!*/         parameters.setMultiSelect(multiSelect);
/*Generated! Do not modify!*/         parameters.setShowFilter(showFilter);
/*Generated! Do not modify!*/         parameters.setTitle(title);
/*Generated! Do not modify!*/         parameters.setOkText(okText);
/*Generated! Do not modify!*/         parameters.setCancelText(cancelText);
/*Generated! Do not modify!*/         return parameters;
/*Generated! Do not modify!*/     }
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/     private ListChooserItem createItem(String id, String label, String imageAssetID, boolean selected) {
/*Generated! Do not modify!*/         ListChooserItem result = new ListChooserItem();
/*Generated! Do not modify!*/         result.setID(id);
/*Generated! Do not modify!*/         result.setLabel(label);
/*Generated! Do not modify!*/         result.setImageAssetID(imageAssetID);
/*Generated! Do not modify!*/         result.setSelected(selected);
/*Generated! Do not modify!*/         return result;
/*Generated! Do not modify!*/     }
/*Generated! Do not modify!*/
/*Generated! Do not modify!*/ }


text:
module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    module Integrations #:nodoc:
      module Bogus
        autoload :Return, 'active_merchant/billing/integrations/bogus/return.rb'
        autoload :Helper, 'active_merchant/billing/integrations/bogus/helper.rb'
        autoload :Notification, 'active_merchant/billing/integrations/bogus/notification.rb'

        mattr_accessor :service_url
        self.service_url = 'http://www.bogus.com'

        def self.notification(post)
          Notification.new(post)
        end

        def self.return(query_string)
          Return.new(query_string)
        end
      end
    end
  end
end


text:
#include "config.h"
#include "CookieJar.h"

#include "Cookie.h"
#include "Document.h"
#include "FrameLoaderClientQt.h"
#include "KURL.h"
#include "NetworkingContext.h"
#include "PlatformString.h"
#include "qwebframe.h"
#include "qwebpage.h"
#include <QNetworkAccessManager>
#include <QNetworkCookie>
#include <QStringList>

namespace WebCore {

static QNetworkCookieJar *cookieJar(const Document *document)
{
    if (!document)
        return 0;
    Frame* frame = document->frame();
    if (!frame)
        return 0;
    FrameLoader* loader = frame->loader();
    if (!loader)
        return 0;
    QNetworkAccessManager* manager = loader->networkingContext()->networkAccessManager();
    QNetworkCookieJar* jar = manager->cookieJar();
    return jar;
}

void setCookies(Document* document, const KURL& url, const String& value)
{
    QUrl u(url);
    QUrl p(document->firstPartyForCookies());
    QNetworkCookieJar* jar = cookieJar(document);
    if (!jar)
        return;

    QList<QNetworkCookie> cookies = QNetworkCookie::parseCookies(QString(value).toAscii());
    QList<QNetworkCookie>::Iterator it = cookies.begin();
    while (it != cookies.end()) {
        if (it->isHttpOnly())
            it = cookies.erase(it);
        else
            ++it;
    }
    jar->setCookiesFromUrl(cookies, u);
}

String cookies(const Document* document, const KURL& url)
{
    QUrl u(url);
    QNetworkCookieJar* jar = cookieJar(document);
    if (!jar)
        return String();

    QList<QNetworkCookie> cookies = jar->cookiesForUrl(u);
    if (cookies.isEmpty())
        return String();

    QStringList resultCookies;
    foreach (QNetworkCookie networkCookie, cookies) {
        if (networkCookie.isHttpOnly())
            continue;
        resultCookies.append(QString::fromLatin1(networkCookie.toRawForm(QNetworkCookie::NameAndValueOnly).constData()));
    }

    return resultCookies.join(QLatin1String("; "));
}

String cookieRequestHeaderFieldValue(const Document* document, const KURL &url)
{
    QUrl u(url);
    QNetworkCookieJar* jar = cookieJar(document);
    if (!jar)
        return String();

    QList<QNetworkCookie> cookies = jar->cookiesForUrl(u);
    if (cookies.isEmpty())
        return String();

    QStringList resultCookies;
    foreach (QNetworkCookie networkCookie, cookies)
        resultCookies.append(QString::fromLatin1(networkCookie.toRawForm(QNetworkCookie::NameAndValueOnly).constData()));

    return resultCookies.join(QLatin1String("; "));
}

bool cookiesEnabled(const Document* document)
{
    QNetworkCookieJar* jar = cookieJar(document);
    return jar;
}

bool getRawCookies(const Document*, const KURL&, Vector<Cookie>& rawCookies)
{
    // FIXME: Not yet implemented
    rawCookies.clear();
    return false; // return true when implemented
}

void deleteCookie(const Document*, const KURL&, const String&)
{
    // FIXME: Not yet implemented
}

void getHostnamesWithCookies(HashSet<String>& hostnames)
{
    // FIXME: Not yet implemented
}

void deleteCookiesForHostname(const String& hostname)
{
    // FIXME: Not yet implemented
}

void deleteAllCookies()
{
    // FIXME: Not yet implemented
}

}

// vim: ts=4 sw=4 et


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package daoInterfaces;

import entidades.Contaslog;
import java.util.List;

/**
 *
 * @author alexandre
 */
public interface ContaslogInterface {

    public Contaslog ListarPorId  (int id);
    public List<Contaslog> ListarPorTipo(String tipo);
    public List<Contaslog> ListarTodas  ();
}


text:
class CloudFile < ActiveRecord::Base
  attr_accessible :name, :asset

  mount_uploader :asset, CloudFileUploader

  validates :name, :asset, :presence => true

  before_create :save_metadata
  private
    def save_metadata
      self.content_type = asset.file.content_type
      self.file_size = asset.file.size
    end
end


text:
using Microsoft.DataTransfer.Basics;

namespace Microsoft.DataTransfer.WpfHost.Basics.Controls.EditableItemsList
{
    sealed class AddItemCommand<T> : EditItemsCollectionCommandBase<T>
    {
        private readonly ISingleItemProvider<T> itemProvider;

        public AddItemCommand(ISingleItemProvider<T> itemProvider)
        {
            Guard.NotNull("itemProvider", itemProvider);

            this.itemProvider = itemProvider;
        }

        public override void Execute(object parameter)
        {
            var item = itemProvider.GetItem();
            if (item == null)
                return;

            Items.Add(item);
            itemProvider.SetItem(default(T));
        }
    }
}


text:
from collections import OrderedDict, defaultdict
import itertools

import networkx as nx
from networkx.algorithms import isomorphism
import parmed.periodic_table as pt

from foyer.smarts import SMARTS

class SMARTSGraph(nx.Graph):
    """A graph representation of a SMARTS pattern.

    Attributes
    ----------
    smarts_string : str
        The SMARTS string outlined in the force field
    parser : foyer.smarts.SMARTS
        The parser whose grammar rules convert the SMARTSstring
        into the AST
    name : str
    overrides : set
        Rules or SMARTSGraph over which this SMARTSGraph takes precedence

    Other Parameters
    ----------
    args
    kwargs

    Attributes
    ----------
    graph_matcher : smarts_graph.SMARTSMatcher
        implementation of VF2 that handles subgraph matching
    """
    # Because the first atom in a SMARTS string is always the one we want to
    # type, the graph's nodes needs to be ordered.

    def __init__(self, smarts_string, parser=None, name=None, overrides=None,
                typemap=None,
                 *args, **kwargs):
        super(SMARTSGraph, self).__init__(*args, **kwargs)

        self.smarts_string = smarts_string
        self.name = name
        self.overrides = overrides
        self.typemap = typemap

        if parser is None:
            self.ast = SMARTS().parse(smarts_string)
        else:
            self.ast = parser.parse(smarts_string)

        self._atom_indices = OrderedDict()
        self._add_nodes()
        self._add_edges(self.ast)
        self._add_label_edges()
        self._graph_matcher = None

    def _add_nodes(self):
        """Add all atoms in the SMARTS string as nodes in the graph."""
        for n, atom in enumerate([x for x in self.ast.iter_subtrees_topdown() if x.data == 'atom']):
            self.add_node(n, atom=atom)
            self._atom_indices[id(atom)] = n

    def _add_edges(self, ast_node, trunk=None):
        """"Add all bonds in the SMARTS string as edges in the graph."""
        atom_indices = self._atom_indices
        for ast_child in ast_node.children:
            if ast_child.data == 'atom':
                atom_idx = atom_indices[id(ast_child)]
                if trunk is not None:
                    trunk_idx = atom_indices[id(trunk)]
                    self.add_edge(atom_idx, trunk_idx)
                trunk = ast_child
            elif ast_child.data == 'branch':
                self._add_edges(ast_child, trunk)

    def _add_label_edges(self):
        """Add edges between all atoms with the same atom_label in rings."""
        # We need each individual label and atoms with multiple ring labels
        # would yield e.g. the string '12' so split those up.
        label_digits = defaultdict(list)
        for node, attr in self.nodes(data=True):
            atom = attr["atom"]
            for label in atom.find_data("atom_label"):
                digits = list(label.children[0])
                for digit in digits:
                    label_digits[digit].append(atom)

        for label, (atom1, atom2) in label_digits.items():
            atom1_idx = self._atom_indices[id(atom1)]
            atom2_idx = self._atom_indices[id(atom2)]
            self.add_edge(atom1_idx, atom2_idx)

    def _node_match(self, host, pattern):
        """ Determine if two graph nodes are equal """
        atom_expr = pattern['atom'].children[0]
        atom = host['atom_data']
        bond_partners = host['bond_partners']
        return self._atom_expr_matches(atom_expr, atom, bond_partners)

    def _atom_expr_matches(self, atom_expr, atom, bond_partners):
        """ Helper function for evaluating SMARTS string expressions """
        if atom_expr.data == 'not_expression':
            return not self._atom_expr_matches(atom_expr.children[0], atom, bond_partners)
        elif atom_expr.data in ('and_expression', 'weak_and_expression'):
            return (self._atom_expr_matches(atom_expr.children[0], atom, bond_partners) and
                    self._atom_expr_matches(atom_expr.children[1], atom, bond_partners))
        elif atom_expr.data == 'or_expression':
            return (self._atom_expr_matches(atom_expr.children[0], atom, bond_partners) or
                    self._atom_expr_matches(atom_expr.children[1], atom, bond_partners))
        elif atom_expr.data == 'atom_id':
            return self._atom_id_matches(atom_expr.children[0], atom, bond_partners, self.typemap)
        elif atom_expr.data == 'atom_symbol':
            return self._atom_id_matches(atom_expr, atom, bond_partners, self.typemap)
        else:
            raise TypeError('Expected atom_id, atom_symbol, and_expression, '
                            'or_expression, or not_expression. '
                            'Got {}'.format(atom_expr.data))

    @staticmethod
    def _atom_id_matches(atom_id, atom, bond_partners, typemap):
        """ Helper func for comparing atomic indices, symbols, neighbors, rings """
        atomic_num = atom.atomic_number
        atom_name = atom.name
        atom_idx = atom.index

        if atom_id.data == 'atomic_num':
            return atomic_num == int(atom_id.children[0])
        elif atom_id.data == 'atom_symbol':
            if str(atom_id.children[0]) == '*':
                return True
            elif str(atom_id.children[0]).startswith('_'):
                # Store non-element elements in .name
                return atom_name == str(atom_id.children[0])
            else:
                return atomic_num == pt.AtomicNum[str(atom_id.children[0])]
        elif atom_id.data == 'has_label':
            label = atom_id.children[0][1:]  # Strip the % sign from the beginning.
            return label in typemap[atom_idx]['whitelist']
        elif atom_id.data == 'neighbor_count':
            return len(bond_partners) == int(atom_id.children[0])
        elif atom_id.data == 'ring_size':
            cycle_len = int(atom_id.children[0])
            for cycle in typemap[atom_idx]['cycles']:
                if len(cycle) == cycle_len:
                    return True
            return False
        elif atom_id.data == 'ring_count':
            n_cycles = len(typemap[atom_idx]['cycles'])
            if n_cycles == int(atom_id.children[0]):
                return True
            return False
        elif atom_id.data == 'matches_string':
            raise NotImplementedError('matches_string is not yet implemented')

    def find_matches(self, topology_graph, typemap):
        """Return sets of atoms that match this SMARTS pattern in a topology.

        Notes:
        ------
        When this function gets used in atomtyper.py, we actively modify the
        white- and blacklists of the atoms in `topology` after finding a match.
        This means that between every successive call of
        `subgraph_isomorphisms_iter()`, the topology against which we are
        matching may have actually changed. Currently, we take advantage of this
        behavior in some edges cases (e.g. see `test_hexa_coordinated` in
        `test_smarts.py`).

        """
        # Note: Needs to be updated in sync with the grammar in `smarts.py`.
        ring_tokens = ['ring_size', 'ring_count']
        has_ring_rules = any(list(self.ast.find_data(token))
                             for token in ring_tokens)
        topology_graph.add_bond_partners()
        _prepare_atoms(topology_graph, typemap, compute_cycles=has_ring_rules)

        if self._graph_matcher is None:
            atom = nx.get_node_attributes(self, name='atom')[0]
            if len(list(atom.find_data('atom_symbol'))) == 1 and \
                        not list(atom.find_data('not_expression')):
                try:
                    element = next(atom.find_data('atom_symbol')).children[0]
                except IndexError:
                    try:
                        atomic_num = next(atom.find_data('atomic_num')).children[0]
                        element = pt.Element[int(atomic_num)]
                    except IndexError:
                        element = None
            else:
                element = None
            self._graph_matcher = SMARTSMatcher(topology_graph, self,
                                                node_match=self._node_match,
                                                element=element,
                                                typemap=typemap)

        matched_atoms = set()
        for mapping in self._graph_matcher.subgraph_isomorphisms_iter():
            mapping = {node_id: atom_id for atom_id, node_id in mapping.items()}
            # The first node in the smarts graph always corresponds to the atom
            # that we are trying to match.
            atom_index = mapping[0]
            # Don't yield duplicate matches found via matching the pattern in a
            # different order.
            if atom_index not in matched_atoms:
                matched_atoms.add(atom_index)
                yield atom_index

class SMARTSMatcher(isomorphism.vf2userfunc.GraphMatcher):
    """ Inherits and implements VF2 for a SMARTSGraph"""
    def __init__(self, G1, G2, node_match, element, typemap):
        super(SMARTSMatcher, self).__init__(G1, G2, node_match)
        self.element = element
        # TODO: Parse out nodes containing other elements (see git history)
        self.valid_nodes = G1.nodes()

    def candidate_pairs_iter(self):
        """Iterator over candidate pairs of nodes in G1 and G2."""
        # All computations are done using the current state!
        G2_nodes = self.G2_nodes

        # First we compute the inout-terminal sets.
        T1_inout = set(self.inout_1.keys()) - set(self.core_1.keys())
        T2_inout = set(self.inout_2.keys()) - set(self.core_2.keys())

        # If T1_inout and T2_inout are both nonempty.
        # P(s) = T1_inout x {min T2_inout}
        if T1_inout and T2_inout:
            for node in T1_inout:
                yield node, min(T2_inout)
        else:
            # First we determine the candidate node for G2
            other_node = min(G2_nodes - set(self.core_2))
            host_nodes = self.valid_nodes if other_node == 0 else self.G1.nodes()
            for node in host_nodes:
                if node not in self.core_1:
                    yield node, other_node

        # For all other cases, we don't have any candidate pairs.

def _find_chordless_cycles(bond_graph, max_cycle_size):
    """Find all chordless cycles (i.e. rings) in the bond graph

    Traverses the bond graph to determine all cycles (i.e. rings) each
    atom is contained within. Algorithm has been adapted from:
    https://stackoverflow.com/questions/4022662/find-all-chordless-cycles-in-an-undirected-graph/4028855#4028855
    """
    cycles = [[] for _ in bond_graph.nodes]

    '''
    For all nodes we need to find the cycles that they are included within.
    '''
    for i, node in enumerate(bond_graph.nodes):
        neighbors = list(bond_graph.neighbors(node))
        pairs = list(itertools.combinations(neighbors, 2))
        '''
        Loop over all pairs of neighbors of the node. We will see if a ring
        exists that includes these branches.
        '''
        for pair in pairs:
            '''
            We need to store all node sequences that could be rings. We will
            update this as we traverse the graph.
            '''
            connected = False
            possible_rings = []

            last_node = pair[0]
            ring = [last_node, node, pair[1]]
            possible_rings.append(ring)

            if bond_graph.has_edge(last_node, pair[1]):
                cycles[i].append(ring)
                connected = True

            while not connected:
                '''
                Branch and create a new list of possible rings
                '''
                new_possible_rings = []
                for possible_ring in possible_rings:
                    next_neighbors = list(bond_graph.neighbors(possible_ring[-1]))
                    for next_neighbor in next_neighbors:
                        if next_neighbor != possible_ring[-2]:
                            new_possible_rings.append(possible_ring + \
                                                      [next_neighbor])
                possible_rings = new_possible_rings

                for possible_ring in possible_rings:
                    if bond_graph.has_edge(possible_ring[-1], last_node):
                        if any([bond_graph.has_edge(possible_ring[-1],
                                internal_node)
                                for internal_node in possible_ring[1:-2]]):
                            pass
                        else:
                            cycles[i].append(possible_ring)
                            connected = True

                if not possible_rings or len(possible_rings[0]) == max_cycle_size:
                    break

    return cycles

def _prepare_atoms(topology_graph, typemap, compute_cycles=False):
    """Compute cycles and add white-/blacklists to atoms."""
    atom1 = next(topology_graph.atoms(data=False)) #next(topology.atoms())
    has_whitelists = 'whitelist' in typemap[atom1]
    has_cycles = 'cycles' in typemap[atom1]
    compute_cycles = compute_cycles and not has_cycles

    if compute_cycles or not has_whitelists:
        for index in topology_graph.atoms(data=False):
            if compute_cycles:
                typemap[index]['cycles'] = set()
            if not has_whitelists:
                typemap[index]['whitelist'] = set()
                typemap[index]['blacklist'] = set()

    if compute_cycles:
        all_cycles = _find_chordless_cycles(topology_graph, max_cycle_size=8)
        for atom, cycles in zip(topology_graph.nodes, all_cycles):
            for cycle in cycles:
                typemap[atom]['cycles'].add(tuple(cycle))


text:
module ShootR.Server {

    export class PayloadDecompressor {
        public PayloadContract: any;
        public CollidableContract: any;
        public ShipContract: any;
        public BulletContract: any;
        public LeaderboardEntryContract: any;
        public PowerupContract: any;

        constructor(contracts: any) {
            this.PayloadContract = contracts.PayloadContract;
            this.CollidableContract = contracts.CollidableContract;
            this.ShipContract = contracts.ShipContract;
            this.BulletContract = contracts.BulletContract;
            this.LeaderboardEntryContract = contracts.LeaderboardEntryContract;
            this.PowerupContract = contracts.PowerupContract;
        }

        private DecompressCollidable(obj: any[]): ICollidableData {
            return {
                Collided: !!obj[this.CollidableContract.Collided],
                CollidedAt: new eg.Vector2d(obj[this.CollidableContract.CollidedAtX], obj[this.CollidableContract.CollidedAtY]),
                MovementController: {
                    Forces: new eg.Vector2d(obj[this.CollidableContract.ForcesX], obj[this.CollidableContract.ForcesY]),
                    Mass: obj[this.CollidableContract.Mass],
                    Position: new eg.Vector2d(obj[this.CollidableContract.PositionX], obj[this.CollidableContract.PositionY]),
                    Rotation: obj[this.CollidableContract.Rotation] * .0174532925,
                    Velocity: new eg.Vector2d(obj[this.CollidableContract.VelocityX], obj[this.CollidableContract.VelocityY])
                },
                LifeController: {
                    Alive: obj[this.CollidableContract.Alive],
                    Health: obj[this.CollidableContract.Health]
                },
                ID: obj[this.CollidableContract.ID],
                Disposed: !!obj[this.CollidableContract.Disposed]
            };
        }

        private DecompressShip(ship: any): IShipData {
            var result: IShipData = <IShipData>this.DecompressCollidable(ship);

            result.MovementController.Position = result.MovementController.Position.Add(Ship.SIZE.Multiply(.5));

            result.MovementController.Moving = {
                RotatingLeft: !!ship[this.ShipContract.RotatingLeft],
                RotatingRight: !!ship[this.ShipContract.RotatingRight],
                Forward: !!ship[this.ShipContract.Forward],
                Backward: !!ship[this.ShipContract.Backward]
            };

            result.Name = ship[this.ShipContract.Name];
            result.MaxLife = ship[this.ShipContract.MaxLife];
            result.Level = ship[this.ShipContract.Level];
            result.Abilities = {
                Boost: ship[this.ShipContract.Boost]
            };

            return result;
        }

        private DecompressBullet(bullet: any): IBulletData {
            var result: IBulletData = <IBulletData>this.DecompressCollidable(bullet);

            result.DamageDealt = bullet[this.BulletContract.DamageDealt];

            return result;
        }

        private DecompressLeaderboardEntry(data: any): ILeaderboardEntryData {
            return {
                Name: data[this.LeaderboardEntryContract.Name],
                Photo: data[this.LeaderboardEntryContract.Photo],
                ID: data[this.LeaderboardEntryContract.ID],
                Level: data[this.LeaderboardEntryContract.Level],
                Kills: data[this.LeaderboardEntryContract.Kills],
                Deaths: data[this.LeaderboardEntryContract.Deaths],
                Position: 0
            };
        }

        private DecompressPowerup(data: any): IPowerupData {
            return {
                MovementController: {
                    Position: new eg.Vector2d(data[this.PowerupContract.PositionX] + HealthPack.SIZE.HalfWidth, data[this.PowerupContract.PositionY] + HealthPack.SIZE.HalfHeight),
                    Rotation: 0
                },
                ID: data[this.PowerupContract.ID],
                Disposed: data[this.PowerupContract.Disposed],
                Type: data[this.PowerupContract.Type],
                LifeController: {
                    Alive: true,
                    Health: 0
                }
            };
        }

        public DecompressPayload(data: any): IPayloadData {
            return {
                Ships: data[this.PayloadContract.Ships],
                LeaderboardPosition: data[this.PayloadContract.LeaderboardPosition],
                Kills: data[this.PayloadContract.Kills],
                Deaths: data[this.PayloadContract.Deaths],
                Powerups: data[this.PayloadContract.Powerups],
                Bullets: data[this.PayloadContract.Bullets],
                ShipsInWorld: data[this.PayloadContract.ShipsInWorld],
                BulletsInWorld: data[this.PayloadContract.BulletsInWorld],
                Experience: data[this.PayloadContract.Experience],
                ExperienceToNextLevel: data[this.PayloadContract.ExperienceToNextLevel],
                Notification: data[this.PayloadContract.Notification],
                LastCommandProcessed: data[this.PayloadContract.LastCommandProcessed],
                KilledByName: data[this.PayloadContract.KilledByName],
                KilledByPhoto: data[this.PayloadContract.KilledByPhoto]
            };
        }

        public DecompressLeaderboard(data: any): ILeaderboardEntryData[] {
            var payload: ILeaderboardEntryData[] = [];

            for (var i = 0; i < data.length; i++) {
                var item = this.DecompressLeaderboardEntry(data[i]);
                item.Position = i + 1;

                payload.push(item);
            }

            return payload;
        }

        public Decompress(data: any): IPayloadData {
            var payload: IPayloadData = this.DecompressPayload(data),
                i: number = 0;

            for (i = 0; i < payload.Ships.length; i++) {
                payload.Ships[i] = this.DecompressShip(payload.Ships[i]);
            }

            for (i = 0; i < payload.Bullets.length; i++) {
                payload.Bullets[i] = this.DecompressBullet(payload.Bullets[i]);
            }

            for (i = 0; i < payload.Powerups.length; i++) {
                payload.Powerups[i] = this.DecompressPowerup(payload.Powerups[i]);
            }

            return payload;
        }
    }

}


text: UPDATE groups SET rules=CONCAT(rules, ',Addons:ViewDeleted') WHERE name = 'Staff';


text:
from django.contrib.admin.views.decorators import staff_member_required
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template.context import RequestContext

from courant.core.siteconfig.models import SiteConfiguration

@staff_member_required
def site_settings(request, form_class,
                  template_name="siteconfig/settings.html",
                  extra_context={}):
    """
    Provides a front-end for customizing Review Board settings.
    """
    siteconfig = SiteConfiguration.objects.get_current()

    if request.method == "POST":
        form = form_class(siteconfig, request.POST, request.FILES)

        if form.is_valid():
            form.save()
            return HttpResponseRedirect(".?saved=1")
    else:
        form = form_class(siteconfig)

    context = {
        'form': form,
        'saved': request.GET.get('saved', 0)
    }
    context.update(extra_context)

    return render_to_response(template_name, RequestContext(request, context))


text:
Knative Eventing has many pieces. Many of those pieces run Kubernetes Pods,
meaning they run as Kubernetes ServiceAccounts. This document describes Knative
Eventing's recommended use and re-use of ServiceAccounts.

## General Philosophy

Knative Eventing's general philosophy is that it is easier to merge
ServiceAccounts than to split them. So if undecided about what to do, err on the
side of finer grained permissions.

## Trade offs

### Finer Grained Permissions

**Pros**:

- Mistakes are more bounded in the amount of damage they can do.
- Easier to track which component caused a particular change.

**Cons**:

- More complex to manage. There are more entities in the system and each one
  must be kept up to date.
- When debugging, there is much more that you will need to be aware of.

## Core

Core pieces of Knative Eventing MUST use distinct ServiceAccounts for every
binary and MUST give each of those ServiceAccounts minimal RBAC permissions.

When multiple logical pieces are combined into a single binary, they have only
one ServiceAccount. E.g. the Eventing Controller has multiple logical
controllers inside it. It could be split into separate binaries, but that would
drastically increase the resource requirements to run Knative Eventing.

The reasoning behind fine grained permissions is that the core is required for
all users of Knative Eventing. Some users will want fine grained permissions. In
addition, the Knative team can do most of the work necessary for these
permissions so that users don't need to think about them.

The following pieces are all considered part of the 'core':

- Eventing Controller
  - Broker Controller
  - Default Channel Controller
  - Subscription Controller
  - Trigger Controller
- Eventing Webhook
- Broker `Deployments` (both Ingress and Filter)

## Channels

Distinct Channel types SHOULD use different ServiceAccounts. Further, each
Channel type SHOULD use different ServiceAccounts for their control plane and
data plane Pods.

All existing Channel implementations use two binaries, controller and
dispatcher. They all have distinct ServiceAccounts for each, as they require
distinct permissions. In the future, this may be broken down even further by
splitting the dispatcher into receiving and emitting binaries. If they require
distinct permissions, then they SHOULD use different ServiceAccounts, each
scoped to the exact set of permissions required.

## Sources

Sources are different, because unlike [Core](#core) and [Channels](#channels)
event consumers are expected to both create and manage many different Sources.
So the cost of distinct ServiceAccounts is more pronounced.

Most Event Source CRDs have two components: control plane and data plane.
control plane ServiceAccounts SHOULD be unique to that Event Source CRD. The
control plane and data plane SHOULD NOT use the same ServiceAccount. If the data
plane needs no Kubernetes permissions, then it MAY use the `default`
ServiceAccount.

Most Event Source's data plane component do not need any Kubernetes level
permission, and thus MAY use `default`.

Event Sources MUST NOT require RBAC permissions be granted to the `default`
ServiceAccount. If a permission is required, then the Event Source MUST use a
ServiceAccount other than `default` or allow the user to specify the
ServiceAccount to be used.


text:
namespace media {

// static
scoped_ptr<VideoCaptureDeviceFactory> VideoCaptureDeviceFactory::CreateFactory(
    scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) {
  const base::CommandLine* command_line =
      base::CommandLine::ForCurrentProcess();
  // Use a Fake or File Video Device Factory if the command line flags are
  // present, otherwise use the normal, platform-dependent, device factory.
  if (command_line->HasSwitch(switches::kUseFakeDeviceForMediaStream)) {
    if (command_line->HasSwitch(switches::kUseFileForFakeVideoCapture)) {
      return scoped_ptr<VideoCaptureDeviceFactory>(new
          media::FileVideoCaptureDeviceFactory());
    } else {
      return scoped_ptr<VideoCaptureDeviceFactory>(new
          media::FakeVideoCaptureDeviceFactory());
    }
  } else {
    // |ui_task_runner| is needed for the Linux ChromeOS factory to retrieve
    // screen rotations and for the Mac factory to run QTKit device enumeration.
    return scoped_ptr<VideoCaptureDeviceFactory>(
        CreateVideoCaptureDeviceFactory(ui_task_runner));
  }
}

VideoCaptureDeviceFactory::VideoCaptureDeviceFactory() {
  thread_checker_.DetachFromThread();
}

VideoCaptureDeviceFactory::~VideoCaptureDeviceFactory() {}

void VideoCaptureDeviceFactory::EnumerateDeviceNames(const base::Callback<
    void(scoped_ptr<media::VideoCaptureDevice::Names>)>& callback) {
  DCHECK(thread_checker_.CalledOnValidThread());
  DCHECK(!callback.is_null());
  scoped_ptr<VideoCaptureDevice::Names> device_names(
      new VideoCaptureDevice::Names());
  GetDeviceNames(device_names.get());
  callback.Run(device_names.Pass());
}

#if !defined(OS_MACOSX) && !defined(OS_LINUX) && !defined(OS_ANDROID) && !defined(OS_WIN) && !defined(OS_FREEBSD)
// static
VideoCaptureDeviceFactory*
VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory(
    scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) {
  NOTIMPLEMENTED();
  return NULL;
}
#endif

}  // namespace media


text:
#import <CoreObject/CoreObject.h>
#import "COMergeInfo.h"

@interface COMergeInfo ()
@end

@implementation COMergeInfo

@synthesize baseRevision, mergeSourceRevision, mergeDestinationRevision, diff;

@end


text:
FactoryGirl.define do
  factory :state do
    name "United States"
    country_code "us"
    population 300000000
    population_growth 0.03
    internet_penetration 0.8
    association :economy, factory: :economy
    association :army, factory: :army
    association :navy, factory: :navy
    association :airforce, factory: :airforce
    association :goodness_index, factory: :goodness_index
  end

  factory :china, class: State do
    name "China"
    country_code "ch"
    population 1300000000
    population_growth 0.01
    internet_penetration 0.6
    association :goodness_index, factory: :goodness_index, overall_rank: 2
  end

  factory :power_model, class: Power do
    raw_economic_score 0
    raw_military_score 0
    raw_soft_score 0
    raw_population_score 0
    association :state, factory: :state
  end

  factory :power_model_prefilled, class: Power do
    raw_economic_score 1000000000
    raw_military_score 12456789
    raw_soft_score 35
    raw_population_score 323000000
    association :state, factory: :state
  end

  factory :economy do
    gdp_ppp 16000000000000
    gdp_per_capita 43000
    gdp_growth 0.02
  end

  factory :army do
    tanks 8500
    active_troops 1300000
    reserve_troops 500000
    paramilitary_troops 20000
  end

  factory :navy do
    aircraft_carriers 10
    amphibious_ships 30
    cruisers 60
    destroyers 45
    frigates 20
    corvettes 1
    patrol_boats 0
    nuclear_submarines 71
    submarines 2
    combat_aircraft 600
    attack_helicopters 1000
    nuclear_weapons 7700
  end

  factory :airforce do
    fighters 6000
    bombers 800
    helicopters 800
  end

  factory :goodness_index do
    overall_rank 1
  end

  factory :mnc do
    rank 1
    association :state, factory: :state
  end
end


text:
unsigned char* imgDataPtrFromCvMatPtrAddr(long long cvMatPtrAddr,
										  int *w = 0x00, int *h = 0x00, int *chan = 0x00);

void checkGLError(const char *msg);

float getMsFromClockDiff(clock_t t1, clock_t t2);

#endif


text:
using System;
using System.Globalization;
using System.Reflection;

namespace BLToolkit.Reflection
{
	/// <Summary>
	/// Selects a member from a list of candidates, and performs type conversion
	/// from actual argument type to formal argument type.
	/// </Summary>
	[Serializable]
	public class GenericBinder : Binder
	{
		private readonly bool _genericMethodDefinition;
		public GenericBinder(bool genericMethodDefinition)
		{
			_genericMethodDefinition = genericMethodDefinition;
		}

		#region System.Reflection.Binder methods

		public override MethodBase BindToMethod(BindingFlags bindingAttr, MethodBase[] match, ref object[] args,
			ParameterModifier[] modifiers, CultureInfo culture, string[] names, out object state)
		{
			throw new NotImplementedException("GenericBinder.BindToMethod");
		}

		public override FieldInfo BindToField(BindingFlags bindingAttr, FieldInfo[] match, object value, CultureInfo culture)
		{
			throw new NotImplementedException("GenericBinder.BindToField");
		}

		public override MethodBase SelectMethod(
			BindingFlags        bindingAttr,
			MethodBase[]        matchMethods,
			Type[]              parameterTypes,
			ParameterModifier[] modifiers)
		{
			for (int i = 0; i < matchMethods.Length; ++i)
			{
				if (matchMethods[i].IsGenericMethodDefinition != _genericMethodDefinition)
					continue;

				ParameterInfo[] pis = matchMethods[i].GetParameters();
				bool          match = (pis.Length == parameterTypes.Length);

				for (int j = 0; match && j < pis.Length; ++j)
				{
					match = TypeHelper.CompareParameterTypes(pis[j].ParameterType, parameterTypes[j]);
				}

				if (match)
					return matchMethods[i];
			}

			return null;
		}

		public override PropertyInfo SelectProperty(BindingFlags bindingAttr, PropertyInfo[] match, Type returnType,
			Type[] indexes, ParameterModifier[] modifiers)
		{
			throw new NotImplementedException("GenericBinder.SelectProperty");
		}

		public override object ChangeType(object value, Type type, CultureInfo culture)
		{
			throw new NotImplementedException("GenericBinder.ChangeType");
		}

		public override void ReorderArgumentArray(ref object[] args, object state)
		{
			throw new NotImplementedException("GenericBinder.ReorderArgumentArray");
		}

		#endregion

		private static GenericBinder _generic;
		public  static GenericBinder  Generic
		{
			get { return _generic ?? (_generic = new GenericBinder(true)); }
		}

		private static GenericBinder _nonGeneric;
		public  static GenericBinder  NonGeneric
		{
			get { return _nonGeneric ?? (_nonGeneric = new GenericBinder(false)); }
		}
	}
}