text:
package com.tiny.demo.firstlinecode.ui.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.tiny.demo.firstlinecode.R;
import com.tiny.demo.firstlinecode.common.utils.ToastUtils;
import com.tiny.demo.firstlinecode.common.utils.ViewUtils;
import com.tiny.demo.firstlinecode.ui.bean.StockEditBean;
import com.tiny.demo.firstlinecode.ui.view.ItemTouchHelperCallback;

import java.util.Collections;
import java.util.List;

/**
 * Desc:    自选编辑的adapter
 * Created by tiny on 2017/10/25.
 * Version:
 */

public class OptionalEditAdapter extends RecyclerView.Adapter<OptionalEditAdapter.ViewHolder> implements ItemTouchHelperCallback {
    private List<StockEditBean> lists;
    private Context mContext;
    private Runnable runnable;

    public OptionalEditAdapter(List<StockEditBean> lists, Context mContext, Runnable runnable) {
        this.lists = lists;
        this.mContext = mContext;
        this.runnable = runnable;
    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(mContext).inflate(R.layout.adapter_zixuan_edit, parent, false);
        return new ViewHolder(view);
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, final int position) {
        final StockEditBean sb = lists.get(position);
        holder.imgChecked.setImageResource(sb.isChecked() ? R.drawable.ic_optional_select_box2 : R.drawable.ic_optional_select_box);
        holder.txtName.setText(sb.getName());
        holder.txtCode.setText(sb.getCode());
        holder.imgChecked.setOnClickListener(v -> {
            int pos = 0;
            for (int j = 0; j < lists.size(); j++) {
                if (sb.getCode().equals(lists.get(j).getCode())) {
                    pos = j;
                    break;
                }
            }
            lists.get(pos).setChecked(!lists.get(pos).isChecked());
            notifyItemChanged(pos);
            //通知全选按钮更改状态。
            if (runnable != null) {
                runnable.run();
            }
        });
        holder.imgTop.setOnClickListener(v -> {
            //根据code获取实际的position。
            int pos = 0;
            for (int j = 0; j < lists.size(); j++) {
                if (sb.getCode().equals(lists.get(j).getCode())) {
                    pos = j;
                    break;
                }
            }
            //交换list
            lists.remove(pos);
            lists.add(0, sb);
            //更新list
            notifyItemMoved(pos, 0);
            ToastUtils.showSingleToast(mContext.getString(R.string.string_top_success));
        });
        ViewUtils.setTouchDelegate(mContext, holder.imgChecked);
        ViewUtils.setTouchDelegate(mContext, holder.imgTop);
        ViewUtils.setTouchDelegate(mContext, holder.imgDrag);
    }

    @Override
    public int getItemCount() {
        return lists == null ? 0 : lists.size();
    }

    @Override
    public void onItemDelete(int position) {
        //移除数据
        lists.remove(position);
        notifyItemRemoved(position);
    }

    @Override
    public void onMove(int fromPosition, int toPosition) {
        Collections.swap(lists, fromPosition, toPosition);
        notifyItemMoved(fromPosition, toPosition);
    }

    public static class ViewHolder extends RecyclerView.ViewHolder {
        LinearLayout layoutAll;
        LinearLayout layoutChecked;
        ImageView imgChecked;
        TextView txtName;
        TextView txtCode;
        ImageView imgTop;
        ImageView imgDrag;
        public TextView tv;
        public ImageView iv;

        public ViewHolder(View itemView) {
            super(itemView);
            layoutAll = (LinearLayout) itemView.findViewById(R.id.layout_item_all);
            layoutChecked = (LinearLayout) itemView.findViewById(R.id.layout_checked);
            imgChecked = (ImageView) itemView.findViewById(R.id.img_checked);
            txtName = (TextView) itemView.findViewById(R.id.txt_name);
            txtCode = (TextView) itemView.findViewById(R.id.txt_code);
            imgTop = (ImageView) itemView.findViewById(R.id.img_top);
            imgDrag = (ImageView) itemView.findViewById(R.id.img_drag);
            tv = (TextView) itemView.findViewById(R.id.tv_text);
            iv = (ImageView) itemView.findViewById(R.id.iv_img);
        }
    }

}


