text:
package com.base.action;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;

import javax.persistence.criteria.CriteriaBuilder.In;
import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;

import com.base.po.ApplyDept;
import com.base.po.Major;
import com.base.po.basetype;
import com.base.service.baseApplyService;
import com.base.utils.ExcelReport;

/**
 * 基地申请
 *
 * @author 梦醒何处
 *
 */
//实习申请控制层
@Controller("BaseApplyController")
@RequestMapping("/jsp")
public class BaseApplyController {
    @Autowired
    private baseApplyService baseapplyservice;

    //提交用户的实习基地申请
    @RequestMapping("/getRequestBaseInfo.do")
    public String getRequestBaseInfo(HttpServletRequest request,
	    HttpServletResponse response, ModelMap map) {
	Cookie[] cookies = request.getCookies();// 获得所有cookie对象
	for (Cookie co : cookies) {
	    if (co.getName().equals("username")) {
		String userid = co.getValue();
		Date d = new Date();
		/*------参数2-----------*/
		String str2 = "";
		String name = request.getParameter("name");// 基地名称
		String type = request.getParameter("typeid");//基地类型id
		String landarea = request.getParameter("landarea");//基地面积
		if (landarea.equals("")) {
		    landarea = null;
		}
		String constructionarea = request.getParameter("constructionarea");//建筑面积
		if (constructionarea.equals("")) {
		    constructionarea = null;
		}
		String undertake = request.getParameter("undertake");//可承担人数
		if (undertake.equals("")) {
		    undertake = null;
		}
		String applyid = request.getParameter("applyid");//申报部门id
		String land_address = request.getParameter("land_addres");// 通讯地址
		String username = request.getParameter("username");// 联系人姓名
		String phone = request.getParameter("phone");// 联系人电话
		String lawPerson = request.getParameter("lawPerson");// 联系人电话
		// String material_path =
		// request.getParameter("material_path");//
		// 申请材料保存地址
		// 上传文件(图片),将文件存入服务器指定路径下,并获得文件的相对路径
		String path = null;
		String filename = null;
		MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
		// 得到上传的文件
		MultipartFile mFile = multipartRequest.getFile("material_path");// 申请材料保存地址
		if (!mFile.isEmpty()) {
		    // 得到上传服务器的路径
		   /* path = request.getSession().getServletContext()
			    .getRealPath("/material/");*/
		   path = ExcelReport.getWebRootUrl(request,"/material/");
		    // 得到上传的文件的文件名
		    String fileName = mFile.getOriginalFilename();
		    String fileType = fileName.substring(fileName
			    .lastIndexOf("."));
		    filename = new Date().getTime() + fileType;
		    InputStream inputStream = null;
		    try {
			inputStream = mFile.getInputStream();
		    } catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		    }
		    byte[] b = new byte[1048576];
		    int length = 0;
		    try {
			length = inputStream.read(b);
		    } catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		    }
		    path +=filename;
		    // 文件流写到服务器端
		    try {
			FileOutputStream outputStream = new FileOutputStream(
				path);
			outputStream.write(b, 0, length);
			inputStream.close();
			outputStream.close();
		    } catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		    }
		    filename = "../material/" + filename;
		} else {
		    filename = null;
		}
		//获取当前
		  DateFormat format=new SimpleDateFormat("yyyy-MM-dd");
		  String time=format.format(d);
		String Baseid = String.valueOf(d.getTime());
		str2 += "('" + Baseid + "','" + name + "'," + type + ","
			+ landarea + "," + constructionarea + "," + undertake
			+ "," + applyid + ",'" + land_address + "','"
			+ username + "','" + phone + "','" + filename + "','"
			+ userid +"','"+ time + "','"+lawPerson+"')";

		/*------参数1-----------*/
		String majorid[] = request.getParameterValues("majorid");// 专业id
		String str1 = "";
		StringBuffer sb = new StringBuffer();
		if (majorid == null) {
		    sb.append("(");
		    sb.append("'");
		    sb.append(Baseid);
		    sb.append("'");
		    sb.append(",");
		    sb.append("-1");
		    sb.append("),");
		    sb.deleteCharAt(sb.length() - 1);
		    str1 = sb.toString();
		} else {
		    for (String string : majorid) {

			sb.append("(");
			sb.append("'");
			sb.append(Baseid);
			sb.append("'");
			sb.append(",");
			sb.append("'");
			sb.append(string);
			sb.append("'");
			sb.append("),");
		    }
		    sb.deleteCharAt(sb.length() - 1);
		    str1 = sb.toString();
		}
		//[{userid:"1200001",basename:"李彩彩基地"}]
		map.addAttribute("userid", userid);
		map.addAttribute("basename", name);
		//String infostr="";
		String infostr=JSONArray.fromObject(map).toString();
		String message=baseapplyservice.getRequestBaseInfo(str1, str2,infostr);
		request.setAttribute("index", message);
		response.setContentType("text/html;charset=UTF-8");
		/*try {
		    response.getWriter().print(message);
		} catch (IOException e) {
		    // TODO Auto-generated catch block
		    e.printStackTrace();
		}*/

	    }
	}
	//return "redirect:index.jsp";
	return "baseApply";

    }

    //获取学院和基地类型
    @RequestMapping("/BaseApplyAllInfo.do")
    public String BaseApplyInfo(HttpServletRequest request,
	    HttpServletResponse response, ModelMap map) {
	// 获取学院
	List<ApplyDept> list1 = baseapplyservice.getDept(1);
	// 获取基地类型
	List<basetype> list2 = baseapplyservice.getBasetype();

	try {
	    List list4 = new ArrayList();
	    list4.add(list1);
	    list4.add(list2);
	    JSONArray json = JSONArray.fromObject(list4);
	    response.setContentType("text/html;charset=UTF-8");
	    response.getWriter().print(json.toString());

	} catch (Exception e) {
	    // TODO Auto-generated catch block
	    e.printStackTrace();
	}

	return null;
    }

    //根据部门类型获取部门
    @RequestMapping("/getBaseSingleDept.do")
    public String getBaseSingleDept(HttpServletRequest request,
	    HttpServletResponse response, ModelMap map) {
	int typeid = Integer.parseInt(request.getParameter("typeid"));
	// 获取部门
	List<ApplyDept> list1 = baseapplyservice.getDept(typeid);

	try {
	    JSONArray json = JSONArray.fromObject(list1);
	    response.setContentType("text/html;charset=UTF-8");
	    response.getWriter().print(json.toString());

	} catch (Exception e) {
	    // TODO Auto-generated catch block
	    e.printStackTrace();
	}

	return null;
    }

    //根据学院编号获取专业
    @RequestMapping("/getMajor.do")
    public String getMajor(HttpServletRequest request,
	    HttpServletResponse response, ModelMap map) {
	// 根据学院id获取专业
	int aid = Integer.parseInt(request.getParameter("aid"));
	List<Major> list = baseapplyservice.getMajor(aid);
	try {
	    JSONArray json = JSONArray.fromObject(list);
	    response.setContentType("text/html;charset=UTF-8");
	    response.getWriter().print(json.toString());
	} catch (IOException e) {
	    // TODO Auto-generated catch block
	    e.printStackTrace();
	}
	return null;
    }

    //检测用户输入的基地名称是否存在
    @RequestMapping("/CheckName.do")
    public String CheckName(HttpServletRequest request,
	    HttpServletResponse response, ModelMap map) {
	boolean flag=false;
	//获得用户输入的基地名称
	String name=request.getParameter("name");
	//获得是否存在
	int a=baseapplyservice.CheckName(name);
	if(a==0){
	    flag=false;
	}else{
	    flag=true;
	}
	response.setContentType("text/html;charset=UTF-8");
	try {
	   // JSONObject json=new JSONObject();
	    response.getWriter().print(flag);
	} catch (IOException e) {
	    // TODO Auto-generated catch block
	    e.printStackTrace();
	}
	return null;
    }

}


text:
import * as lights from './lights';
import Axis from './axis';
import Normal from './normal';

export {
    Axis,
    lights,
    Normal,
};

redpajama_set_name: RedPajamaGithub


text:
package org.apache.asterix.optimizer.rules;

import org.apache.asterix.om.base.AInt32;
import org.apache.asterix.om.base.IAObject;
import org.apache.asterix.om.types.ATypeTag;
import org.apache.asterix.om.utils.ConstantExpressionUtil;
import org.apache.commons.lang3.mutable.Mutable;
import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
import org.apache.hyracks.algebricks.core.algebra.base.ILogicalExpression;
import org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator;
import org.apache.hyracks.algebricks.core.algebra.base.IOptimizationContext;
import org.apache.hyracks.algebricks.core.algebra.base.LogicalOperatorTag;
import org.apache.hyracks.algebricks.core.algebra.base.PhysicalOperatorTag;
import org.apache.hyracks.algebricks.core.algebra.operators.logical.AbstractLogicalOperator;
import org.apache.hyracks.algebricks.core.algebra.operators.logical.LimitOperator;
import org.apache.hyracks.algebricks.core.algebra.operators.logical.OrderOperator;
import org.apache.hyracks.algebricks.core.algebra.operators.physical.StableSortPOperator;
import org.apache.hyracks.algebricks.core.algebra.util.OperatorPropertiesUtil;
import org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule;

/**
 * If an ORDER operator is followed by LIMIT, then we can push LIMIT into ORDER operator.
 * Finally, ORDER operator use TopKSorterOperatorDescriptor that can efficiently
 * sort tuples and fetch top K results.
 * =================
 * matching pattern:
 * limit <- order
 * =
 * producing pattern:
 * limit <- new order (topK applied)
 */
public class PushLimitIntoOrderByRule implements IAlgebraicRewriteRule {

    @Override
    public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context) {
        return false;
    }

    @Override
    public boolean rewritePre(Mutable<ILogicalOperator> opRef, IOptimizationContext context)
            throws AlgebricksException {
        AbstractLogicalOperator op = (AbstractLogicalOperator) opRef.getValue();
        // The current operator should be LIMIT operator.
        if (op.getOperatorTag() != LogicalOperatorTag.LIMIT) {
            return false;
        }

        Mutable<ILogicalOperator> opRef2 = op.getInputs().get(0);
        AbstractLogicalOperator op2 = (AbstractLogicalOperator) opRef2.getValue();

        if (context.checkAndAddToAlreadyCompared(op, op2)) {
            return false;
        }

        // Should be ORDER operator
        if (op2.getOperatorTag() != LogicalOperatorTag.ORDER) {
            return false;
        } else {
            // ORDER operator is followed by LIMIT. Thus we can check whether we can apply this rule.
            boolean res = pushLimitIntoOrder(opRef, opRef2, context);
            if (res) {
                OperatorPropertiesUtil.typeOpRec(opRef, context);
            }
            return res;
        }
    }

    /**
     * Generate new ORDER operator that uses TopKSort module and replaces the old ORDER operator.
     */
    private boolean pushLimitIntoOrder(Mutable<ILogicalOperator> opRef, Mutable<ILogicalOperator> opRef2,
            IOptimizationContext context) throws AlgebricksException {
        LimitOperator limitOp = (LimitOperator) opRef.getValue();
        OrderOperator orderOp = (OrderOperator) opRef2.getValue();

        // We don't push-down LIMIT into in-memory sort.
        if (orderOp.getPhysicalOperator().getOperatorTag() != PhysicalOperatorTag.STABLE_SORT) {
            return false;
        }

        Integer topK = getOutputLimit(limitOp);
        if (topK == null) {
            return false;
        }

        // Create the new ORDER operator, set the topK value, and replace the current one.
        OrderOperator newOrderOp = new OrderOperator(orderOp.getOrderExpressions(), topK);
        newOrderOp.setSourceLocation(orderOp.getSourceLocation());
        newOrderOp.setPhysicalOperator(new StableSortPOperator(newOrderOp.getTopK()));
        newOrderOp.getInputs().addAll(orderOp.getInputs());
        newOrderOp.setExecutionMode(orderOp.getExecutionMode());
        newOrderOp.recomputeSchema();
        newOrderOp.computeDeliveredPhysicalProperties(context);
        opRef2.setValue(newOrderOp);
        context.computeAndSetTypeEnvironmentForOperator(newOrderOp);
        context.addToDontApplySet(this, limitOp);
        return true;
    }

    static Integer getOutputLimit(LimitOperator limitOp) {
        if (!limitOp.hasMaxObjects()) {
            // No limit
            return null;
        }
        // Currently, we support LIMIT with a constant value.
        ILogicalExpression maxObjectsExpr = limitOp.getMaxObjects().getValue();
        IAObject maxObjectsValue = ConstantExpressionUtil.getConstantIaObject(maxObjectsExpr, ATypeTag.INTEGER);
        if (maxObjectsValue == null) {
            return null;
        }
        int topK = ((AInt32) maxObjectsValue).getIntegerValue();
        if (topK < 0) {
            topK = 0;
        }

        // Get the offset constant if there is one. If one presents, then topK = topK + offset.
        // This is because we can't apply offset to the external sort.
        // Final topK will be applied through LIMIT.
        if (limitOp.hasOffset()) {
            ILogicalExpression offsetExpr = limitOp.getOffset().getValue();
            IAObject offsetValue = ConstantExpressionUtil.getConstantIaObject(offsetExpr, ATypeTag.INTEGER);
            if (offsetValue == null) {
                return null;
            }
            int offset = ((AInt32) offsetValue).getIntegerValue();
            if (offset < 0) {
                offset = 0;
            }
            // Check the overflow case.
            if (offset >= Integer.MAX_VALUE - topK) {
                return null;
            }
            topK += offset;
        }

        return topK;
    }
}


