text:
package org.wikipedia.descriptions;

import android.content.Context;
import android.content.Intent;
import android.support.annotation.NonNull;

import org.wikipedia.activity.SingleFragmentActivityTransparent;

public class DescriptionEditSuccessActivity
        extends SingleFragmentActivityTransparent<DescriptionEditSuccessFragment>
        implements DescriptionEditSuccessFragment.Callback {

    static Intent newIntent(@NonNull Context context) {
        return new Intent(context, DescriptionEditSuccessActivity.class);
    }

    @Override protected DescriptionEditSuccessFragment createFragment() {
        return DescriptionEditSuccessFragment.newInstance();
    }

    @Override
    public void onDismissClick() {
        setResult(RESULT_OK);
        finish();
    }
}


text:
module Pruner
  class DestroyRemover
    # @param board [Board] board to be pruned from
    # @param topic_ids [Array<Integer>] ids of Topic to remove
    def initialize(board, topic_ids, **options)
      @board = board
      @topic_ids = topic_ids
    end

    def perform
      @board.topics.where(id: @topic_ids).destroy_all
    end
  end
end

redpajama_set_name: RedPajamaGithub


text: Forked from [pixyll.com](http://www.pixyll.com)


text:
<?xml version="1.0" encoding="utf-8"?>
<shape
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="rectangle">
    <solid android:color="@color/colorPrimary"/>
    <padding android:left="8dip" android:top="8dip" android:right="8dip" android:bottom="8dip"/>
    <corners
            android:bottomRightRadius="6dip"
            android:bottomLeftRadius="6dip"
            android:topLeftRadius="6dip"
            android:topRightRadius="6dip"/>
</shape>


text:
package com.example.android.sendmoods.Moods;

import android.graphics.Color;

import static com.example.android.sendmoods.Constants.*;

public class HappyMood extends Mood {
    public HappyMood(){
        color = Color.parseColor(HAPPY_COLOR);
        shape = HAPPY_POPUP_BOX;
        text = HAPPY_WORD;
        icon = HAPPY_ICON;
        icon_bw = HAPPY_ICON_BW;
    }
}


text:
var Eventer = require('../base/eventer');
var DB = require('../db');
var _ = require('underscore');
var cluster = require('cluster');
var path = require('path');
var WebSocket = require('ws');

module.exports = Eventer.extend({

    init: function(dir, config) {
        this.rootDir = dir;
        this.config = config;
        this.isMaster = cluster.isMaster;

        var self = this;
        this.once('db.connected', function() {
            self.models = require('../models')(self);
            _.each(self.models,  function(model, name) {
                self[name] = model;
            });
        });

        this.ws = new WebSocket(this.config.worker.url);
        this.ws.on('open', function() {
            self.executeNowOrOnce(self.db.ready, 'db.connected', function(){
                self.models = require('../models')(self);
                this.worker.setModels(this.models);
                self.send(['server-worker', self.worker.getQueueOptions()]);
                console.log('Worker ready');
            });

        });
        this.ws.on('message', function(data) {
            self.handleMessage(JSON.parse(data));
        });

        this.setupDatabases(config.db);
    },

    send: function(data){
        var msg = JSON.stringify(data);
        this.ws.send(msg);
    },

    handleMessage: function(msg) {
        var self = this;
        var action = msg.shift();
        if(action == 'emit'){
            this.emit.apply(this, msg);
        }else if(action == 'set-task'){
            this.worker.setTask(msg.shift());
        }else if(action == 'execute'){
            var ID = msg.shift();
            var method = msg.shift();
            var data = this.worker ? this.worker[method].apply(this.worker, msg): {error: 'Worker not initialised'};
            self.send(['emit', 'executed.'+ID, data]);
        }else if(action == 'executeAsync'){
            var ID = msg.shift();
            var method = msg.shift();

            msg.push(function() {
                var args = _.toArray(arguments) ;
                args.unshift('emit', 'executed.'+ID);
                self.send(args);
            });
            if(this.worker){
                this.worker[method].apply(this.worker, msg);
            }else{
                self.send(['emit', 'executed.'+ID, {error: 'Worker not initialised'}]);
            }
        }
    },

    setup: function(n, file){
        var self = this

        this.workerFile = path.join(this.rootDir, file);
        var Worker = require(this.workerFile);
        this.worker = new Worker();
        this.worker.on('*',function(event) {
            var args = _(arguments).toArray();
            args.unshift('emit');
            self.send(args);
        });

        if(this.isMaster){
            _(n-1).times(function(){
                cluster.fork();
            });
        }
    },

    setupDatabases: function(databases) {
        this.db = new DB(databases);
        this.propagateEvents('db');
    }

});