text:
package org.innovateuk.ifs.thread.attachment.controller;

import org.innovateuk.ifs.BaseFileControllerMockMVCTest;
import org.innovateuk.ifs.commons.service.ServiceResult;
import org.innovateuk.ifs.file.resource.FileAndContents;
import org.innovateuk.ifs.threads.attachment.resource.AttachmentResource;
import org.innovateuk.ifs.threads.attachments.controller.ProjectFinanceAttachmentsController;
import org.innovateuk.ifs.threads.attachments.service.ProjectFinanceAttachmentService;
import org.junit.Test;
import org.mockito.Mock;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;

import javax.servlet.http.HttpServletRequest;
import java.util.function.Function;

import static java.util.Collections.emptyMap;
import static java.util.Collections.singletonList;
import static org.innovateuk.ifs.commons.service.ServiceResult.serviceSuccess;
import static org.innovateuk.ifs.util.JsonMappingUtil.toJson;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

public class ProjectFinanceAttachmentControllerTest extends BaseFileControllerMockMVCTest<ProjectFinanceAttachmentsController> {

    @Mock
    private ProjectFinanceAttachmentService projectFinanceAttachmentServiceMock;

    @Override
    protected ProjectFinanceAttachmentsController supplyControllerUnderTest() {
        return new ProjectFinanceAttachmentsController(projectFinanceAttachmentServiceMock);
    }

    @Override
    public void setupMockMvc() {
        controller = new ProjectFinanceAttachmentsController(projectFinanceAttachmentServiceMock);
        super.setupMockMvc();
    }

    @Test
    public void testFindOne() throws Exception {
        final Long id = 22L;
        AttachmentResource attachmentResource = new AttachmentResource(id, "name", "application/pdf", 1234, null);
        when(projectFinanceAttachmentServiceMock.findOne(id)).thenReturn(serviceSuccess(attachmentResource));

        mockMvc.perform(get("/project/finance/attachments/{attachmentId}", id))
                .andExpect(status().isOk())
                .andExpect(content().json(toJson(attachmentResource)));

        verify(projectFinanceAttachmentServiceMock).findOne(22L);
    }

    @Test
    public void testDownload() throws Exception {
        final Long id = 22L;

        Function<ProjectFinanceAttachmentService, ServiceResult<FileAndContents>> serviceCallToDownload =
                (service) -> service.attachmentFileAndContents(id);

        assertGetFileContents("/project/finance/attachments/download/{attachmentId}", new Object[]{id},
                emptyMap(), projectFinanceAttachmentServiceMock, serviceCallToDownload);
    }

    @Test
    public void testDelete() throws Exception {
        final Long id = 22L;
        AttachmentResource attachmentResource = new AttachmentResource(id, "name", "application/pdf", 1234, null);
        when(projectFinanceAttachmentServiceMock.delete(id)).thenReturn(serviceSuccess());

        mockMvc.perform(delete("/project/finance/attachments/{attachmentId}", id))
                .andExpect(status().isNoContent());

        verify(projectFinanceAttachmentServiceMock).delete(id);
    }

    @Test
    public void testUpload() throws Exception {
        final Long id = 22L;
        final Long projectId = 77L;
        final AttachmentResource attachmentResource = new AttachmentResource(id, "randomFile.pdf", "application/pdf", 1234, null);
        when(projectFinanceAttachmentServiceMock.upload(eq("application/pdf"), eq("1234"), eq("randomFile.pdf"),
                eq(projectId), any(HttpServletRequest.class))).thenReturn(serviceSuccess(attachmentResource));

        mockMvc.perform(post("/project/finance/attachments/{projectId}/upload", projectId)
                .param("filename", "randomFile.pdf")
                .headers(createFileUploadHeader("application/pdf", 1234)))
                .andExpect(content().json(toJson(attachmentResource)))
                .andExpect(status().isCreated());

        verify(projectFinanceAttachmentServiceMock).upload(eq("application/pdf"), eq("1234"), eq("randomFile.pdf"),
                eq(projectId), any(HttpServletRequest.class));
    }