text:
layout: post
title: The Command Prompt
date: '2006-06-16 12:10:00 -0700'
mt_id: 1127
blog_id: 1
post_id: 1127
basename: the-command-prompt
categories:
- programming
- future-reference
---

This is going to seem like yesterday's news to my fellow Mac OS X and Unix readers, but I just got something working today that is pretty impressive in the Windows command prompt.

I love this Windows version of "grep"—I install it on every server and desktop I interact with. It's super fast, very similar to the Unix version, and I've never had a single problem with it.

I was trying to use its output as input for another command. This is called "command redirection" in the Windows world and "piping" everywhere else. Sadly, the documentation on the Web about this feature of Windows is sparse. I can see why: Windows executes both commands simultaneously and if the receiving command wasn't designed to wait for standard input then it'll just error out. Like the "del" command, for example. Non-Windows users are welcome to snigger quietly now.

Then I found this article. This isn't piping per se, but the idea is the same. Take the output of one command and use it in another. Once I had that, it was a simple for /f "tokens=*" %a in ('grep -l stuffIwantDeleted *.FOO') do del %a. Worked like a dream!


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

	angular.module('sections.terms')
		.controller('TermsCtrl', function ($scope) {

		});
})();


text:
	{% if not action_item.done %}

		    {{ action_item.short_name }}:

		  {{ action_item.summary }}

	{% else %}  {# ai complete #}

			{{ action_item.short_name }}: {{ action_item.summary }}

	{% endif %}

	{% if action_item.priority %}

PRIORITY

	{% endif %}

{{ action_item.author }} on {{ action_item.written_datetime }}

	{% if request.session.staff_view %}

edit on admin panel

	{% endif %}


text:
import time # This is the time library, we need this so we can use the sleep function
import sys
reload(sys)
sys.setdefaultencoding('utf8')
import os
import random
from picamera import PiCamera # need this to take pictures
from datetime import datetime
from twython import Twython # need this for tweeting
from twython import TwythonStreamer # need this for monitoring Twitter for commands
os.chdir(os.path.dirname(os.path.abspath(sys.argv[0]))) # sets script working directory

# Import all our secret stuff from the auth.py file; you have to change the settings!!!
from auth import (
                  consumer_key,
                  consumer_secret,
                  access_token,
                  access_token_secret,
                  )

# Define some variables to be used later on in our script
logfile = 'gardenerbear_log.txt' # Define the location of the logfile
tweetsdb = 'tweets.txt' # Define the location of the tweets file
# Do we want emails or tweets, do we want log messages printed on screen
twitter_bot_active = 1 # 0 is inactive, 1 active
camera_active = 1 # 0 is inactive, 1 active
verbose = 1 # 0 is inactive, 1 active

def writelog(message):
    # This function writes to a logfile, and if verbose is true, it will also print the message to the screen
    messagetolog = "%s, %s\n" % (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), str(message))
    if verbose:print(messagetolog) # Check to see if we are in verbose mode, if so, print the message to the screen
    with open(logfile, "a+") as file: # Open the logfile for writing in append mode
        file.write(messagetolog) # Write the message to the file

# CPU temp function
def PiCPUtemp():
    cmd = '/opt/vc/bin/vcgencmd measure_temp'
    line = os.popen(cmd).readline().strip()
    temp = line.split('=')[1].split("'")[0]
    return temp

# Random tweeting function
def randomTweet(user_tweeted, water_status):
    try:
        api = Twython(consumer_key, consumer_secret, access_token, access_token_secret)
        tweetsFile = open(tweetsdb,'r')
        tweetsList = tweetsFile.readlines()
        tweetsFile.close()
        randomChoice = random.randrange(len(tweetsList))
        cputemp = PiCPUtemp()
        if water_status == 'dry':
            message = "Dear @%s, %s BTW, I need watering and my CPU temp is %sºC" % (user_tweeted, tweetsList[randomChoice].rstrip('\n'), cputemp)
            log_message = "Tweeted %s" % message
            writelog(log_message)
        elif water_status == 'wet':
            message = "Dear @%s, %s BTW, I don't need watering and my CPU temp is %sºC" % (user_tweeted, tweetsList[randomChoice].rstrip('\n'), cputemp)
            sys.stdout.write("{} {}\n".format(len(message), message))
            log_message = "Tweeted %s" % message
            writelog(log_message)
        if camera_active:
            log_message = "Starting Camera"
            writelog(log_message)
            camera = PiCamera()
            log_message = "Camera Started"
            writelog(log_message)
            timestamp = time.strftime("%Y-%m-%d_%H%M%S", time.localtime())
            photo_path = 'photos/%s.jpg' % timestamp
            log_message = "Taking Picture"
            writelog(log_message)
            camera.capture(photo_path)
            time.sleep(3)
            camera.close()
            log_message = "Closed Camera"
            writelog(log_message)
            with open(photo_path, 'rb') as photo:
                response = api.upload_media(media=photo)
                api.update_status(media_ids=[response['media_id']], status=message)
                log_message = "Tweet Success"
                writelog(log_message)
        else:
            api.update_status(status=message)
            log_message = "Tweet Success"
            writelog(log_message)
        return None
    except IOError:
        if camera_active: camera.close()
        return None
# Camera function
def takeapicture():
    if camera_active:
        log_message = "Starting Camera"
        writelog(log_message)
        camera = PiCamera()
        log_message = "Camera Started"
        writelog(log_message)
        timestamp = time.strftime("%Y-%m-%d_%H%M%S", time.localtime())
        photo_path = 'photos/%s.jpg' % timestamp
        log_message = "Taking Picture"
        writelog(log_message)
        camera.capture(photo_path)
        time.sleep(3)
        camera.close()
        log_message = "Closed Camera"
        writelog(log_message)
try:
    takeapicture()

except KeyboardInterrupt:
    GPIO.cleanup()
    if camera_active: camera.close()
    file.close()


text:
<?php

use Generic_Sniffs_NamingConventions_CamelCapsFunctionNameSniff as Base;

/**
 * Class Chroma_Sniffs_NamingConventions_FunctionNameSniff
 *
 * @author Eduardo Trujillo <ed@chromabits.com>
 */
class Chroma_Sniffs_NamingConventions_FunctionNameSniff extends Base
{
    /**
     * Processes the tokens outside the scope.
     *
     * @param PHP_CodeSniffer_File $phpcsFile The file being processed.
     * @param int $stackPtr The position where this token was found.
     */
    protected function processTokenOutsideScope(
        PHP_CodeSniffer_File $phpcsFile,
        $stackPtr
    ) {
        $functionName = $phpcsFile->getDeclarationName($stackPtr);
        if ($functionName === null) {
            // Ignore closures.
            return;
        }

        $errorData = [$functionName];

        // Is this a magic function. i.e., it is prefixed with "__".
        if (preg_match('|^__|', $functionName) !== 0) {
            $magicPart = strtolower(substr($functionName, 2));
            if (isset($this->magicFunctions[$magicPart]) === false) {
                $error = 'Function name "%s" is invalid; only PHP magic methods'
                    . ' should be prefixed with a double underscore';

                $phpcsFile->addError(
                    $error,
                    $stackPtr,
                    'FunctionDoubleUnderscore',
                    $errorData
                );
            }

            return;
        }

        // Ignore first underscore in functions prefixed with "_".
        $functionName = ltrim($functionName, '_');

        if (preg_match('/^[a-z][_a-z]*$/', $functionName) === false) {
            $error = 'Function name "%s" is not in snake case format';
            $phpcsFile->addError($error, $stackPtr, 'NotCamelCaps', $errorData);
            $phpcsFile->recordMetric(
                $stackPtr,
                'snake_case function name',
                'no'
            );
        } else {
            $phpcsFile->recordMetric(
                $stackPtr,
                'snake_case method name',
                'yes'
            );
        }

    }
}


text:
package pollers

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"fmt"
	"io"

	"github.com/go-openapi/runtime"

	strfmt "github.com/go-openapi/strfmt"

	"github.com/spiegela/gorackhd/models"
)

// PollersLibGetReader is a Reader for the PollersLibGet structure.
type PollersLibGetReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PollersLibGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {

	case 200:
		result := NewPollersLibGetOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil

	default:
		result := NewPollersLibGetDefault(response.Code())
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		if response.Code()/100 == 2 {
			return result, nil
		}
		return nil, result
	}
}

// NewPollersLibGetOK creates a PollersLibGetOK with default headers values
func NewPollersLibGetOK() *PollersLibGetOK {
	return &PollersLibGetOK{}
}

/*PollersLibGetOK handles this case with default header values.

Successful retrieval of the list of all pollers in the library
*/
type PollersLibGetOK struct {
	Payload PollersLibGetOKBody
}

func (o *PollersLibGetOK) Error() string {
	return fmt.Sprintf("[GET /pollers/library][%d] pollersLibGetOK  %+v", 200, o.Payload)
}

func (o *PollersLibGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	// response payload
	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewPollersLibGetDefault creates a PollersLibGetDefault with default headers values
func NewPollersLibGetDefault(code int) *PollersLibGetDefault {
	return &PollersLibGetDefault{
		_statusCode: code,
	}
}

/*PollersLibGetDefault handles this case with default header values.

Unexpected error
*/
type PollersLibGetDefault struct {
	_statusCode int

	Payload *models.Error
}

// Code gets the status code for the pollers lib get default response
func (o *PollersLibGetDefault) Code() int {
	return o._statusCode
}

func (o *PollersLibGetDefault) Error() string {
	return fmt.Sprintf("[GET /pollers/library][%d] pollersLibGet default  %+v", o._statusCode, o.Payload)
}

func (o *PollersLibGetDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(models.Error)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

/*PollersLibGetOKBody pollers lib get o k body
swagger:model PollersLibGetOKBody
*/
type PollersLibGetOKBody interface{}


text:
typedef NS_ENUM(NSUInteger, SubpacketLength) {
    PacketLengthOneOctet,
    PacketLengthTwoOctet,
    PacketLengthFiveOctet
};

typedef NS_ENUM(NSUInteger, SignatureSubpacketType) {
    SignatureSubpacketReservedA = 0,
    SignatureSubpacketReservedB = 1,
    SignatureSubpacketCreationTime = 2,
    SignatureSubpacketExpirationTime = 3,
    SignatureSubpacketExportableCertification = 4,
    SignatureSubpacketTrustSignature = 5,
    SignatureSubpacketRegularExpression = 6,
    SignatureSubpacketRevocable = 7,
    SignatureSubpacketReservedC = 8,
    SignatureSubpacketKeyExpirationTime = 9,
    SignatureSubpacketPlaceholder = 10,
    SignatureSubpacketPreferredSymmetricAlgorithms = 11,
    SignatureSubpacketRevocationKey = 12,
    SignatureSubpacketReservedD = 13,
    SignatureSubpacketReservedE = 14,
    SignatureSubpacketReservedF = 15,
    SignatureSubpacketIssuer = 16,
    SignatureSubpacketReservedG = 17,
    SignatureSubpacketReservedH = 18,
    SignatureSubpacketReservedI = 19,
    SignatureSubpacketNotationData = 20,
    SignatureSubpacketPreferredHashAlgorithms = 21,
    SignatureSubpacketPreferredCompressionAlgorithms = 22,
    SignatureSubpacketKeyServerPreferences = 23,
    SignatureSubpacketPreferredKeyServer = 24,
    SignatureSubpacketPrimaryUserID = 25,
    SignatureSubpacketPolicyURI = 26,
    SignatureSubpacketKeyFlags = 27,
    SignatureSubpacketUserID = 28,
    SignatureSubpacketReasonForRevocation = 29,
    SignatureSubpacketFeatures = 30,
    SignatureSubpacketSignatureTarge = 31,
    SignatureSubpacketEmbeddedSignature = 32,
    SignatureSubpacketPrivateA = 100,
    SignatureSubpacketPrivateB = 101,
    SignatureSubpacketPrivateC = 102,
    SignatureSubpacketPrivateD = 103,
    SignatureSubpacketPrivateE = 104,
    SignatureSubpacketPrivateF = 105,
    SignatureSubpacketPrivateG = 106,
    SignatureSubpacketPrivateH = 107,
    SignatureSubpacketPrivateI = 108,
    SignatureSubpacketPrivateJ = 109,
    SignatureSubpacketPrivateK = 110
};

#define SignaturePacketVersionIndex 0

#define SignaturePacketV3HashLengthIndex 1
#define SignaturePacketV3SignatureTypeIndex 2
#define SignaturePacketV3CreationTimeIndex 3
#define SignaturePacketV3KeyIDIndex 7
#define SignaturePacketV3PKAlgorithmIndex 15
#define SignaturePacketV3HashAlgorithmIndex 16
#define SignaturePacketV3SignedHashIndex 17
#define SignaturePacketV3MPIIndex 19

#define SignaturePacketV4SignatureTypeIndex 1
#define SignaturePacketV4PKAlgorithmIndex 2
#define SignaturePacketV4HashAlgorithmIndex 3
#define SignaturePacketV4HashedSubpacketCountIndex 4

#define SignaturePacketV3HashLength 5

#pragma mark - SignaturePacket extension

@interface SignaturePacket ()

@property (nonatomic, readonly) NSData *hashData;

+ (NSUInteger)readPacketLength:(const Byte *)bytes index:(NSUInteger *)index;

- (void)readSubpackets:(NSData *)subpackets;

@end

#pragma mark - SignaturePacket implementation

@implementation SignaturePacket

+ (Packet *)packetWithBody:(NSData *)body {
    const Byte *bytes = body.bytes;

    NSUInteger versionNumber = bytes[SignaturePacketVersionIndex];

    switch (versionNumber) {
        case 3: {
            NSUInteger hashLength = bytes[SignaturePacketV3HashLengthIndex];

            if (hashLength != SignaturePacketV3HashLength) {
                [NSException exceptionWithName:NSInternalInconsistencyException
                                        reason:@"Packet version not supported."
                                      userInfo:@{@"versionNumber": @(versionNumber)}];
            }

            SignatureType signatureType = bytes[SignaturePacketV3SignatureTypeIndex];
            NSUInteger creationTime = [Utility readNumber:bytes + SignaturePacketV3CreationTimeIndex
                                                  length:4];

            NSString *keyId = [Utility keyIDFromBytes:bytes + SignaturePacketV3KeyIDIndex];

            PublicKeyAlgorithm publicKeyAlgorithm = bytes[SignaturePacketV3PKAlgorithmIndex];

            if (publicKeyAlgorithm != PublicKeyAlgorithmRSAEncryptSign) {
                [NSException exceptionWithName:NSInternalInconsistencyException
                                        reason:@"Public key algorithm not supported."
                                      userInfo:@{@"publicKeyAlgorithm": @(publicKeyAlgorithm)}];
            }

            HashAlgorithm hashAlgorithm = bytes[SignaturePacketV3HashAlgorithmIndex];

            if (hashAlgorithm != HashAlgorithmSHA256) {
                [NSException exceptionWithName:NSInternalInconsistencyException
                                        reason:@"Hash algorithm not supported."
                                      userInfo:@{@"hashAlgorithm": @(hashAlgorithm)}];
            }

            NSUInteger signedHashValue = [Utility readNumber:bytes + SignaturePacketV3SignedHashIndex
                                                      length:2];

            MPI *encryptedM = [MPI mpiFromBytes:(bytes + SignaturePacketV3MPIIndex)];

            return [[self alloc] initV3WithSignatureType:signatureType
                                      publicKeyAlgorithm:publicKeyAlgorithm
                                           hashAlgorithm:hashAlgorithm
                                            creationTime:creationTime
                                                   keyId:keyId
                                         signedHashValue:signedHashValue
                                                    data:encryptedM.data];
        }

        case 4: {
            SignatureType signatureType = bytes[SignaturePacketV4SignatureTypeIndex];

            PublicKeyAlgorithm publicKeyAlgorithm = bytes[SignaturePacketV4PKAlgorithmIndex];

            if (publicKeyAlgorithm != PublicKeyAlgorithmRSAEncryptSign) {
                [NSException exceptionWithName:NSInternalInconsistencyException
                                        reason:@"Public key algorithm not supported."
                                      userInfo:@{@"publicKeyAlgorithm": @(publicKeyAlgorithm)}];
            }

            HashAlgorithm hashAlgorithm = bytes[SignaturePacketV4HashAlgorithmIndex];

            if (hashAlgorithm != HashAlgorithmSHA256) {
                [NSException exceptionWithName:NSInternalInconsistencyException
                                        reason:@"Hash algorithm not supported."
                                      userInfo:@{@"hashAlgorithm": @(hashAlgorithm)}];
            }

            // Get hashed subpackets out:

            NSUInteger hashedSubpacketLength = [Utility readNumber:bytes + SignaturePacketV4HashedSubpacketCountIndex length:2];

            NSUInteger hashedSubpacketIndex = SignaturePacketV4HashedSubpacketCountIndex + 2;
            NSRange hashedSubpacketRange = NSMakeRange(hashedSubpacketIndex, hashedSubpacketLength);

            NSData *hashedSubpackets = [body subdataWithRange:hashedSubpacketRange];

            // Close off "hashed data":
            NSUInteger unhashedSubpacketCountIndex = hashedSubpacketIndex + hashedSubpacketLength;
            NSRange hashedRange = NSMakeRange(0, unhashedSubpacketCountIndex);

            NSData *hashData = [body subdataWithRange:hashedRange];

            // Get unhashed subpackets out:
            NSUInteger unhashedSubpacketLength = [Utility readNumber:(bytes + unhashedSubpacketCountIndex) length:2];
            NSUInteger unhashedSubpacketIndex = unhashedSubpacketCountIndex + 2;
            NSRange unhashedSubpacketRange = NSMakeRange(unhashedSubpacketIndex, unhashedSubpacketLength);

            NSData *unhashedSubpackets = [body subdataWithRange:unhashedSubpacketRange];

            // Get signed hash value:

            NSUInteger hashValueIndex = unhashedSubpacketIndex + unhashedSubpacketLength;
            NSUInteger signedHashValue = [Utility readNumber:(bytes + hashValueIndex) length:2];

            // Get MPI:
            MPI *encryptedM = [MPI mpiFromBytes:(bytes + hashValueIndex + 2)];

            return [[self alloc] initV4WithSignatureType:signatureType
                                      publicKeyAlgorithm:publicKeyAlgorithm
                                           hashAlgorithm:hashAlgorithm
                                                hashData:hashData
                                        hashedSubpackets:hashedSubpackets
                                      unhashedSubpackets:unhashedSubpackets
                                         signedHashValue:signedHashValue
                                                    data:encryptedM.data
                                                   keyID:nil];
        }

        default: {
            @throw [NSException exceptionWithName:NSInternalInconsistencyException
                                           reason:@"Packet version not supported."
                                         userInfo:@{@"versionNumber": @(versionNumber)}];
        }
    }

    return nil;
}

+ (SignaturePacket *)packetWithSignature:(Signature *)signature {

    NSMutableData *hashData = [NSMutableData data];
    Byte header[6];

    header[0] = 4;
    header[1] = signature.type;
    header[2] = PublicKeyAlgorithmRSAEncryptSign;
    header[3] = HashAlgorithmSHA256;

    NSData *hashedSubpackets = [self hashedSubpacketDataForSignature:signature];
    [Utility writeNumber:hashedSubpackets.length bytes:header + 4 length:2];

    [hashData appendBytes:header length:6];
    [hashData appendData:hashedSubpackets];

    Byte unhashedHeader[2] = {0, 0};
    [hashData appendBytes:unhashedHeader length:2];

    NSData *hashedData = [Crypto hashData:hashData];
    const Byte *hashedBytes = hashedData.bytes;

    NSUInteger signedHashValue = (hashedBytes[0] << 8) | hashedBytes[1];

    // TODO: PKCS Encode the signature data.

    return [[self alloc] initV4WithSignatureType:signature.type
                              publicKeyAlgorithm:PublicKeyAlgorithmRSAEncryptSign
                                   hashAlgorithm:HashAlgorithmSHA256
                                        hashData:hashData
                                hashedSubpackets:hashedSubpackets
                              unhashedSubpackets:[NSData data]
                                 signedHashValue:signedHashValue
                                            data:signature.data
                                           keyID:signature.keyID];

}

+ (NSData *)hashedSubpacketDataForSignature:(Signature *)signature {
    NSMutableData *data = [NSMutableData data];

    // Creation time subpacket:
    Byte creationTimeSubpacket[6];

    creationTimeSubpacket[0] = 5;
    creationTimeSubpacket[1] = SignatureSubpacketCreationTime;

    NSUInteger creationTime = [[NSDate date] timeIntervalSince1970];
    [Utility writeNumber:creationTime bytes:creationTimeSubpacket + 2 length:4];

    [data appendBytes:creationTimeSubpacket length:6];

    // Symmetric algorithms subpacket:
    Byte preferredSymmetricAlgorithmsSubpacket[3];

    preferredSymmetricAlgorithmsSubpacket[0] = 2;
    preferredSymmetricAlgorithmsSubpacket[1] = SignatureSubpacketPreferredSymmetricAlgorithms;
    preferredSymmetricAlgorithmsSubpacket[2] = SymmetricAlgorithmAES256;

    [data appendBytes:preferredSymmetricAlgorithmsSubpacket length:3];

    // Hash algorithms subpacket:
    Byte preferredHashAlgorithmsSubpacket[3];

    preferredHashAlgorithmsSubpacket[0] = 2;
    preferredHashAlgorithmsSubpacket[1] = SignatureSubpacketPreferredHashAlgorithms;
    preferredHashAlgorithmsSubpacket[2] = HashAlgorithmSHA256;

    [data appendBytes:preferredHashAlgorithmsSubpacket length:3];

    // Compression algorithms subpacket:
    Byte preferredCompressionAlgorithmsSubpacket[3];

    preferredCompressionAlgorithmsSubpacket[0] = 2;
    preferredCompressionAlgorithmsSubpacket[1] = SignatureSubpacketPreferredCompressionAlgorithms;
    preferredCompressionAlgorithmsSubpacket[2] = CompressionAlgorithmZLIB;

    [data appendBytes:preferredCompressionAlgorithmsSubpacket length:3];

    // Key Flags:
    Byte keyFlagsSubpacket[3];

    keyFlagsSubpacket[0] = 2;
    keyFlagsSubpacket[1] = SignatureSubpacketKeyFlags;
    keyFlagsSubpacket[2] = 0x01 | 0x02 | 0x04 | 0x08 | 0x20;

    [data appendBytes:keyFlagsSubpacket length:3];

    // Features:
    Byte features[3];

    features[0] = 2;
    features[1] = SignatureSubpacketFeatures;
    features[2] = 0x01;

    [data appendBytes:features length:3];

    return [NSData dataWithData:data];
}

+ (NSUInteger)readPacketLength:(const Byte *)bytes index:(NSUInteger *)index {

    NSUInteger currentIndex = *index;
    const Byte firstOctet = bytes[currentIndex++];

    if (firstOctet >= 0 && firstOctet <= 191) {
        *index = currentIndex;
        return firstOctet;
    }

    const Byte secondOctet = bytes[currentIndex++];

    if (firstOctet >= 192 && firstOctet <= 254) {
        *index = currentIndex;
        return ((firstOctet - 192) << 8) + secondOctet + 192;
    }

    const Byte thirdOctet = bytes[currentIndex++];
    const Byte fourthOctet = bytes[currentIndex++];
    const Byte fifthOctet = bytes[currentIndex++];

    *index = currentIndex;
    return (secondOctet << 24) | (thirdOctet << 16) | (fourthOctet << 8) | fifthOctet;
}

- (instancetype)initV3WithSignatureType:(SignatureType)signatureType
                     publicKeyAlgorithm:(PublicKeyAlgorithm)publicKeyAlgorithm
                          hashAlgorithm:(HashAlgorithm)hashAlgorithm
                           creationTime:(NSUInteger)creationTime
                                  keyId:(NSString *)keyId
                        signedHashValue:(NSUInteger)signedHashValue
                                   data:(NSData *)data {

    self = [self initWithVersionNumber:3
                         signatureType:signatureType
                    publicKeyAlgorithm:publicKeyAlgorithm
                         hashAlgorithm:hashAlgorithm
                       signedHashValue:signedHashValue
                                  data:data
                                 keyID:nil];

    if (self != nil) {
        _keyId = keyId;
        _creationTime = creationTime;
    }

    return self;
}

- (instancetype)initV4WithSignatureType:(SignatureType)signatureType
                     publicKeyAlgorithm:(PublicKeyAlgorithm)publicKeyAlgorithm
                          hashAlgorithm:(HashAlgorithm)hashAlgorithm
                               hashData:(NSData *)hashData
                       hashedSubpackets:(NSData *)hashedSubpackets
                     unhashedSubpackets:(NSData *)unhashedSubpackets
                        signedHashValue:(NSUInteger)signedHashValue
                                   data:(NSData *)data
                                  keyID:(NSString *)keyID {

    self = [self initWithVersionNumber:4
                         signatureType:signatureType
                    publicKeyAlgorithm:publicKeyAlgorithm
                         hashAlgorithm:hashAlgorithm
                       signedHashValue:signedHashValue
                                  data:data
                                 keyID:keyID];

    if (self != nil) {
        [self readSubpackets:hashedSubpackets];
        [self readSubpackets:unhashedSubpackets];
    }

    return self;
}

- (instancetype)initWithVersionNumber:(NSUInteger)versionNumber
                        signatureType:(SignatureType)signatureType
                   publicKeyAlgorithm:(PublicKeyAlgorithm)publicKeyAlgorithm
                        hashAlgorithm:(HashAlgorithm)hashAlgorithm
                      signedHashValue:(NSUInteger)signedHashValue
                                 data:(NSData *)data
                                keyID:(NSString *)keyID {
    self = [super initWithType:PacketTypeSignature];

    if (self != nil) {
        _versionNumber = versionNumber;
        _signatureType = signatureType;
        _publicKeyAlgorithm = publicKeyAlgorithm;
        _hashAlgorithm = hashAlgorithm;
        _signedHashValue = signedHashValue;
        _signatureData = data;
        _keyId = keyID;
    }

    return self;
}

- (void)readSubpackets:(NSData *)subpackets {
    const Byte *bytes = subpackets.bytes;
    NSUInteger currentIndex = 0;

    while (currentIndex < subpackets.length) {
        NSUInteger packetLength = [SignaturePacket readPacketLength:bytes index:&currentIndex];
        SignatureSubpacketType type = bytes[currentIndex++];

        const Byte *packetBytes = bytes + currentIndex;

        switch(type) {
            case SignatureSubpacketCreationTime: {
                _creationTime = [Utility readNumber:packetBytes length:4];
                break;
            }

            case SignatureSubpacketIssuer: {
                _keyId = [Utility keyIDFromBytes:packetBytes];

                break;
            }

            case SignatureSubpacketPreferredSymmetricAlgorithms: {
                NSMutableArray *array = [NSMutableArray array];

                for (int i = 0; i < packetLength - 1; i++) {
                    SymmetricAlgorithm symmetricAlgorithm = packetBytes[i];
                    [array addObject:@(symmetricAlgorithm)];
                }

                _preferredSymmetricAlgorithms = [NSArray arrayWithArray:array];

                break;
            }

            case SignatureSubpacketPreferredHashAlgorithms: {

                NSMutableArray *array = [NSMutableArray array];

                for (int i = 0; i < packetLength - 1; i++) {
                    HashAlgorithm hashAlgorithm = packetBytes[i];
                    [array addObject:@(hashAlgorithm)];
                }

                _preferredHashAlgorithms = [NSArray arrayWithArray:array];

                break;
            }

            case SignatureSubpacketPreferredCompressionAlgorithms: {

                NSMutableArray *array = [NSMutableArray array];

                for (int i = 0; i < packetLength - 1; i++) {
                    CompressionAlgorithm compressionAlgorithm = packetBytes[i];
                    [array addObject:@(compressionAlgorithm)];
                }

                _preferredCompressionAlgorithms = [NSArray arrayWithArray:array];

                break;
            }

            case SignatureSubpacketUserID: {
                char userID[packetLength];
                strcpy(userID, (const char *) packetBytes);

                _userId = [NSString stringWithCString:userID encoding:NSUTF8StringEncoding];

                break;
            }

            case SignatureSubpacketKeyFlags: {
                NSMutableArray *array = [NSMutableArray array];

                for (int i = 0; i < packetLength - 1; i++) {
                    NSUInteger flag = packetBytes[i];
                    [array addObject:@(flag)];
                }

                _keyFlags = [NSArray arrayWithArray:array];

                break;
            }

            case SignatureSubpacketFeatures: {
                NSMutableArray *array = [NSMutableArray array];

                for (int i = 0; i < packetLength - 1; i++) {
                    NSUInteger flag = packetBytes[i];
                    [array addObject:@(flag)];
                }

                _features = [NSArray arrayWithArray:array];

                break;
            }

            default:
                break;
        }

        currentIndex += packetLength - 1;
    }
}

- (NSData *)body {
    NSMutableData *data = [NSMutableData data];

    Byte header[6];

    header[0] = 4;
    header[1] = self.signatureType;
    header[2] = self.publicKeyAlgorithm;
    header[3] = self.hashAlgorithm;

    NSData *hashedSubpacketData = [self hashedSubpacketData];

    header[4] = (hashedSubpacketData.length >> 8) & 0xFF;
    header[5] = hashedSubpacketData.length & 0xFF;

    [data appendBytes:header length:6];
    [data appendData:hashedSubpacketData];

    Byte secondHeader[4];

    // Unhashed length:
    secondHeader[0] = 0;
    secondHeader[1] = 0;

    // Left 16 bits of signed hash:
    secondHeader[2] = (self.signedHashValue >> 8) & 0xFF;
    secondHeader[3] = self.signedHashValue & 0xFF;

    [data appendBytes:secondHeader length:4];

    MPI *mpi = [MPI mpiFromData:self.signatureData];
    [data appendData:mpi.data];

    return [NSData dataWithData:data];
}

- (NSData *)hashedSubpacketData {
    NSMutableData *data = [NSMutableData data];

    [self writeCreationTime:data];

    if (self.preferredSymmetricAlgorithms) {
        [self writeSymmetricAlgorithms:data];
    }

    if (self.keyId) {
        [self writeKeyID:data];
    }

    if (self.preferredHashAlgorithms) {
        [self writeHashAlgorithms:data];
    }

    if (self.preferredCompressionAlgorithms) {
        [self writeCompressionAlgorithms:data];
    }

    if (self.keyFlags) {
        [self writeKeyFlags:data];
    }

    if (self.features) {
        [self writeFeatures:data];
    }

    return [NSData dataWithData:data];
}

- (void)writeKeyID:(NSMutableData *)data {
    Byte subpacket[11];

    subpacket[0] = 9;
    subpacket[1] = SignatureSubpacketIssuer;

    [Utility writeKeyID:self.keyId toBytes:subpacket + 2];

    [data appendBytes:subpacket length:10];
}

- (void)writeCreationTime:(NSMutableData *)data {
    Byte subpacket[6];

    subpacket[0] = 5;
    subpacket[1] = SignatureSubpacketCreationTime;

    [Utility writeNumber:self.creationTime bytes:subpacket + 2 length:4];

    [data appendBytes:subpacket length:6];
}

- (void)writeSymmetricAlgorithms:(NSMutableData *)data {
    NSUInteger algorithmCount = self.preferredSymmetricAlgorithms.count;
    NSUInteger byteCount = algorithmCount + 2;

    Byte *subpacket = calloc(byteCount, sizeof(Byte));

    subpacket[0] = algorithmCount + 1;
    subpacket[1] = SignatureSubpacketPreferredSymmetricAlgorithms;

    for (int i = 0; i < algorithmCount; ++i) {
        NSNumber *number = self.preferredSymmetricAlgorithms[i];
        SymmetricAlgorithm algorithm = (SymmetricAlgorithm) number.unsignedIntegerValue;

        subpacket[i + 2] = algorithm;
    }

    [data appendBytes:subpacket length:byteCount];

    free(subpacket);
}

- (void)writeHashAlgorithms:(NSMutableData *)data {

    NSUInteger algorithmCount = self.preferredHashAlgorithms.count;
    NSUInteger byteCount = algorithmCount + 2;

    Byte *subpacket = calloc(byteCount, sizeof(Byte));

    subpacket[0] = algorithmCount + 1;
    subpacket[1] = SignatureSubpacketPreferredHashAlgorithms;

    for (int i = 0; i < algorithmCount; ++i) {
        NSNumber *number = self.preferredHashAlgorithms[i];
        HashAlgorithm algorithm = (HashAlgorithm) number.unsignedIntegerValue;

        subpacket[i + 2] = algorithm;
    }

    [data appendBytes:subpacket length:byteCount];

    free(subpacket);
}

- (void)writeCompressionAlgorithms:(NSMutableData *)data {

    NSUInteger algorithmCount = self.preferredCompressionAlgorithms.count;
    NSUInteger byteCount = algorithmCount + 2;

    Byte *subpacket = calloc(byteCount, sizeof(Byte));

    subpacket[0] = algorithmCount + 1;
    subpacket[1] = SignatureSubpacketPreferredCompressionAlgorithms;

    for (int i = 0; i < algorithmCount; ++i) {
        NSNumber *number = self.preferredCompressionAlgorithms[i];
        CompressionAlgorithm algorithm = (CompressionAlgorithm) number.unsignedIntegerValue;

        subpacket[i + 2] = algorithm;
    }

    [data appendBytes:subpacket length:byteCount];

    free(subpacket);
}

- (void)writeKeyFlags:(NSMutableData *)data {

    NSUInteger flagCount = self.keyFlags.count;
    NSUInteger byteCount = flagCount + 2;

    Byte *subpacket = calloc(byteCount, sizeof(Byte));

    subpacket[0] = flagCount + 1;
    subpacket[1] = SignatureSubpacketKeyFlags;

    for (int i = 0; i < flagCount; ++i) {
        subpacket[i + 2] = ((NSNumber *) self.keyFlags[i]).unsignedIntegerValue;
    }

    [data appendBytes:subpacket length:byteCount];

    free(subpacket);
}

- (void)writeFeatures:(NSMutableData *)data {

    NSUInteger featureCount = self.features.count;
    NSUInteger byteCount = featureCount + 2;

    Byte *subpacket = calloc(byteCount, sizeof(Byte));

    subpacket[0] = featureCount + 1;
    subpacket[1] = SignatureSubpacketFeatures;

    for (int i = 0; i < featureCount; ++i) {
        subpacket[i + 2] = ((NSNumber *) self.features[i]).unsignedIntegerValue;
    }

    [data appendBytes:subpacket length:byteCount];

    free(subpacket);
}

@end


text:
                This is the text that goes on the left side of the image. Note that the image
                has the "img-responsive" class assigned to it.


text:
layout: post
title: Boot up!
tags: [Kerja]
---

Recently, I've been working at project for big international client. It's an iPad application for their customers. I've had learned a lot about how small mistake in architectural decision could affect much for the development process. In this experiences, I found that many developers frustrated and even put their head at stake for this application.

Gladly for me, I have many experiences to learn about. Good architecture, bad architecture, new programming language (yeah, I've made myself expert at iOS application with Objective-C today), designing, and experiencing the USA work of field. Later post, I will share in this blog about this experiences.

In my spare times, I also working at my internal projects to build product. This is my sandbox playground to mix the latest technology I've known to make something. Cant wait to share here about it.


text:
using System;
using System.Globalization;

namespace Mercurial.Attributes
{
    /// <summary>
    /// This attribute can be applied to enum-properties in option classes,
    /// to specify the arguments to pass to the executable in case of
    /// each possible enum value for the property. Note that usage of any enum values that
    /// don't have a corresponding <see cref="EnumArgumentAttribute"/> will be ignored.
    /// </summary>
    [AttributeUsage(AttributeTargets.Property, AllowMultiple = true, Inherited = true)]
    public sealed class EnumArgumentAttribute : ArgumentAttribute
    {
        /// <summary>
        /// This is the backing field for the <see cref="Argument1"/> and <see cref="Argument2"/> properties.
        /// </summary>
        private readonly string[] _Arguments = new string[0];

        /// <summary>
        /// This is the backing field for the <see cref="Value"/> property.
        /// </summary>
        private readonly object _Value;

        /// <summary>
        /// Initializes a new instance of the <see cref="EnumArgumentAttribute"/> class
        /// with one argument for the enum value.
        /// </summary>
        /// <param name="value">The enum value.</param>
        /// <param name="argument1">The argument.</param>
        public EnumArgumentAttribute(object value, string argument1)
        {
            _Value = value;
            _Arguments = new[]
            {
                argument1
            };
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="EnumArgumentAttribute"/> class
        /// with two arguments for the enum value.
        /// </summary>
        /// <param name="value">The enum value.</param>
        /// <param name="argument1">The first argument.</param>
        /// <param name="argument2">The second argument.</param>
        public EnumArgumentAttribute(object value, string argument1, string argument2)
        {
            _Value = value;
            _Arguments = new[]
            {
                argument1, argument2
            };
        }

        /// <summary>
        /// Gets the enum value to map the arguments to.
        /// </summary>
        public object Value
        {
            get
            {
                return _Value;
            }
        }

        /// <summary>
        /// Gets the first argument that the <see cref="Value"/> is mapped to,
        /// or <see cref="string.Empty"/> if there is no argument.
        /// </summary>
        public string Argument1
        {
            get
            {
                if (_Arguments != null && _Arguments.Length >= 1)
                    return _Arguments[0];

                return string.Empty;
            }
        }

        /// <summary>
        /// Gets the second argument that the <see cref="Value"/> is mapped to,
        /// or <see cref="string.Empty"/> if there is no second argument.
        /// </summary>
        public string Argument2
        {
            get
            {
                if (_Arguments != null && _Arguments.Length >= 2)
                    return _Arguments[1];

                return string.Empty;
            }
        }

        /// <summary>
        /// Gets or sets a value indicating whether the enum value is a bitmask value (see <see cref="FlagsAttribute"/>)
        /// or not.
        /// </summary>
        public bool IsBitmask
        {
            get;
            set;
        }

        /// <summary>
        /// Gets a collection of options or arguments to pass to the Mercurial
        /// executable, based on the property value from the command class.
        /// </summary>
        /// <param name="propertyValue">
        /// The property value from the tagged property of the command class.
        /// </param>
        /// <returns>
        /// A collection of options or arguments, or an empty array or <c>null</c>
        /// for no options for the specified property value.
        /// </returns>
        public override string[] GetOptions(object propertyValue)
        {
            int propertyValueAsNumber = Convert.ToInt32(propertyValue, CultureInfo.InvariantCulture);
            int valueAsNumber = Convert.ToInt32(_Value, CultureInfo.InvariantCulture);

            if (IsBitmask)
            {
                if ((propertyValueAsNumber & valueAsNumber) == valueAsNumber)
                    return _Arguments;
            }
            else
            {
                if (propertyValueAsNumber == valueAsNumber)
                    return _Arguments;
            }

            return null;
        }
    }
}


text:
Indicates if multi field search is allowed.

    Boolean, default = true

If multi field search is allowed, user can search by (1) all fields typing a text in global search input control or (2) multiple fields
at a time when user clicks the "Search..." button and defines what fields he wants to search on. If multi field search is turned off, user can
only search one field at a time and he will not see the "Search..." button. He also will not see "All fields" in global search drop down.

This property can be defined during object creation:
<textarea class="javascript">
let grid = new w2grid({
    name        : 'grid',
    header      : 'Grid Header',
    multiSearch : false,
    columns: [
        { field: 'recid', text: 'ID', size: '50px' },
        { field: 'lname', text: 'Last Name', size: '30%' },
        { field: 'fname', text: 'First Name', size: '30%' },
        { field: 'email', text: 'Email', size: '40%' },
        { field: 'sdate', text: 'Start Date', size: '120px' },
        { field: 'sdate', text: 'End Date', size: '120px' }
    ]
});
</textarea>

Or any time after the grid has been created:

<textarea class="javascript">
grid.multiSearch = true;
grid.refresh();
</textarea>

If you do allow multi field search, but want to hide the "Search..." button, you can do so setting
.show.toolbarSearch to false. If the data source is remote all search fields will be submitted
to the remote data source. See grid overview for data structures it is going to submit.


text:
#pragma once

#include <lib/dnssd/minimal_mdns/records/Ptr.h>
#include <lib/dnssd/minimal_mdns/responders/RecordResponder.h>

namespace mdns {
namespace Minimal {

class PtrResponder : public RecordResponder
{
public:
    PtrResponder(const FullQName & qname, const FullQName & target) : RecordResponder(QType::PTR, qname), mTarget(target) {}

    void AddAllResponses(const chip::Inet::IPPacketInfo * source, ResponderDelegate * delegate,
                         const ResponseConfiguration & configuration) override
    {
        PtrResourceRecord record(GetQName(), mTarget);
        configuration.Adjust(record);
        delegate->AddResponse(record);
    }

private:
    const FullQName mTarget;
};

} // namespace Minimal
} // namespace mdns


text:
package cn.aezo.hibernate.hql1;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

public class MsgInfo { //VO DTO Value Object username p1 p2 UserInfo->User->DB
	private int id;
	private String cont;
	private String topicName;
	private String categoryName;
	public MsgInfo(int id, String cont, String topicName, String categoryName) {
		super();
		this.id = id;
		this.cont = cont;
		this.topicName = topicName;
		this.categoryName = categoryName;
	}
	public String getTopicName() {
		return topicName;
	}
	public void setTopicName(String topicName) {
		this.topicName = topicName;
	}
	public String getCategoryName() {
		return categoryName;
	}
	public void setCategoryName(String categoryName) {
		this.categoryName = categoryName;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}

	public String getCont() {
		return cont;
	}
	public void setCont(String cont) {
		this.cont = cont;
	}

}


text:
package net.firejack.platform.api.directory.domain;

import net.firejack.platform.api.registry.model.FieldType;
import net.firejack.platform.core.annotation.Property;
import net.firejack.platform.core.domain.Lookup;
import net.firejack.platform.core.utils.MessageResolver;
import net.firejack.platform.core.validation.annotation.DefaultValue;
import net.firejack.platform.core.validation.annotation.EnumValue;
import net.firejack.platform.core.validation.annotation.NotNull;
import net.firejack.platform.core.validation.constraint.RuleSource;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.Locale;

@Component
@XmlRootElement
@RuleSource("OPF.directory.UserProfileField")
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
@XmlAccessorType(XmlAccessType.PROPERTY)
public class UserProfileField extends Lookup {
	private static final long serialVersionUID = 986356294150314282L;

	@Property(name = "userProfileFieldGroup.id")
	private Long userProfileFieldGroupId;
    @Property(name = "userProfileFieldGroup.name")
    private String userProfileFieldGroupName;
	@Property
	private FieldType fieldType;

	public Long getUserProfileFieldGroupId() {
		return userProfileFieldGroupId;
	}

	public void setUserProfileFieldGroupId(Long userProfileFieldGroupId) {
		this.userProfileFieldGroupId = userProfileFieldGroupId;
	}

    public String getUserProfileFieldGroupName() {
        return userProfileFieldGroupName;
    }

    public void setUserProfileFieldGroupName(String userProfileFieldGroupName) {
        this.userProfileFieldGroupName = userProfileFieldGroupName;
    }

    @NotNull
	@EnumValue(enumClass = FieldType.class, hasName = true, hasDescription = true)
	@DefaultValue("INTEGER_NUMBER")
	public FieldType getFieldType() {
		return fieldType;
	}

	public void setFieldType(FieldType fieldType) {
		this.fieldType = fieldType;
	}

	public String getFieldTypeName() {
		return MessageResolver.messageFormatting("net.firejack.platform.api.registry.model.FieldType." + fieldType.name() + ".name", Locale.ENGLISH);
	}
}


text:
// Copyright 2014-2015, Bryan Stockus
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Sting.Host {
    public interface IDisplayableHost {

        String Title { get; }

        String SubTitle { get; }

        String Status { get; }

        String Details { get; }

        Boolean IsPaused { get; }

        Boolean IsHostUp { get; }
    }
}


text:
carouselBC
==========

An easy-to-use JQuery and javascript carousel that doesn't use the "mask" paradigm.

Steps to use this plugin:

1) Download the carouselBC.js, carouselBC.css, and Carousel_Pictures.txt files and upload them to your server.

2) Replace the urls, captions, and picture links in the Carousel_Pictures.txt file with your own.

3) Reference the js and css files in the <head> of your html, like this: link type='text/css' rel='stylesheet' href='carouselBC.css'/, script type='text/javascript' src='carouselBC.js' /script

4) Insert a div element with id="carouselBC" in your HTML at the desired location, like so: div id='carouselBC' /div