    protected HttpHeaders createFileUploadHeader(String contentType, long contentLength) {
        final HttpHeaders headers = new HttpHeaders();
        headers.setContentType(MediaType.parseMediaType(contentType));
        headers.setContentLength(contentLength);
        headers.setAccept(singletonList(MediaType.parseMediaType("application/json")));
        return headers;
    }
}

redpajama_set_name: RedPajamaGithub


text:
package com.streamsets.pipeline.stage.origin.cdc.maprdb;

import com.streamsets.pipeline.api.ConfigDefBean;
import com.streamsets.pipeline.api.ConfigGroups;
import com.streamsets.pipeline.api.ExecutionMode;
import com.streamsets.pipeline.api.GenerateResourceBundle;
import com.streamsets.pipeline.api.PushSource;
import com.streamsets.pipeline.api.StageDef;
import com.streamsets.pipeline.api.base.configurablestage.DPushSource;

@StageDef(
    version = 1,
    label = "MapR DB CDC Consumer",
    description = "Reads MapR DB CDC data from MapR Streams",
    execution = ExecutionMode.STANDALONE,
    icon = "mapr_db.png",
    recordsByRef = true,
    upgrader = MapRDBCDCSourceUpgrader.class,
    onlineHelpRefUrl = "index.html?contextID=task_mmx_zvm_pbb"
)
@ConfigGroups(Groups.class)
@GenerateResourceBundle
public class MapRDBCDCDSource extends DPushSource {
  @ConfigDefBean
  public MapRDBCDCBeanConfig conf;

  @Override
  protected PushSource createPushSource() {
    return new MapRDBCDCSource(conf, new MapRDBCDCKafkaConsumerFactory());
  }
}


text:
var Direction = new function () {
	this.UP = 38;
	this.RIGHT = 39;
	this.DOWN = 40;
	this.LEFT = 37;
};

var Common = new function () {
	this.width = 40;
	this.height = 40;
	this.speed = 150; /*the smaller the faster*/
	this.workThread = null;
};

/*init some field*/
var score;
var foodtype;
var lastfoodtype=0;
var turnshorter=-1;
var changeDir=0;

var bestscore=0;
var operationtime=0;

var username;

function startgame(control){
	document.getElementById("winnername").innerHTML=getCookie("username");
		document.getElementById("bestscore").innerHTML=getCookie("bestscore");
	document.getElementById("besttime").innerHTML=getCookie("operationtime");
	/*init some field*/
	score=0;
	operationtime=0;
	document.getElementById("operationtime").innerHTML=operationtime;
	lastfoodtype=0;
	turnshorter=-1;
	//changeDir=0;
	/*init panel*/
	document.getElementById("hid").innerHTML="Your score is: ";
	document.getElementById("score").innerHTML="---";
	document.getElementById("username").disabled=false;
	document.getElementById("selSize").disabled=false;
	document.getElementById("startBtn").disabled=true;
	document.getElementById("upBtn").disabled=true;
	document.getElementById("downBtn").disabled=true;
	document.getElementById("leftBtn").disabled=true;
	document.getElementById("rightBtn").disabled=true;
	document.getElementById("selSize").onchange = function () {
		Common.width = this.value;
		Common.height = this.value;
		control.Init("pannel");
	}
	document.getElementById("username").oninput=function(){
		document.getElementById("startBtn").disabled=false;
	}
	username=document.getElementById.innerHTML;
	control.Init("pannel");

	/*start the game again*/
	document.getElementById("startBtn").onclick = function () {
		document.getElementById("selSize").disabled=true;
		document.getElementById("username").disabled=true;
		document.getElementById("res").style.display="none";
		document.getElementById("score").innerHTML=score;

		document.getElementById("startBtn").disabled=true;
		document.getElementById("upBtn").disabled=false;
		document.getElementById("downBtn").disabled=false;
		document.getElementById("leftBtn").disabled=false;
		document.getElementById("rightBtn").disabled=false;
		control.Start();
		this.disabled = true;
	};
}
var Main = new function () {
	var control = new Control();
	window.onload = function () {
		startgame(control);
	};
};