5) Invoke the plugin on the div in your javascript file, like this: $("#carouselBC").carouselBC();

6) You're done!

The plugin assembles the necessary HTML elements for the carousel and inserts them into the carouselBC div dynamically and on its own. Because of the way the plugin is written, the elements it generates and inserts can be styled by modifying the settings in the carouselBC.css directly. There is no need to venture into the source code.

You may use the same picture for the thumbnails along the bottom and for the big picture. The CSS in the plugin automatically resizes them to the default sizes. These sizes can be adjusted by modifying the CSS in carouselBC.css, but be aware that changing the size of the pictures will make it necessary to change the size and position of other elements as well. That said, because this plugin does not used the mask paradigm often used in slideshows, formatting both the big picture and the sliding bar at the bottom should be relatively easy and forgiving.

As always, if an element in your webpage shares an id or class with one of the elements in the plugin, there may be behavorial conflicts in either javascript or css.

This plugin is entirely namespaced, no global variables other than the method name $().carouselBC are added.


text:
package dao

import (
	"context"
	"flag"
	"os"
	"testing"
	"time"

	"go-common/app/service/main/riot-search/conf"

	"github.com/smartystreets/goconvey/convey"
)

var (
	d *Dao
)

func TestMain(m *testing.M) {
	if os.Getenv("DEPLOY_ENV") != "" {
		flag.Set("app_id", "main.search.riot-search")
		flag.Set("conf_token", "7cac78a7fdfe78c053879bf4dff0171b")
		flag.Set("tree_id", "55087")
		flag.Set("conf_version", "ut")
		flag.Set("deploy_env", "uat")
		flag.Set("conf_host", "config.bilibili.co")
		flag.Set("conf_path", "/tmp")
		flag.Set("region", "sh")
		flag.Set("zone", "sh001")
	} else {
		flag.Set("conf", "../cmd/ut.toml")
	}
	flag.Parse()
	if err := conf.Init(); err != nil {
		panic(err)
	}
	d = New(conf.Conf)
	os.Exit(m.Run())
}

// IncrementBackup ...
func TestIncrementBackup(t *testing.T) {
	convey.Convey("IncrementBackup", t, func(ctx convey.C) {
		ctx.Convey("When everything goes positive", func(ctx convey.C) {
			p1, err := d.IncrementBackup(context.Background(), time.Now(), time.Now())
			ctx.Convey("Error should be nil", func(ctx convey.C) {
				ctx.So(err, convey.ShouldBeNil)
				ctx.So(p1, convey.ShouldBeNil)
			})
		})
	})
	convey.Convey("Ping", t, func(ctx convey.C) {
		ctx.Convey("When everything goes positive", func(ctx convey.C) {
			err := d.Ping(context.Background())
			ctx.Convey("Error should be nil", func(ctx convey.C) {
				ctx.So(err, convey.ShouldBeNil)
			})
		})
	})
	convey.Convey("Close", t, func(ctx convey.C) {
		ctx.Convey("When everything goes positive", func(ctx convey.C) {
			d.Close()
			ctx.Convey("No return values", func(ctx convey.C) {
			})
		})
	})
}


text:
export type HasPendingMappingsResponse = {
  /**
   * If there is any clusters with pending mapping state.
   */
  pending: boolean;

  /**
   * Describe cluster pending (migrating, creating, deleting) mapping state.
   */
  clusters?: { [key: string]: string[] };
};