/*central controller*/
function Control() {

	this.snake = new Snake();
	this.food = new Food();
	/*init, build a table*/
	this.Init = function (pid) {
		var html = [];
		html.push('
');
		for (var y = 0; y < Common.height; y++) {
			html.push("
");
			for (var x = 0; x < Common.width; x++) {
				html.push(' 	');
			}
			html.push("
");
		}
		html.push("
");
		this.pannel = document.getElementById(pid);
		this.pannel.innerHTML = html.join("");
	};
	/*start the game listen to the keyboard, build foods, refresh thread*/
	this.Start = function () {
		var me = this;
		var addfood=0;
		this.MoveSnake = function (ev) {
			var evt = window.event || ev;
			me.snake.SetDir(evt.keyCode);
			if(evt.keyCode==37||evt.keyCode==38||evt.keyCode==39||evt.keyCode==40){
			changeDir++;
			document.getElementById("operationtime").innerHTML=changeDir;
}
		};
		this.MoveSnake2=function(ev){
			var evt=window.event|| ev;
			//up
			if(evt.srcElement.value=="UP"){
				me.snake.SetDir(Direction.UP)
				changeDir++;
				document.getElementById("operationtime").innerHTML=changeDir;
			}
			//down
			else if(evt.srcElement.value=="DOWN"){
				me.snake.SetDir(Direction.DOWN)
				changeDir++;
				document.getElementById("operationtime").innerHTML=changeDir;
			}
			else if(evt.srcElement.value=="LEFT"){
				me.snake.SetDir(Direction.LEFT)
				changeDir++;
				document.getElementById("operationtime").innerHTML=changeDir;
			}
			else if(evt.srcElement.value=="RIGHT"){
				me.snake.SetDir(Direction.RIGHT)
				changeDir++;
				document.getElementById("operationtime").innerHTML=changeDir;
			}
		}
		try {
			document.attachEvent("onkeydown", this.MoveSnake);
		} catch (e) {
			document.addEventListener("keydown", this.MoveSnake, false);
		}
		try {
			document.attachEvent("onmousedown",this.MoveSnake2);
		} catch (e) {
			document.addEventListener("click", this.MoveSnake2, false);
		}
		me.food.Create();

		Common.workThread = setInterval(function () {
			if(addfood%50==49){
				me.food.Create();
			}
			me.snake.Eat(me.food);
			me.snake.Move();
			addfood++;
		},Common.speed);
	};
}
/*snake*/
function Snake() {

	this.isDone = false;
	this.dir = Direction.RIGHT;
	this.pos = new Array(new Position());
	/*move the snake forword and judge if it is the end of the game*/
	this.Move = function () {
		document.getElementById("box_" + this.pos[0].X + "_" + this.pos[0].Y).className = "";

		//move one step forward
		for (var i = 0; i < this.pos.length - 1; i++) {
			this.pos[i].X = this.pos[i + 1].X;
			this.pos[i].Y = this.pos[i + 1].Y;
		}
		//set the head's position
		var head = this.pos[this.pos.length - 1];
		switch (this.dir) {
			case Direction.UP:
				head.Y--;
				break;
			case Direction.RIGHT:
				head.X++;
				break;
			case Direction.DOWN:
				head.Y++;
				break;
			case Direction.LEFT:
				head.X--;
				break;
		}
		this.pos[this.pos.length - 1] = head;
		//draw the snake and judge if it is the end of the game
		var len=this.pos.length;

		if(turnshorter==1) {//keep
			len=len-1;
		}
		for (var i = 0; i < len; i++) {
			var isExits = false;
			for (var j = i +1; j < len; j++)
				if (this.pos[j].X == this.pos[i].X && this.pos[j].Y == this.pos[i].Y) {
					isExits = true;
					break;
				}
				if (isExits) {
					this.Over();/*bit himself*/
					break;
				}
				var obj = document.getElementById("box_" + this.pos[i].X + "_" + this.pos[i].Y);
				if (obj)
					obj.className = "snake"+lastfoodtype;
				else {
					this.Over();/*out of boundrary*/
					break;
				}
		}
		this.isDone = true;
	};
	/*game is over*/
	this.Over = function () {
		clearInterval(Common.workThread);

		username=document.getElementById("username").value;
		operationtime=document.getElementById("operationtime").innerHTML;

		document.getElementById("score").innerHTML="---";
		document.getElementById("res").style.display="block";
		document.getElementById("endgame").innerHTML="Game Over!";
		document.getElementById("scoreshow").innerHTML="Your final score is "+score+"!";
		document.getElementById("msg").innerHTML="Press start to restart the game!"
		if(getCookie("username") == "" ||(parseInt(getCookie("bestscore"))<score)){
		setCookie("username",username,30);
		setCookie("bestscore", score, 30);
		setCookie("operationtime",operationtime,30);
}

		document.getElementById("winnername").innerHTML=getCookie("username");
		document.getElementById("bestscore").innerHTML=getCookie("bestscore");
		document.getElementById("besttime").innerHTML=getCookie("operationtime");
		//prepare for restarting the game
		control = new Control();
		startgame(control);
	}
	/*eat food*/
	this.Eat = function (food) {
		var head = this.pos[this.pos.length - 1];
		var isEat = false;
		var flag=false;
		switch (this.dir) {
			case Direction.UP:
				if (head.X == food.pos.X && head.Y == food.pos.Y + 1) isEat = true;
				break;
			case Direction.RIGHT:
				if (head.Y == food.pos.Y && head.X == food.pos.X - 1) isEat = true;
				break;
			case Direction.DOWN:
				if (head.X == food.pos.X && head.Y == food.pos.Y - 1) isEat = true;
				break;
			case Direction.LEFT:
				if (head.Y == food.pos.Y && head.X == food.pos.X + 1) isEat = true;
				break;
		}
		if (isEat) {
			if(foodtype==1){
				turnshorter=1;//keep the size
			}
			else{
				turnshorter=2; // will become longer
			}
			ScoreJudge(foodtype);
			lastfoodtype=foodtype;
			this.pos[this.pos.length] = new Position(food.pos.X, food.pos.Y);
			food.Create(this.pos);
		}
	};
	/*control the direction*/
	this.SetDir = function (dir) {
		switch (dir) {
		case Direction.UP:
			if (this.isDone && this.dir != Direction.DOWN) { this.dir = dir; this.isDone = false; }
			break;
		case Direction.RIGHT:
			if (this.isDone && this.dir != Direction.LEFT) { this.dir = dir; this.isDone = false; }
			break;
		case Direction.DOWN:
			if (this.isDone && this.dir != Direction.UP) { this.dir = dir; this.isDone = false; }
			break;
		case Direction.LEFT:
			if (this.isDone && this.dir != Direction.RIGHT) { this.dir = dir; this.isDone = false; }
			break;
		}
	};
}
/*food*/
function Food() {
	this.pos = new Position();
	/*build the food randomly*/
	this.Create = function (pos) {
		document.getElementById("box_" + this.pos.X + "_" + this.pos.Y).className = "";
		var x = 0, y = 0, isCover = false;
		/*you can not build a food in the snake's place*/
		do {
			x = parseInt(Math.random() * (Common.width - 1));
			y = parseInt(Math.random() * (Common.height - 1));
			isCover = false;
			if (pos instanceof Array) {
				for (var i = 0; i < pos.length; i++) {
					if (x == pos[i].X && y == pos[i].Y) {
						isCover = true;
						break;
					}
				}
			}
		} while (isCover);
		this.pos = new Position(x, y);
		foodtype = Math.floor(Math.random()*3+1);
		if(lastfoodtype==foodtype){
			foodtype=foodtype%3+1;
		}
		document.getElementById("box_" + x + "_" + y).className = "food"+foodtype;
	};
}
function ScoreJudge(type){
	if(type==1){//red
		score=score+5;
	}
	else if(type==2){//black
		score=score-1;
	}
	document.getElementById("score").innerHTML=score;
}

function Position(x, y) {
	this.X = 0;
	this.Y = 0;
	if (arguments.length >= 1) this.X = x;
	if (arguments.length >= 2) this.Y = y;
}

// Function to set the cookie
function setCookie(cname, cvalue, exdays) {
	var d = new Date();
	d.setTime(d.getTime() + (exdays*24*60*60*1000));
	var expires = "expires=" + d.toUTCString();
	document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}

// Function to get the cookie
function getCookie(cname) {
	var name = cname + "=";
	var ca = document.cookie.split(';');
	for (var i = 0; i < ca.length; i++) {
		var c = ca[i];
		while (c.charAt(0) == ' ') {
			c = c.substring(1);
		}
		if (c.indexOf(name) == 0) {
			return c.substring(name.length, c.length);
		}
	}
    return "";
}


text:
module CASino
  class LDAPAuthenticator
    VERSION = '3.0.0'
  end
end


text:
module Blogit

  # This class handles the global configuration options for Blogit.
  #  When you run `rails g blogit:install` this will add an initializer file to
  #  config/initializers/blogit.rb with all of the default configurations applied.
  #
  #  You can read about each of the individual configuration options below.
  class Configuration

    include ActiveSupport::Configurable

    # An Array containing the default states for {Blogit::Post Posts} that are considered
    #   "active". ("Active" {Post posts} are those that can be viewed by the public).
    ACTIVE_STATES = [:published]

    # An Array containing the default states for {Blogit::Post Posts} that are considered
    #   "hidden". ("Hidden" {Post posts} are those that may not be viewed by the public).
    HIDDEN_STATES = [:draft, :archive]

    # When using redcarpet as content parser, pass these options as defaults.
    REDCARPET_OPTIONS = {
      hard_wrap: true,
      filter_html: true,
      autolink: true,
      no_intra_emphasis: true,
      fenced_code_blocks: true,
      gh_blockcode: true,
    }

    ##
    # How do you want to handle comments for your blog?
    #   Valid options are :active_record, :disquss, or :no for none.
    #   (default: :active_record)
    config_accessor(:include_comments) { :active_record }

    ##
    # When using :disqus comments, what is the shortname of your forum?
    #  (default: nil)
    config_accessor(:disqus_shortname, instance_writer: false)

    ##
    # Load a javascript-based share bar on each blog post?. (default: true)
    config_accessor(:include_share_bar) { true }

    ##
    # Twitter username used in the share bar. (default: nil)
    config_accessor(:twitter_username)

    ##
    # The name of the controller method we'll call to return the current blogger.
    #   (default: :current_user)
    config_accessor(:current_blogger_method) { :current_user }

    ##
    # What method do we call on blogger to return their display name? (default: :username)
    config_accessor(:blogger_display_name_method) { :username }

    ##
    # Which DateTime::FORMATS format do we use to display blog and comment publish time
    #   (default: :short)
    config_accessor(:datetime_format) { :short }

    ##
    # Number of {Blogit::Post posts} to show per page. This is a configuration for {https://github.com/amatsuda/kaminari Kaminari} (default: 5)
    #
    # Returns an Integer
    config_accessor(:posts_per_page) { 5 }

    ##
    # If set to true, the comments form will POST and DELETE to the comments
    # controller using AJAX calls.
    #
    # Returns true or false
    config_accessor(:ajax_comments)  { true }

    ##
    # The default format for parsing the blog content.
    #
    # Defaults to :markdown
    config_accessor(:default_parser) { :markdown }

    ##
    # Should text within "```" or "`" be highlighted as code?
    # Defaults to true
    # @note - At the moment this only works when default_parser is :markdown
    config_accessor(:highlight_code_syntax) { true }

    ##
    # When using redcarpet as content parser, pass these options as defaults
    #
    # Defaults to {REDCARPET_OPTIONS}
    config_accessor(:redcarpet_options) { REDCARPET_OPTIONS }

    ##
    # List of states that will be visible to the public
    #
    # Defaults to ACTIVE_STATES
    config_accessor(:active_states) { ACTIVE_STATES }

    ##
    # List of states that will hide the posts from the public.
    #
    # Defaults to HIDDEN_STATES
    config_accessor(:hidden_states) { HIDDEN_STATES }

    ##
    # The title of the RSS feed for the blog posts
    #
    # Defaults to "[Application Name] Blog Posts"
    config_accessor(:rss_feed_title, instance_reader: false)

    ##
    # The description of the RSS feed for the blog posts
    # Defaults to "[Application Name] Blog Posts"
    config_accessor(:rss_feed_description, instance_reader: false)

    ##
    # The layout to be used by the posts controller
    #
    # Defaults to nil
    config_accessor :layout

    ##
    # Should show a description of the blog post on the index
    # and RSS feed.
    #
    # Defaults to true
    config_accessor(:show_post_description) { true }

    def default_parser_class
      "Blogit::Parsers::#{default_parser.to_s.classify}Parser".constantize
    end

    # Sets {#disqus_shortname}.
    #   If the user has defined a disqus shortname but hasn't set include_comments to
    #   :disqus will print a warning to the console.
    #
    # shortname - A String with the diquss username to use.
    #
    def disqus_shortname=(shortname)
      return if shortname.blank?
      unless include_comments == :disqus
        blogit_warn "You've set config.disqus_shortname in your blogit config file but " \
         "config.include_comments is not set to :disqus"
      end
      config.disqus_shortname = shortname
    end

    # The title to use in the index.rss template. (default: [My Application] Blog
    #   Posts")
    #
    # Returns a String
    def rss_feed_title
      @rss_feed_title ||= "#{rails_app_name} Blog Posts"
    end

    # The description to use in the index.rss template.
    #   (default: "Latest from [My Application]")
    #
    # Returns a String
    def rss_feed_description
      @rss_feed_description ||= "Latest from #{rails_app_name}"
    end

    private

    # The name of this application derived from the app's engine name.
    #   If your Rails app module is KatanaCode, the application name will be "Katana Code"
    #
    # Returns a String
    def rails_app_name
      Rails.application.engine_name.titleize
    end

    # Print a warning message to $STDOUT with the prefix "[Blogit]: "
    #
    # Examples
    #
    #  blogit_warn("Blogit is not a toy!")
    #  # => "[Blogit]: Blogit is not a toy!"
    #
    def blogit_warn(message)
      warn "[Blogit]: #{message}"
    end

  end

end


text:
import os, sys

sys.path.insert(0, os.path.join(os.path.dirname(__file__), "apps"))

DEBUG = False

ADMINS = (
    ('Anton Agafonov', 'anton.agafonov@djangostars.com',),
    ('Roman Osipenko', 'roman.osipenko@djangostars.com',),
    ('Dizhak Vasyl', 'vasyl.dizhak@djangostars.com',),
)

MANAGERS = ADMINS

TIME_ZONE = 'Europe/Kiev'

LANGUAGE_CODE = 'en-us'

SITE_ID = 1

USE_I18N = True

USE_L10N = True

MEDIA_ROOT = os.path.join(os.path.dirname(__file__), "media")

MEDIA_URL = '/media/'

STATIC_ROOT = os.path.join(os.path.dirname(__file__), "static_collected")

STATIC_URL = '/static/'

ADMIN_MEDIA_PREFIX = '/static/admin/'

STATICFILES_DIRS = os.path.join(os.path.dirname(__file__), "static"),

STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)

SECRET_KEY = 's@#f*!-1^!#-jtql7$we=h)s0bqw0x0@!6bb+0v@^sodb#5w-s'

TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
)

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
    'pagination.middleware.PaginationMiddleware',
)

ROOT_URLCONF = 'presence.urls'

TEMPLATE_DIRS = (
    os.path.join(os.path.dirname(__file__), "templates"),
    os.path.join(os.path.dirname(__file__), "..", "assets"),
)

TEMPLATE_CONTEXT_PROCESSORS = (
    "django.core.context_processors.media",
    "django.core.context_processors.request",
    "django.core.context_processors.csrf",
    "django.core.context_processors.i18n",
    "django.core.context_processors.static",
    "django.contrib.auth.context_processors.auth",
    "django.contrib.messages.context_processors.messages",
)

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.admin',
    'django.contrib.flatpages',

    # foreign appps
    'django_extensions',
    'south',
    'fresh_media',
    'pagination',

    # our apps
    'activity',
    'people',
    'workflow',
    'activation',
    'shout',
    'vote',
    'event',
    'planning',
)