text:
$LOAD_PATH << './lib'

require 'informer/basic_watcher'

require 'informer/watcher/hostname'
require 'informer/watcher/process'

require 'informer/reporter/lcd'
require 'informer/reporter/standard_output'

class Informer

  attr_reader :watchers

  def initialize(reporter)
    @reporter = get_reporter(reporter)
    @watchers = []
  end

  def messages
    watchers.map {|watcher| watcher.report}
  end

  def report
    @reporter.report(messages)
  end

  def self.watch(reporter = "standard_output", &block)
    informer = Informer.new(reporter)
    informer.instance_eval(&block)
    informer.report
  end

  private

  def get_reporter(reporter)
    begin
      Reporter.const_get("#{reporter.camelize}")
    rescue NameError
      puts "No reporter exists named #{reporter}. We'll use standard output instead."
      Reporter::StandardOutput
    end
  end

  def method_missing(method, *args, &block)
    begin
      watcher = Watcher.const_get("#{method.to_s.camelize}")
      @watchers << watcher.new(*args, &block)
    rescue NameError => e
      puts "No watcher named #{method.to_s}. Error was: #{e}"
      super
    end

  end

end

class String
  def camelize
    self.split(/[^a-z0-9]/).map{|w|w.capitalize}.join("")
  end
end


text:
/* IMPORTANT:
 This file contains supplemental code used to populate the examples with dummy data and/or
 instructions. It is not necessary to import this file to use Material Components for iOS.
 */

#import <UIKit/UIKit.h>

#import "MaterialCollections.h"
#import "MaterialColorScheme.h"
#import "MaterialTypographyScheme.h"

@interface DialogsTypicalUseViewController : MDCCollectionViewController
@property(nonatomic, strong, nullable) NSArray *modes;
@property(nonatomic, strong, nullable) MDCSemanticColorScheme *colorScheme;
@property(nonatomic, strong, nullable) MDCTypographyScheme *typographyScheme;
@end

@interface DialogsTypicalUseViewController (Supplemental)
- (void)loadCollectionView:(nullable NSArray *)modes;
@end

@interface ProgrammaticViewController : UIViewController
@end

@interface OpenURLViewController : UIViewController
@end