LOCAL_DEVELOPMENT = True

AUTH_PROFILE_MODULE = 'people.Profile'

AUTHENTICATION_BACKENDS = (
    "apps.people.emailauth.EmailBackend",
    "apps.activation.backends.UrlLoginBackend",
    "django.contrib.auth.backends.ModelBackend",
    )

LOGIN_URL = '/login/'
LOGIN_REDIRECT_URL = "/"
LOGOUT_URL = "/logout/"

DEFAULT_FROM_EMAIL = "presence@djangostars.com"
SHOUT_CONVERT_URL = True

EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'dash@djangostars.com'
EMAIL_HOST_PASSWORD = 'dashdash'
EMAIL_PORT = 587

try:
    from settings_local import *
except ImportError:
    pass

try:
    from local_settings import *
except ImportError:
    pass

TEMPLATE_DEBUG = DEBUG


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>lib.MotorCurrentEstimators Class Hierarchy</title>
<meta name="date" content="2016-06-04">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Hierarchy For Package lib.MotorCurrentEstimators

Package Hierarchies:

All Packages

Class Hierarchy

java.lang.Object

lib.MotorCurrentEstimators.CIMCurrentEstimator

lib.MotorCurrentEstimators.MotorDiagnostic

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements. See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache license, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License. You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the license for the specific language governing permissions and
  limitations under the license.
  -->