text:
[![API Project](http://img.shields.io/badge/project-api-blue.svg)](https://github.com/betygen/api)
[![MIT License](http://img.shields.io/badge/license-MIT-red.svg)](http://opensource.org/licenses/MIT)
[![Stories in Ready](https://badge.waffle.io/betygen/web.svg?label=ready&title=ready)](http://waffle.io/betygen/web)

[![Master Branch](http://img.shields.io/badge/branch-master-blue.svg)](https://github.com/betygen/api/tree/master)
[![Production URL](http://img.shields.io/badge/url-api.betygen.se-lightgrey.svg)](http://api.betygen.se)
[![Build Status](https://travis-ci.org/betygen/api.svg?branch=master)](https://travis-ci.org/betygen/api)
[![Coverage Status](https://img.shields.io/coveralls/betygen/api.svg)](https://coveralls.io/r/betygen/api?branch=master)

[![Develop Branch](http://img.shields.io/badge/branch-develop-blue.svg)](https://github.com/betygen/api/tree/develop)
[![Stage URL](http://img.shields.io/badge/url-stage--api.betygen.se-lightgrey.svg)](http://stage-api.betygen.se)
[![Build Status](https://travis-ci.org/betygen/api.svg?branch=develop)](https://travis-ci.org/betygen/api)
[![Coverage Status](https://img.shields.io/coveralls/betygen/api.svg)](https://coveralls.io/r/betygen/api?branch=develop)


text:
package org.javaee.samples.forge;

import java.util.Arrays;
import java.util.List;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

public class IndexReaderTestCase {

	private IndexReader reader;

	@Before
	public void createReader() {
		reader = new IndexReader();
	}

	@Test
	public void shouldBeAbleToReadIndex() throws Exception {

		Assert.assertTrue(reader.all().size() > 0);
	}

	@Test
	public void shouldBeAbleToFilterIndex() throws Exception {

		List<Sample> all = reader.all();
		List<Sample> filtered = reader.search(IndexReader.byCategory("CDI"));

		//System.out.println(filtered);

		Assert.assertTrue(all.size() > filtered.size());
		Assert.assertTrue(filtered.size() > 0);
	}

	@Test
	public void shouldBeAbleToReadAllCategories() throws Exception {

		List<String> categories = reader.categories();
		//System.out.println(categories);

		Assert.assertTrue(categories.size() > 0);
	}

	@Test
	public void shouldBeAbleToFilterByUsage() throws Exception {

		List<Sample> categories = reader.search(IndexReader.byUsage(Arrays.asList("CDI", "SERVLET")));
		//System.out.println(categories);

		Assert.assertTrue(categories.size() > 0);
	}
}


text:
require_relative 'finder_concern'

module PostyClient
  module Resources
    class User < Base
      extend FinderConcern

      attr_reader :domain

      def initialize(domain, name=nil)
        @name = name
        @domain = domain
        load if name
      end

      def aliases
        UserAlias.find_all_by_user(self)
      end

      def slug
        [resource_slug, name].join('/')
      end

      def resource_slug
        [domain.slug, 'users'].join('/')
      end
    end
  end
end


text:
title: MR Personal Logo
fileName: MR-logo
description:
---


text:
layout: page
title: Kimberly Nelson's 70th Birthday
date: 2016-05-24
author: Billy Ashley
tags: weekly links, java
status: published
summary: Phasellus vitae rutrum tortor, in pulvinar arcu.
banner: images/banner/wedding.jpg
booking:
  startDate: 04/16/2018
  endDate: 04/21/2018
  ctyhocn: RSTNOHX
  groupCode: KN7B
published: true
---
Nulla facilisi. Curabitur faucibus nisl turpis. Mauris malesuada metus eu justo lacinia porttitor at non mi. Ut nec turpis id quam suscipit vehicula nec commodo odio. Proin nulla nisl, volutpat sed tellus et, vulputate viverra eros. Praesent finibus sit amet ex ac pharetra. Vivamus accumsan luctus ex sit amet elementum. Ut faucibus eros sed velit condimentum feugiat. Morbi aliquet accumsan neque id laoreet.

* Nam porttitor purus nec turpis fringilla aliquet
* Fusce blandit est a libero eleifend scelerisque
* Duis non orci blandit, vehicula dolor eget, pretium tellus
* Curabitur vestibulum tortor quis orci hendrerit, eu mattis odio venenatis
* Integer tempor dolor euismod congue porta.

Nulla convallis volutpat mollis. Proin gravida enim ut mi tempus aliquet. Morbi tristique convallis elit. Vestibulum scelerisque, lacus non varius dignissim, enim eros pellentesque nulla, convallis vestibulum neque ligula non lectus. Etiam ultrices imperdiet quam hendrerit vestibulum. Fusce quis malesuada odio, ac lacinia massa. Pellentesque ultricies suscipit nisl, ac ultricies nisi consequat id.
Fusce venenatis felis a auctor interdum. Vivamus et lectus id turpis vulputate venenatis. Donec vitae felis eget est vehicula venenatis. Curabitur vel elementum mi. Maecenas lobortis velit quis leo posuere auctor. Vivamus eu ante sem. Morbi faucibus id est sit amet tempor. Donec in mi tincidunt, fringilla risus ac, gravida mi. Cras vitae sagittis justo, id mollis leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam tempus lectus at metus accumsan maximus. Nulla blandit, est sed auctor vehicula, ligula diam aliquam leo, volutpat porta ligula turpis vel ante. Phasellus vel sapien sit amet nunc vestibulum convallis. Integer convallis sem diam, vel fringilla felis convallis quis.


text:
package org.apache.camel.util;

import java.util.Objects;

/**
 * Holder for a key and value.
 */
public class KeyValueHolder<K, V> {

    private final K key;
    private final V value;

    public KeyValueHolder(K key, V value) {
        this.key = key;
        this.value = value;
    }

    public K getKey() {
        return key;
    }

    public V getValue() {
        return value;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        KeyValueHolder<?, ?> that = (KeyValueHolder<?, ?>) o;
        return Objects.equals(key, that.key) &&
                Objects.equals(value, that.value);
    }

    @Override
    public int hashCode() {
        return Objects.hash(key, value);
    }

    @Override
    public String toString() {
        return key + " -> " + value;
    }
}


text:
<component name="ProjectDictionaryState">
  <dictionary name="aporter">
    <words>
      <w>relativelayout</w>
    </words>
  </dictionary>
</component>


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#2A373E</color>
    <color name="colorPrimaryDark">#455A64</color>
    <color name="colorAccent">#E11002</color>
    <color name="darkGrey">#2A373E</color>
    <color name="mediumGrey">#455A64</color>
    <color name="errorRed">#E11002</color>

    <color name="white">#FFFFFF</color>

<!-- Red Color -->
<color name="colorPrimaryRed">#FF1744</color>
<color name="colorPrimaryDarkRed">#D50000</color>
<color name="colorAccentRed">#FF8A80</color>

<!-- Pink Color -->
<color name="colorPrimaryPink">#F50057</color>
<color name="colorPrimaryDarkPink">#C51162</color>
<color name="colorAccentPink">#FF80AB</color>

<!-- Purple Color -->
<color name="colorPrimaryPurple">#D500F9</color>
<color name="colorPrimaryDarkPurple">#AA00FF</color>
<color name="colorAccentPurple">#EA80FC</color>

<!-- Deep Purple Color -->
<color name="colorPrimaryDeepPurple">#651FFF</color>
<color name="colorPrimaryDarkDeepPurple">#6200EA</color>
<color name="colorAccentDeepPurple">#B388FF</color>

<!-- Indigo Color -->
<color name="colorPrimaryIndigo">#3D5AFE</color>
<color name="colorPrimaryDarkIndigo">#304FFE</color>
<color name="colorAccentIndigo">#8C9EFF</color>

<!-- Blue Color -->
<color name="colorPrimaryBlue">#2979FF</color>
<color name="colorPrimaryDarkBlue">#2962FF</color>
<color name="colorAccentBlue">#82B1FF</color>

<!-- Light Blue Color -->
<color name="colorPrimaryLightBlue">#00B0FF</color>
<color name="colorPrimaryDarkLightBlue">#0091EA</color>
<color name="colorAccentLightBlue">#80D8FF</color>

<!-- Cyan Color -->
<color name="colorPrimaryCyan">#00E5FF</color>
<color name="colorPrimaryDarkCyan">#00B8D4</color>
<color name="colorAccentCyan">#84FFFF</color>

<!-- Teal Color -->
<color name="colorPrimaryTeal">#1DE9B6</color>
<color name="colorPrimaryDarkTeal">#00BFA5</color>
<color name="colorAccentTeal">#A7FFEB</color>

<!-- Green Color -->
<color name="colorPrimaryGreen">#00E676</color>
<color name="colorPrimaryDarkGreen">#00C853</color>
<color name="colorAccentGreen">#B9F6CA</color>

<!-- Light Green Color -->
<color name="colorPrimaryLightGreen">#76FF03</color>
<color name="colorPrimaryDarkLightGreen">#64DD17</color>
<color name="colorAccentLightGreen">#CCFF90</color>

<!-- Lime Color -->
<color name="colorPrimaryLime">#C6FF00</color>
<color name="colorPrimaryDarkLime">#AEEA00</color>
<color name="colorAccentLime">#F4FF81</color>

<!-- Yellow Color -->
<color name="colorPrimaryYellow">#FFEA00</color>
<color name="colorPrimaryDarkYellow">#FFD600</color>
<color name="colorAccentYellow">#FFFF8D</color>

<!-- Amber Color -->
<color name="colorPrimaryAmber">#FFC400</color>
<color name="colorPrimaryDarkAmber">#FFAB00</color>
<color name="colorAccentAmber">#FFE57F</color>

<!-- Orange Color -->
<color name="colorPrimaryOrange">#FF9100</color>
<color name="colorPrimaryDarkOrange">#FF6D00</color>
<color name="colorAccentOrange">#FFD180</color>

<!-- Deep Orange Color -->
<color name="colorPrimaryDeepOrange">#FF3D00</color>
<color name="colorPrimaryDarkDeepOrange">#DD2C00</color>
<color name="colorAccentDeepOrange">#FF9E80</color>

<!-- Brown Color -->
<color name="colorPrimaryBrown">#8D6E63</color>
<color name="colorPrimaryDarkBrown">#5D4037</color>
<color name="colorAccentBrown">#D7CCC8</color>

<!-- Grey Color -->
<color name="colorPrimaryGrey">#BDBDBD</color>
<color name="colorPrimaryGreyLight">#DDDDDD</color>
<color name="colorPrimaryDarkGrey">#616161</color>
<color name="colorAccentGrey">#F5F5F5</color>

<!-- Blue Grey Color -->
<color name="colorPrimaryBlueGrey">#78909C</color>
<color name="colorPrimaryDarkBlueGrey">#455A64</color>
<color name="colorAccentBlueGrey">#CFD8DC</color>

<!-- Black Color -->
<color name="colorPrimaryBlack">#000000</color>
<color name="colorPrimaryDarkBlack">#000000</color>
<color name="colorAccentBlack">#FFFFFF</color>

<!-- Do not change: Fixed Color -->
<color name="textColorPrimary">#FFFFFF</color>
<color name="windowBackground">#FFFFFF</color>
<color name="navigationBarColor">#000000</color>

</resources>


text:
package mem

import (
	"os/exec"
	"strconv"
	"strings"

	common "github.com/shirou/gopsutil/common"
)

func getPageSize() (uint64, error) {
	out, err := exec.Command("pagesize").Output()
	if err != nil {
		return 0, err
	}
	o := strings.TrimSpace(string(out))
	p, err := strconv.ParseUint(o, 10, 64)
	if err != nil {
		return 0, err
	}

	return p, nil
}

// VirtualMemory returns VirtualmemoryStat.
func VirtualMemory() (*VirtualMemoryStat, error) {
	p, err := getPageSize()
	if err != nil {
		return nil, err
	}

	total, err := common.DoSysctrl("hw.memsize")
	if err != nil {
		return nil, err
	}
	free, err := common.DoSysctrl("vm.page_free_count")
	if err != nil {
		return nil, err
	}
	parsed := make([]uint64, 0, 7)
	vv := []string{
		total[0],
		free[0],
	}
	for _, target := range vv {
		t, err := strconv.ParseUint(target, 10, 64)
		if err != nil {
			return nil, err
		}
		parsed = append(parsed, t)
	}

	ret := &VirtualMemoryStat{
		Total: parsed[0],
		Free:  parsed[1] * p,
	}

	// TODO: platform independent (worked freebsd?)
	ret.Available = ret.Free + ret.Buffers + ret.Cached

	ret.Used = ret.Total - ret.Free
	ret.UsedPercent = float64(ret.Total-ret.Available) / float64(ret.Total) * 100.0

	return ret, nil
}

// SwapMemory returns swapinfo.
func SwapMemory() (*SwapMemoryStat, error) {
	var ret *SwapMemoryStat

	swapUsage, err := common.DoSysctrl("vm.swapusage")
	if err != nil {
		return ret, err
	}

	total := strings.Replace(swapUsage[2], "M", "", 1)
	used := strings.Replace(swapUsage[5], "M", "", 1)
	free := strings.Replace(swapUsage[8], "M", "", 1)

	total_v, err := strconv.ParseFloat(total, 64)
	if err != nil {
		return nil, err
	}
	used_v, err := strconv.ParseFloat(used, 64)
	if err != nil {
		return nil, err
	}
	free_v, err := strconv.ParseFloat(free, 64)
	if err != nil {
		return nil, err
	}

	u := float64(0)
	if total_v != 0 {
		u = ((total_v - free_v) / total_v) * 100.0
	}

	// vm.swapusage shows "M", multiply 1000
	ret = &SwapMemoryStat{
		Total:       uint64(total_v * 1000),
		Used:        uint64(used_v * 1000),
		Free:        uint64(free_v * 1000),
		UsedPercent: u,
	}

	return ret, nil
}


text:
from __future__ import unicode_literals

import django.db.models.deletion
import wagtail.core.fields
from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('wagtailcore', '0001_initial'),
        ('pages', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='RegularPage',
            fields=[
                ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),  # noqa: E501
                ('subtitle', models.CharField(blank=True, default='', max_length=255)),
                ('body', wagtail.core.fields.RichTextField(blank=True, default='')),
            ],
            options={
                'abstract': False,
            },
            bases=('wagtailcore.page',),
        ),
    ]


text:
//
//  UIBezierPath+SVG.m
//  LXFCommonCode
//
//  Created by 林洵锋 on 2017/3/3.
//  Copyright © 2017年 LXF. All rights reserved.
//
//  GitHub: https://github.com/LinXunFeng
//  简书: http://www.jianshu.com/users/31e85e7a22a2
#import "UIBezierPath+SVG.h"
static void SVGApplier(void* info, const CGPathElement* element);
@implementation UIBezierPath (ZTKit)
/**
 *  @brief  UIBezierPath转成SVG
 *
 *  @return SVG
 */
- (NSString*)toSVGString
{
    CGPathRef path = [self CGPath];
    NSMutableString* SVGString = [NSMutableString string];
    [SVGString appendString:@"<path id=\"temporaryID\" d=\""];
    CGPathApply(path, (__bridge_retained void*)SVGString, SVGApplier);
    NSString *lineCap;
    switch (self.lineCapStyle) {
        case kCGLineCapRound:
            lineCap = @"round";
            break;
        case kCGLineCapSquare:
            lineCap = @"square";
            break;
        default:
            lineCap = @"butt";
            break;
    }
    [SVGString appendFormat:@"\" stroke-linecap=\"%@\" stroke-width=\"%i\" fill=\"none\" stroke=\"red\" />", lineCap, (int)self.lineWidth];
    return [NSString stringWithFormat:@"%@", SVGString];
}
@end

static void SVGApplier(void* info, const CGPathElement* element)
{
    NSMutableString* SVGString = (__bridge NSMutableString*) info;
    int nPoints;
    char elementKey;
    switch (element->type)
    {
        case kCGPathElementMoveToPoint:
            nPoints = 1;
            elementKey = 'M';
            break;
        case kCGPathElementAddLineToPoint:
            nPoints = 1;
            elementKey = 'L';
            break;
        case kCGPathElementAddQuadCurveToPoint:
            nPoints = 2;
            elementKey = 'Q';
            break;
        case kCGPathElementAddCurveToPoint:
            nPoints = 3;
            elementKey = 'C';
            break;
        case kCGPathElementCloseSubpath:
            nPoints = 0;
            elementKey = 'Z';
            break;
        default:
            SVGString = nil;
            return;
    }
    NSString* nextElement = [NSString stringWithFormat:@" %c", elementKey];
    for (int i = 0; i < nPoints; i++) {
        nextElement = [nextElement stringByAppendingString:[NSString stringWithFormat:@" %i %i", (int)element->points[i].x, (int)element->points[i].y]];
    }
    [SVGString appendString:nextElement];
}


text:
/*! \file Observer.hpp
  \brief General interface to define an Observer
*/

#ifndef Observer_H
#define Observer_H

#include <string>
#include <set>
#include "RuntimeException.hpp"
#include "SiconosPointers.hpp"

#include "SiconosFwd.hpp"

#include "SiconosAlgebraTypeDef.hpp"
#include "ControlTypeDef.hpp"
#include "SiconosControlFwd.hpp"

/** Observers Base Class

   \author SICONOS Development Team - copyright INRIA
   \version 3.6.0
   \date (Creation) May 21, 2013

   Abstract class, interface to user-defined observers.

   An Observer is dedicated to estimate the state of a DynamicalSystem given
   its dynamics, inputs and a initial estimate of the state.
*/

class Observer
{
protected:
  /** serialization hooks
  */
  ACCEPT_SERIALIZATION(Observer);

  /** type of the Observer */
  int _type;

  /** the DynamicalSystem used in the Observer */
  SP::DynamicalSystem _DS;

  /** The TimeDiscretisation */
  SP::TimeDiscretisation _td;

  /** the sensor that feed the observer */
  SP::ControlSensor _sensor;

  /** estimated state */
  SP::SiconosVector _xHat;

  /** The error \f$e=\hat{y}-y\f$ */
  SP::SiconosVector _e;

  /** The measurements from the sensor */
  SP::SiconosVector _y;

  /** id of the Observer */
  std::string _id;

  /** Model for integration */
  SP::Model _model;

  /** Simulation for integration */
  SP::TimeStepping _simulation;

  /** Integration for integration */
  SP::OneStepIntegrator _integrator;

  /** default constructor
   */
  Observer();

public:

  /** Constructor with a TimeDiscretisation.
   * \param type the type of the Observer, which corresponds to the class type
   * \param sensor the SP::Sensor to get the measurements
   * \param xHat0 the initial guess for the state
   * \param newId the id of the Observer
   */
  Observer(unsigned int type, SP::ControlSensor sensor, const SiconosVector& xHat0, const std::string& newId = "none");

  /** Constructor with a TimeDiscretisation.
   * \param type the type of the Observer, which corresponds to the class type.
   * \param sensor the SP::Sensor to get the measurements
   * \param xHat0 the initial guess for the state
   * \param ds the SP::DynamicalSystem used as a model for the real DynamicalSystem
   * \param newId the id of the Observer
   */
  Observer(unsigned int type, SP::ControlSensor sensor, const SiconosVector& xHat0, SP::DynamicalSystem ds, const std::string& newId = "none");

  /** destructor
   */
  virtual ~Observer();

  /** set id of the Observer
   *  \param newId the new id.
   */
  inline void setId(const std::string& newId)
  {
    _id = newId;
  };

  /** get id of the Observer
   *  \return a string
   */
  inline const std::string getId() const
  {
    return _id;
  };

  /** get the type of the Observer (ie class name)
   *  \return an integer
   */
  inline int getType() const
  {
    return _type;
  };

  /** This is derived in child classes if they need to copy the TimeDiscretisation
   * associated with this Sensor
  *  \param td the TimeDiscretisation for this Sensor
  */
  virtual void setTimeDiscretisation(const TimeDiscretisation& td);

  /** initialize observer data.
   * \param m a SP::Model
   */
  virtual void initialize(const Model& m);

  /** capture data when the ObserverEvent is processed
   */
  virtual void process() = 0;

  /** display the data of the Observer on the standard output
   */
  void display() const;

  /** get the error e
   * \return a pointer to e
   */
  inline SP::SiconosVector e()
  {
    return _e;
  }

  /** get the estimated state
   * \return a pointer to xHat
   */
  inline SP::SiconosVector xHat()
  {
    return _xHat;
  }

  /** Set the DynamicalSystem used in the Observer
   * \param ds the DynamicalSystem used in the Observer
   */
  inline void setDS(SP::DynamicalSystem ds)
  {
    _DS = ds;
  }

  /** get the Model used in the Observer
   * \return The Model used in the Observer
   */
  virtual SP::Model getInternalModel() const { return _model; };

};

#endif


text:
package org.gradle.api.artifacts.repositories;

import org.gradle.internal.HasInternalProtocol;

/**
 * A repository for resolving and publishing artifacts.
 */
@HasInternalProtocol
public interface ArtifactRepository {
    /**
     * Returns the name for this repository. A name must be unique amongst a repository set. A default name is provided for the repository if none
     * is provided.
     *
     * <p>The name is used in logging output and error reporting to point to information related to this repository.
     *
     * @return The name.
     */
    String getName();

    /**
     * Sets the name for this repository.
     *
     * If this repository is to be added to an {@link org.gradle.api.artifacts.ArtifactRepositoryContainer}
     * (including {@link org.gradle.api.artifacts.dsl.RepositoryHandler}), its name should not be changed after it has
     * been added to the container. This capability has been deprecated and is scheduled to be removed in the next major
     * Gradle version.
     *
     * @param name The name. Must not be null.
     */
    void setName(String name);
}


text:
Ring modulation effect.

Example:
```javascript
a = Pluck().play( Rndi(100,1000), 1/4 )

r = RingMod({ amp: 1, frequency:440 })

a.fx.add( r )
```

#### Properties

* _frequency_ : Default range: { 20, 3000 }. The frequency of the modulating oscillator.
* _amp_  : Default range: { 0, 1 }. Amplitude of the modulating oscillator.

#### Methods

None worth mentioning.


text:
require("dotenv").config();
const _ = require("lodash");
const express = require("express");
const DynamicRecord = require("dynamic-record");
const jwt = require("jsonwebtoken");
const Promise = require("bluebird");
const nanoid = require("nanoid");

const router = express.Router();
const auth = require("../../utils/auth.js");
Promise.promisifyAll(jwt);
const CharError = require("../../utils/charError.js");
const Users = new DynamicRecord({
	tableSlug: "_users_auth"
});

// Route: {root}/api/tokens/...

const secret = process.env.JWT_SECRET;

// Generate token for user
router.post("/generate_new_token", function(req, res, next){
	// First, authenticate username and password pair
	auth.authenticate(req.body.username, req.body.password).then((user) => {
		// User sucessfully authenticated
		return jwt.signAsync({
			username: user.data.username,
			role: user.data.role
		}, secret, {
			expiresIn: "7d"
		}).then((token) => {
			res.json({"access_token": token});
		});
	}).catch((err) => {
		next(err);
	});
});

router.post("/generate_anonymous_token", function(req, res, next){
	// First, authenticate username and password pair
	auth.authenticate(req.body.username, req.body.password).then((user) => {
		// User sucessfully authenticated
		const tokenID = nanoid(20);
		if(Array.isArray(user.data.anonymous_tokens)){
			user.data.anonymous_tokens.push(tokenID);
		}else{
			user.data.anonymous_tokens = [tokenID];
		}

		// NOTE: Was meaning to save the token in the database but still need more implementation
		// return user.save().then(() => {
		return Promise.resolve(tokenID);
		// });
	}).then((tokenID) => {
		return jwt.signAsync({
			username: "anonymous",
			role: "anonymous",
			tokenID: tokenID
		}, secret);
	}).then((token) => {
		res.json({"access_token": token});
	}).catch((err) => {
		next(err);
	});
});

router.use("/", function(req, res){
	res.json({
		message: "Invalid route"
	});
});

module.exports = router;


text:
[![npm version](https://badge.fury.io/js/baseguide.svg)](https://www.npmjs.com/package/baseguide)

Baseguide is a lightweight and robust CSS framework for prototyping and production code.

* **Responsive** and scalable components
* **Robust** flexbox grid
* **Extendable** breakpoint system
* **Consistent** vertical rhythm and modular scale

## Table of Contents
* [Install](#install)
* [Development](#development)
* [Breakpoints](#breakpoints)
* [Grid](#grid)
* [Forms](#forms)
* [Typography](#typography)
* [Browser Support](#browser-support)
* [Inspired By](#inspired-by)
* [License](#license)

## Install

### Download

* [baseguide.css](https://raw.githubusercontent.com/slavanga/baseguide/master/dist/css/baseguide.css) (uncompressed)
* [baseguide.min.css](https://raw.githubusercontent.com/slavanga/baseguide/master/dist/css/baseguide.min.css) (compressed)

### CDN

This is great for prototyping, but doesn't allow any customization. To load Baseguide via [unpkg](https://unpkg.com), add this to your ```<head>```:

```html
<link rel="stylesheet" href="https://unpkg.com/baseguide@4.2.0/dist/css/baseguide.min.css">
```

### Package Managers

[npm](https://www.npmjs.com/package/baseguide): `npm install baseguide`

[yarn](https://yarnpkg.com/en/package/baseguide): `yarn add baseguide`

## Development

### Dependencies
Use `npm install` or `yarn install` to install the dev dependencies.

### Gulp
The included gulpfile takes care of compiling, optimizing and minifying your assets.

| Command           | Description                                                                                |
| :---------------- | :------------------------------------------------------------------------------------------------------- |
| `gulp`            | Build files, watch for changes and start a local server using [Browsersync](https://www.browsersync.io/) |
| `gulp build`      | Build files once                                                                                |
| `gulp watch`      | Watch files and build when a change occurs                                                               |
| `gulp lint`       | Lint the scss and js source files                                                                        |

### Sass
Default variables can be changed before importing Baseguide.
Take a look at the [_settings.scss](https://github.com/slavanga/baseguide/blob/master/scss/baseguide/00-settings/_settings.scss) file to see all variables.

```scss
$button-bg: #bada55; // 1. Customize default variables

@import 'baseguide'; // 2. Import Baseguide

// 3. Add your own styles here
```

## Breakpoints
Breakpoints can easily be configured using the ```$mq-breakpoints``` map. Note that the breakpoints have to be sorted from small to large.

The default configuration looks like this:

```scss
$mq-breakpoints: (
  xs: 0,
  sm: 400px,
  md: 680px,
  lg: 960px,
  xl: 1200px
);
```

Baseguide generates all the necessary grid and responsive visibility classes based on these breakpoints.

### Media Queries
Media Queries are handled by [Sass MQ](https://github.com/sass-mq/sass-mq).

```scss
// include the media query mixin and pass the breakpoint key
@include mq(md) {

}
```

The snippet above compiles to the following CSS:

```css
@media (min-width: 42.5em) {

}
```

Check out the [Sass MQ documentation](https://sass-mq.github.io/sass-mq/#mixin-mq) for more details and advanced usage of media queries.

### Breakpoint Loop
The ```loop-breakpoints``` mixin iterates through all breakpoints. It sets three global variables and outputs the ```@content``` for each breakpoint.
```scss
@include loop-breakpoints($breakpoints: $mq-breakpoints, $inclusive: true, $mq: true) {
  @debug $breakpoint;
  @debug $is-first-breakpoint;
  @debug $is-last-breakpoint;
}
```

It's a powerful tool that for example allows the generation of additional responsive helper classes.
```scss
@include loop-breakpoints {
  .text-#{$breakpoint}-left {
    text-align: left;
  }

  .text-#{$breakpoint}-center {
    text-align: center;
  }

  .text-#{$breakpoint}-right {
    text-align: right;
  }
}
```

## Grid
The grid system is responsive and follows the mobile first pattern. It offers predefined classes for quick layouts as well as powerful mixins for more semantic layouts.

The number of columns is controlled by the ```$grid-columns``` variable which defaults to 12.

### Basic Example

```html
<div class="container">
  <div class="row">
    <div class="col col-md-6"></div>
    <div class="col col-md-6"></div>
  </div>
</div>
```

### Gutters
The gutters are controlled by the ```$grid-gutter``` variable. It can either be a global value across all breakpoints or a map with gutter values per breakpoint.

```scss
// set gutter for all breakpoints
$grid-gutter: 60px;

// start with 20px gutter and increase to 40px from the md breakpoint
// note: breakpoints can be skipped to keep the last defined value
$grid-gutter: (
  xs: 20px,
  md: 40px
);
```

Accessing gutter values is easy using the ```get-gutter``` function. The smallest gutter gets returned by default.

```scss
.col {
  margin-bottom: get-gutter();

  @include mq(md) {
    margin-bottom: get-gutter(md);
  }
}
```

### Mixins
The grid mixins can be used to create custom containers, rows and columns.

```scss
// $gutter: gutter width in pixels or map with gutters, defaults to $grid-gutter
// $size: column width as percentage value, decimal number or column count
// $columns: an integer, the total number of columns, defaults to $grid-columns
// $width: container width in pixels, defaults to $grid-container

@include container($gutter, $width);
@include row($gutter);

@include column-base($gutter, $size, $columns);
@include column($size, $columns);

@include column-push($size, $columns);
@include column-pull($size, $columns);
@include column-offset($size, $columns);

@include column-block($columns);
```

#### Two Column Layout

```scss
@include mq(sm) {
  .col-content {
    @include column(80%);
  }

  .col-sidebar {
    @include column(40%);
  }
}
```

```html
<div class="container">
  <div class="row">
    <article class="col col-content">Main Content</article>
    <aside class="col col-sidebar">Sidebar</aside>
  </div>
</div>
```

#### Gallery Layout Using Block Grid

```scss
.col-gallery {
  @include column-base;
  @include column-block(3);

  @include mq(md) {
    @include column-block(6);
  }
}
```

```html
<div class="container">
  <div class="row">
    <div class="col-gallery">Gallery item</div>
    <div class="col-gallery">Gallery item</div>
    <div class="col-gallery">Gallery item</div>
    <div class="col-gallery">Gallery item</div>
    <div class="col-gallery">Gallery item</div>
    <div class="col-gallery">Gallery item</div>
  </div>
</div>
```

## Forms

### Standard Form Controls
All form controls listed in ```$input-selector``` get styled by default. The variable can be changed to a custom selector like ```.form-control```. This will allow you to selectively style form controls based on that selector.

### Custom Form Controls
The custom forms component was designed with progressive enhancement in mind.
Browsers that support [feature queries](https://caniuse.com/#feat=css-featurequeries) and [appearance](https://caniuse.com/#feat=css-appearance) get the fully enhanced experience.

## Typography

### Headings
The value for ```$type-scale-base``` defines the smallest heading (h6). From there the remaining heading font sizes are calculated using the ```$type-scale```. Major Third (1.25) is the default type scale. Check [type-scale.com](https://type-scale.com/) for more scales.

By using a map for ```$type-scale-base``` you can scale all headings up or down in harmony on a specific breakpoint.

```scss
$type-scale-base: (
  xs: $font-size-base,
  md: $font-size-base * 2
);
```

## Browser Support
* Latest stable: Chrome, Edge, Firefox
* IE 11+
* Safari 9+
* Mobile Safari 9+
* Android Browser 4.4+

Baseguide uses [Autoprefixer](https://github.com/postcss/autoprefixer) to handle CSS vendor prefixes.

## Inspired By…
* [Article: Styling with STRINGS](http://simurai.com/blog/2014/05/04/cssconf)
* [Bootstrap](https://getbootstrap.com)
* [Bourbon](https://www.bourbon.io)
* [Foundation](https://foundation.zurb.com)
* [HTML5 Boilerplate](https://html5boilerplate.com)

## License
The code is released under the [MIT license](https://github.com/slavanga/baseguide/blob/master/LICENSE).