<Configuration status="OFF">
  <Appenders>
    <RandomAccessFile name="RandomAccessFile" fileName="target/ConcurrentAsyncLoggerToFileBenchmark.log" immediateFlush="false">
      <PatternLayout pattern="%d %p [%t] %c{1} %X{transactionId} - %m%n"/>
    </RandomAccessFile>
  </Appenders>
  <Loggers>
    <AsyncRoot level="info" includeLocation="false">
      <appender-ref ref="RandomAccessFile"/>
    </AsyncRoot>
  </Loggers>
</Configuration>


text:
NibJS.define('coffee', function(nibjs) {
  nibjs.register('./App', function(exports, require) {
    var StringUtils;
    StringUtils = require('./StringUtils').StringUtils;
    return exports.App = {
      runTests: function() {
        $("body").append(StringUtils.pre("Have a look at 'nibjs --coffee'"));
        return true;
      }
    };
  });
  nibjs.register('./index', function(exports, require) {
    exports.StringUtils = require('./StringUtils').StringUtils;
    return exports.App = require('./App').App;
  });
  nibjs.register('./StringUtils', function(exports, require) {
    return exports.StringUtils = {
      pre: function(what) {
        return "<pre>" + what + "</pre>";
      }
    };
  });
  return nibjs.require('./index');
});


text:
module Fog
  module Compute
    class IBM
      class Real
        # Requests a new static IP address to be created
        #
        # ==== Parameters
        # * location_id<~String> - id of location
        # * offering_id<~String> - id for offering
        # * vlan_id<~String> - id of vlan
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #     * 'location'<~String>: location of new address
        #     * 'offeringId'<~String>: offering id of new address
        #     * 'id'<~String>: id
        #     * 'ip'<~String>: returns string of spaces (ip not yet allocated right after creation)
        #     * 'state'<~Integer>: status of address (0 when new)
        def create_address(location, offering_id, options={})
          request(
            :method   => 'POST',
            :expects  => 200,
            :path     => '/addresses',
            :body     => {
              'offeringID' => offering_id,
              'location'   => location,
              'vlanID'     => options[:vlan_id]
            }
          )
        end
      end

      class Mock
        def create_address(location_id, offering_id="20001223", options={})
          address         = Fog::IBM::Mock.create_address(location_id, offering_id, options)
          self.data[:addresses][address['id']] = address
          response        = Excon::Response.new
          response.status = 200
          response.body   = address
          response
        end
      end
    end
  end
end