text:
<repo_name>gangwug/MetaCycleApp<file_sep>/README.md
This repository contains a web application for MetaCycle.

## Introduction
MetaCycle is an R package for evaluating periodicity in large scale time-series datasets. To see more information about MetaCycle, please visit its location in [CRAN](https://cran.r-project.org/web/packages/MetaCycle/index.html) or [GitHub](https://github.com/gangwug/MetaCycle). For facilitating using MetaCycle, a web application for its **meta2d** function has been prepared based on [shiny](http://shiny.rstudio.com) package. For successfully running this web application, R (≥ 3.0.2) is required.

## Usage
```r
# install 'shiny' package (if 'shiny' is not installed yet)
install.packages("shiny")
# load 'shiny' package
library(shiny)

# the easy way to run this web application
runGitHub("MetaCycleApp", "gangwug")

# Or you can download 'ui.R' and 'server.R' from this page, and place these two files into an directory named 'MetaCycleApp'.
# Then set 'MetaCycleApp' as your working directory (see more introduction about working directory-http://shiny.rstudio.com/tutorial/quiz/).
# Now you can launch this app in R with the below commands.
runApp("MetaCycleApp")

```
<file_sep>/ui.R
library(shiny)
##uploading file
shinyUI(fluidPage(
  titlePanel(h2("Welcome to MetaCycle") ),
  sidebarLayout(

    sidebarPanel(
      fluidRow(
        column(6,
               fileInput('file1', label=h5('Choose Data File'),
                         accept=c('text/csv',
                                  'text/comma-separated-values,text/plain', '.csv')) )
      ),
     fluidRow(
       column(6,
              radioButtons('fstyle', label=h5('fileStyle'),
                   choices=c("csv"='csv', "txt"='txt'),
                   selected='csv', inline=FALSE) ),
       column(6,
              radioButtons('outraw', label=h5('outRawData'),
                           choices=c("true"=TRUE, "false"=FALSE),
                           selected=TRUE, inline=FALSE) )
      ),
     fluidRow(
       column(6,
              textInput("timept", label=h5("timepoints"), value="Header") )
     ),
     fluidRow(
       column(6,
              numericInput("minper", label=h5("minper"), value=20) )
     ),
      fluidRow(
       column(6,
              numericInput("maxper", label=h5("maxper"), value=28) )
     ),
     fluidRow(
       column(6,
              numericInput("arsper", label=h5("ARSdefaultPer"), value=24) )
     ),
     fluidRow(
       column(3,
              checkboxGroupInput("method", label=h5("cycMethod"),
                                 choices=list( "ARS"= "ARS",
                                               "JTK"="JTK",
                                               "LS"="LS") ) ),
       column(3,
              radioButtons('cmbPva', label=h5('combinePvalue'),
                           choices=c(fisher='fisher', bonferroni='bonferroni'),
                           selected='fisher', inline=FALSE) )
     ),
     br(),
     br(),
     fluidRow(
       column(3,
              actionButton("update", label=h5("Run")) ),
       column(3,
              downloadButton('downloadData', label='Download' ) )
     )
    ),

    mainPanel(
      helpText(h4('Step1: upload') ),
      helpText(h5('Please take a look at the input file selected on the left:') ),
      tableOutput('contents'),
      ##the temporaly output value for checking the value during running shiny app
      #textOutput('teptext'),
      br(),
      helpText(h4('Step2: run') ),
      helpText(h5('If the input file is shown as expected, please set parameters on the left and click Run button.') ),
      br(),
      helpText(h4('Step3: download') ),
      helpText(h5('The first six rows of analysis results will be shown as below (If the input file is large, please wait until you see the output results.):') ),
      tableOutput('tabout'),
      helpText(h5('Now you could download the output results by clicking Download button on the left.') )
    )
  )
))
<file_sep>/server.R
###load 'shiny' package
if (!require(shiny)) {
  install.packages("shiny")
}
##load 'MetaCycle' package
if (!require(MetaCycle)) {
  install.packages("MetaCycle")
  library(MetaCycle)
}  else  {
  library(MetaCycle)
}

### By default, the file size limit is 5MB. It can be changed by
### setting this option. Here we'll raise limit to 100MB.
options(shiny.maxRequestSize = 100*1024^2)

###set a flag for 'Run' button
runflag <- 0
###uploading file
shinyServer(function(input, output) {
  ## show the input datafile
  output$contents <- renderTable({
    ## input$file1 will be NULL initially. After the user selects and uploads a file,
    ## it will be a data frame with 'name', 'size', 'type', and 'datapath' columns.
    ## The 'datapath' column will contain the local filenames where the data can be found.
    inFile <- input$file1
    if (is.null(inFile)) {
      return(NULL)
    }
    inputD <-  read.csv(inFile$datapath)
    if ( ncol(inputD) < 2 ) {
      inputD <- read.delim(inFile$datapath)
    }
    if ( ncol(inputD) >=2  )  {
      return( head(inputD) )
    } else  {
      return(NULL)
    }
  })
  ## show the necessay value during running shiny function
#   output$teptext <- renderText({
#    tepF <- input$outraw
#    return(class(tepF))
#   })
  ## run the meta2d
  datasetInput <- reactive({
    ## Change when the "update" button is pressed
    if ( input$update > runflag) {
      isolate({
        withProgress({
          setProgress(message = "Processing corpus...")
          inFile <- input$file1
          outRawData <- TRUE
          if (input$outraw == "FALSE")
          {
            outRawData <- FALSE
          }
          timepoints <- input$timept
          if ( (timepoints == "Header") | grepl(",", timepoints) )
          {
              if (grepl(",", timepoints)) {
                timepoints <- gsub("\\s+", "", timepoints, perl = TRUE)
                timepoints <- sub("^,", "", timepoints, perl = TRUE)
                timepoints <- sub(",$", "", timepoints, perl = TRUE)
                timepoints <- unlist( strsplit(timepoints, ",", fixed=TRUE) )
                timepoints <- as.numeric(timepoints)
              }  else  {
                timepoints <- "Line1"
              }
              outL <- meta2d(infile = inFile$datapath, filestyle = input$fstyle,
                             timepoints = timepoints, minper = input$minper,
                             maxper = input$maxper, ARSdefaultPer = input$arsper,
                             cycMethod = input$method, combinePvalue = input$cmbPva,
                             outputFile = FALSE, outIntegration = "onlyIntegration",
                             outRawData = outRawData)
              outD <- outL$meta
          }  else  {
            outD <- NULL
          }
          ## this is a patch used to remove the default directory generated by meta2d
          if (file.exists("metaout") ) {
            unlink("metaout", recursive = TRUE)
          }
        })
      })
      runflag <- input$update
      return(outD)
    }  else  {
      return(NULL)
    }
  })
  ## show the result of meta2d
  output$tabout <- renderTable({
    taboutD <- datasetInput()
    head(taboutD)
  })
  ## downloading file
  output$downloadData <- downloadHandler(
    filename = function() {
      if (input$fstyle == "txt") {
        paste("meta2d", '.txt', sep='')
      }  else  {
        paste("meta2d", '.csv', sep='')
      }
    },
    content = function(file) {
      if (input$fstyle == "txt") {
        write.table(datasetInput(), file, quote = FALSE, sep="\t", row.names=FALSE)
      }  else  {
        write.csv(datasetInput(), file, row.names=FALSE)
      }
    }
  )
})

branch_name: refs/heads/master

languages: Markdown R

repo_language: Markdown

repo_name: gangwug/MetaCycleApp


text:
<repo_name>HaiwenZhang/S2RLC<file_sep>/README.md
# S2RLC scripts Readme

## Requrements
Python 3

## Install Python Library requrements

``` bash
pip install -r requirements.txt
```

## How to use s2rlc scripts

``` bash
python3 s2rlc.py -s demo.s22p -r ./results.xlsx
```

"-s" is S parameter Touchstone file path
"-r" RLC result excel file path

After run this scripts, it will create excel files.
For sheet on file, first row is frequency, first column is S parameter port name.
ESR unit is Ohm, ESL unit is nH, ESC unit is pF<file_sep>/s2rlc.py
import skrf as rf
import numpy as np
import math
import pandas as pd
import os
import argparse

def S2RLC(file_path, result_path):

    network = rf.Network(file_path)
    S = network.s
    Y = network.y
    Z = network.z
    Nport = network.nports
    Nf = len(network.f)
    port_names = network.port_names
    network_freq = network.f

    L_eff = np.zeros((Nport, Nf))
    C_eff = np.zeros((Nport, Nf))
    R_eff = np.zeros((Nport, Nf))

    for i in range(Nf):
        freq = network.f[i]
        jw = 2 * math.pi * freq

        # calculate the resistance from Y = 1 / (R + jwL)
        # R = re(1/Y(1, 1)) Ohms
        Yf = np.reshape(Y[i], (Nport, Nport))
        Yf_data = 1 / np.diagonal(Yf)
        R_eff[:,i] = Yf_data.real

        # # calculate the inductance from Y = 1 / (R + jwL)
        # # L = im(1/Y(1, 1)) / (2*pi*F) * 1e9 nH
        L_eff[:,i] = Yf_data.imag / jw * 1e9

        # # calculate the capacitance from Z = 1 / (G + jwC)
        # # C = im(1/Z(1, 1)) / (2*pi*F) * 1e12 pF
        Zf = np.reshape(Z[i], (Nport, Nport))
        Zf_data = 1 / np.diagonal(Zf)
        C_eff[:,i] = Zf_data.imag / jw * 1e12

    R_df = pd.DataFrame(R_eff.T, index=network_freq, columns=port_names)
    L_df = pd.DataFrame(L_eff.T, index=network_freq, columns=port_names)
    C_df = pd.DataFrame(C_eff.T, index=network_freq, columns=port_names)

    # if not os.path.exists(result_directory):
    #     os.mkdir(result_directory)

    writer = pd.ExcelWriter(result_path)

    R_df.to_excel(writer, sheet_name="ESR-Ohm")
    L_df.to_excel(writer, sheet_name="ESL-nH")
    C_df.to_excel(writer, sheet_name="ESC-pF")
    writer.save()
    # R_df.to_csv(os.path.join(result_directory, "esr.csv"))
    # L_df.to_csv(os.path.join(result_directory, "esl.csv"))
    # C_df.to_csv(os.path.join(result_directory, "esc.csv"))

if __name__ == "__main__":

    parser = argparse.ArgumentParser(description="Convert S parameter to RLC")

    parser.add_argument("-s", dest="sparameter", help="touchstone file path")
    parser.add_argument("-r", dest="result", help="result folder path")
    args = parser.parse_args()

    S2RLC(args.sparameter, args.result)

    # S2RLC("demo.s22p", "./results.xlsx")
<file_sep>/requirements.txt
numpy==1.19.5
pandas==1.2.1
scikit-rf==0.16.0
scipy==1.6.0

branch_name: refs/heads/main

languages: Markdown Text Python


text:
<repo_name>finekite/Lab12<file_sep>/src/RoshamboApp.java

import java.util.Scanner;

public class RoshamboApp {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Player opp = null;
		int countWins = 0;
		boolean cont = true;
		// introduction to game, asking which NPC the player
		// wants to compete against. initializing that object.

		System.out.println("Welcome to Rock, Paper, Scissors!");
		while (cont) {
			String choice = CustomValidator.ValidateWhichPlayertoPlay(sc,
					"Who do you want to play against. The Rock, Unneeded Object, or Average Player(R/U/A)");

			if (choice.equalsIgnoreCase("r")) {
				opp = new DumbPlayer();
			} else if (choice.equalsIgnoreCase("u")) {
				opp = new Player3();
			} else if (choice.equalsIgnoreCase("a")) {
				opp = new AveragePlayer();
			}

			System.out.println("You chose to play " + opp.getPlayerName());

			String userThrow = CustomValidator.validateRPS(sc, "Rock paper or scissors?");
			String npcThrow = opp.roshamboGenerator();
			System.out.println("You: " + userThrow);
			System.out.println(opp.getPlayerName() + ": " + npcThrow);

			countWins = opp.getWinner(userThrow, npcThrow, countWins);

			cont = CustomValidator.getYesNo(sc, "Would you like to play again?");

		}
		System.out.println("Thanks for playing. You won " + countWins + " times.");

	}

}
<file_sep>/src/Player3.java

public class Player3 extends Player {

	public Player3() {
		playerName = "Unneeded object";
	}

	@Override
	public String roshamboGenerator() {
		int n = numberGenerator.nextInt(2);

		switch (n) {
		case 0:
			roshamboValue = Roshambo.ROCK.toString();
			break;
		case 1:
			roshamboValue = Roshambo.PAPER.toString();
			break;
		default:
			System.err.println("Something is broken within the AveragePlayer roshgen");
			break;
		}

		return roshamboValue;
	}

}<file_sep>/src/DumbPlayer.java
/**
 *
 */

/**
 * Subclass of the abstract class Player that instantiates objects that always
 * select "rock" during game play.
 *
 * @author logansomner
 *
 */
public class DumbPlayer extends Player {

	/**
	 *
	 */
	public DumbPlayer() {
		playerName = "The Rock";
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see rockPaperScissors.Player#roshamboGenerator()
	 */
	/**
	 *
	 */
	@Override
	public String roshamboGenerator() {
		roshamboValue = Roshambo.ROCK.toString();
		;
		return roshamboValue;
	}

}
<file_sep>/src/CustomValidator.java

/**
 *@author logansomner

 *
 */

import java.util.Scanner;

public class CustomValidator {

	/**
	 * Validates string objects and handles any blank strings
	 *
	 * @param sc
	 * @param prompt
	 * @return String
	 */
	public static String getString(Scanner sc, String prompt) {
		System.out.print(prompt);
		String s = sc.next(); // read user entry
		sc.nextLine(); // discard any other data entered on the line
		return s;
	}

	/**
	 * Takes string data, analyzes it for starting with a "y" or "n" while
	 * ignoring case. Prompts for correct format (a string starting with "y" or
	 * "n") if not given. Returns "true" for "y" and "false" for "n".
	 *
	 * @param sc
	 * @param prompt
	 * @return boolean
	 */
	public static boolean getYesNo(Scanner sc, String prompt) {

		System.out.println(prompt);

		String S = sc.nextLine();
		boolean b = false;
		while (!S.trim().substring(0, 1).toLowerCase().equalsIgnoreCase("y")
				&& !S.trim().substring(0, 1).toLowerCase().equalsIgnoreCase("n")) {
			System.out.println("Incorrect format. Yes or No?");
			S = sc.nextLine();
		}
		if (S.trim().substring(0, 1).equalsIgnoreCase("y")) {
			b = true;
		} else {
			b = false;
		}
		return b;
	}

	/**
	 * Takes string data, analyzes it for starting with a "r" or "l" while
	 * ignoring case. Prompts for correct format (a string starting with "r" or
	 * "l") if not given. Returns "true" for "r" and "false" for "l".
	 *
	 * @param sc
	 * @param prompt
	 * @return boolean
	 */
	public static boolean getRightLeft(Scanner sc, String prompt) {
		System.out.println(prompt);
		String S = sc.nextLine();
		boolean b = false;

		while (!S.trim().substring(0, 1).toLowerCase().equalsIgnoreCase("l")
				&& !S.trim().substring(0, 1).toLowerCase().equalsIgnoreCase("r")) {
			System.out.println("Incorrect format. Right or Left?");
			S = sc.nextLine();
		}
		if (S.trim().substring(0, 1).equalsIgnoreCase("r")) {
			b = true;
		} else {
			b = false;
		}
		return b;
	}

	/**
	 * Test for valid integer. Prompts for correct format if not given.
	 *
	 * @param sc
	 * @param prompt
	 * @return integer
	 */
	public static int getInt(Scanner sc, String prompt) {
		int i = 0;
		boolean isValid = false;
		while (isValid == false) {
			System.out.print(prompt);
			if (sc.hasNextInt()) {
				i = sc.nextInt();
				isValid = true;
			} else {
				System.out.println("Invalid integer value. Try again.");
			}
			sc.nextLine(); // discard any other data entered on the line
		}
		return i;
	}

	/**
	 * Test for valid integer between assigned parameters. Prompts for correct
	 * format if not given.
	 *
	 * @param sc
	 * @param prompt
	 * @param min
	 * @param max
	 * @return integer
	 */
	public static int getInt(Scanner sc, String prompt, int min, int max) {
		int i = 0;
		boolean isValid = false;
		while (isValid == false) {
			i = getInt(sc, prompt);
			if (i <= min)
				System.out.println("Error! Number must be greater than " + min + ".");
			else if (i >= max)
				System.out.println("Error! Number must be less than " + max + ".");
			else
				isValid = true;
		}
		return i;
	}

	/**
	 * Test for valid double. Prompts for correct format if not given.
	 *
	 * @param sc
	 * @param prompt
	 * @return double
	 */
	public static double getDouble(Scanner sc, String prompt) {
		double d = 0;
		boolean isValid = false;
		while (isValid == false) {
			System.out.print(prompt);
			if (sc.hasNextDouble()) {
				d = sc.nextDouble();
				isValid = true;
			} else {
				System.out.println("Error! Invalid decimal value. Try again.");
			}
			sc.nextLine(); // discard any other data entered on the line
		}
		return d;
	}

	/**
	 * Test for valid double between assigned parameters. Prompts for correct
	 * format if not given.
	 *
	 * @param sc
	 * @param prompt
	 * @param min
	 * @param max
	 * @return double
	 */
	public static double getDouble(Scanner sc, String prompt, double min, double max) {
		double d = 0;
		boolean isValid = false;
		while (isValid == false) {
			d = getDouble(sc, prompt);
			if (d <= min)
				System.out.println("Error! Number must be greater than " + min + ".");
			else if (d >= max)
				System.out.println("Error! Number must be less than " + max + ".");
			else
				isValid = true;
		}
		return d;
	}

	/**
	 * Test for valid long. Prompts for correct format if not given.
	 *
	 * @param sc
	 * @param prompt
	 * @return long
	 */
	public static long getLong(Scanner sc, String prompt) {
		long l = 0;
		boolean isValid = false;
		while (isValid == false) {
			System.out.print(prompt);
			if (sc.hasNextLong()) {
				l = sc.nextLong();
				isValid = true;
			} else {
				System.out.println("Error! Invalid long value. Try again.");
			}
			sc.nextLine(); // discard any other data entered on the line
		}
		return l;
	}

	/**
	 * Test for valid long between assigned parameters. Prompts for correct
	 * format if not given.
	 *
	 * @param sc
	 * @param prompt
	 * @param min
	 * @param max
	 * @return long
	 */
	public static long getLong(Scanner sc, String prompt, double min, double max) {
		long l = 0;
		boolean isValid = false;
		while (isValid == false) {
			l = getLong(sc, prompt);
			if (l <= min)
				System.out.println("Error! Number must be greater than " + min + ".");
			else if (l >= max)
				System.out.println("Error! Number must be less than " + max + ".");
			else
				isValid = true;
		}
		return l;
	}

	public static String validateRPS(Scanner sc, String prompt) {
		System.out.println(prompt);
		String s = sc.nextLine();
		s = s.trim().toLowerCase().substring(0, 1);
		while (!(s.equalsIgnoreCase("r")) && !(s.equalsIgnoreCase("p")) && !(s.equalsIgnoreCase("s"))) {
			System.err.println("Invalid input. Please enter Rock Paper or Scissors");
			s = sc.nextLine();
			s = s.trim().toLowerCase().substring(0, 1);
		}

		switch (s) {
		case "r":
			s = Roshambo.ROCK.toString();

			break;
		case "p":
			s = Roshambo.PAPER.toString();

			break;
		case "s":
			s = Roshambo.SCISSORS.toString();
			break;
		}
		return s;

	}

	public static String ValidateWhichPlayertoPlay(Scanner sc, String prompt) {

		System.out.println(prompt);

		String p = sc.nextLine();
		p = p.trim().toLowerCase().substring(0, 1);
		while ((!(p.equalsIgnoreCase("r")) && !(p.equalsIgnoreCase("u")) && !(p.equalsIgnoreCase("a")))) {
			System.out.println("Invalid Player. Please enter R/U/A");
			p = sc.nextLine();
			p = p.trim().toLowerCase().substring(0, 1);
		}
		return p;

	}

}
<file_sep>/src/Player.java

import java.util.Random;

abstract class Player {

	protected String playerName;

	public String getPlayerName() {
		return playerName;
	}

	public int getWinner(String userThrow, String npcThrow, int countWins) {
		int c = countWins;

		if (userThrow.equalsIgnoreCase("rock")) {
			switch (npcThrow) {
			case "rock":
				System.out.println("You tied!");
				break;
			case "paper":
				System.out.println("You lost!");
				break;
			case "scissors":
				System.out.println("You win!");
				c++;
				break;
			}
		} else if (userThrow.equalsIgnoreCase("paper")) {
			switch (npcThrow) {
			case "rock":
				System.out.println("You win!");
				c++;
				break;
			case "paper":
				System.out.println("You tied!");
				break;
			case "scissors":
				System.out.println("You lose!");
				break;
			}

		} else {
			switch (npcThrow) {
			case "rock":
				System.out.println("You lose!");

				break;
			case "paper":
				System.out.println("You win!");
				c++;
				break;
			case "scissors":
				System.out.println("You tied!");
				break;
			}

		}
		return c;
	}

	protected String roshamboValue;
	Random numberGenerator = new Random();

	abstract String roshamboGenerator();

}

repo_language: Java


text:
<file_sep>package com.neri.jwt.nerijwt.security;

import com.neri.jwt.nerijwt.model.User;
import com.neri.jwt.nerijwt.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;

import java.util.Collection;
import java.util.List;

public class UserDetailsImpl implements UserDetails {

    User user;
    private List<GrantedAuthority> roles;

    public UserDetailsImpl(User user) {
        this.user = user;
        this.roles = roles;
    }

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return roles;
    }

    @Override
    public String getPassword() {
        return <PASSWORD>();
    }

    @Override
    public String getUsername() {
        return user.getEmail();
    }

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

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

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

    @Override
    public boolean isEnabled() {
        return true;
    }
}<file_sep>server.servlet.context-path=/jwt/example

spring.data.mongodb.uri=mongodb://localhost:17017/db

spring.devtools.add-properties=true

jwt.secret=example-jwt

jwt.expiration=604800

languages: Java INI

repo_name: rodrigogregorioneri/example-jwt


text:
<repo_name>AlderFrond/Task7<file_sep>/WindowsFormsApplication2/Triangle.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;

namespace WindowsFormsApplication2
{
    class Triangle : Figure
    {
        public override void Draw(Graphics gr) //override для индивидуального редактирования
        {
            Pen pen = new Pen(Color, 5);

            gr.DrawLine(pen, X, Y, X + Width, Y);
            gr.DrawLine(pen, X + Width, Y, X + Width, Y + Height);
            gr.DrawLine(pen, X + Width, Y + Height, X, Y);
        }
        //Сделать проверку, что точка внутри эллипса
        public override bool IsInside(float x, float y)
        {
            if (true)
            {
                //return true;
            }
            return false;
        }
    }
}
<file_sep>/WindowsFormsApplication2/Rect.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;

namespace WindowsFormsApplication2
{
    class Rect : Figure
    {
        public override void Draw(Graphics gr) //override для индивидуального редактирования
        {
            Pen pen = new Pen(Color, 5);
            Brush b = new TextureBrush(Image.FromFile(@"C:\Users\Nomat_An\Desktop\2tpCLYhOyvM.jpg"));
            gr.FillRectangle(b, X, Y, Width, Height);
            gr.DrawRectangle(pen, X, Y, Width, Height);
        }

        public override bool IsInside(float x, float y)
        {
            if ((X <= x) && (x <= X + Width) &&
                (Y <= y) && (y <= Y + Height))
            {
                return true;
            }
            return false;
        }
    }
}
<file_sep>/WindowsFormsApplication2/Form1.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication2
{
    public partial class Form1 : Form
    {
        //список (массив без гемороя)
        private List<Figure> list;
        private Random r = new Random(DateTime.Now.TimeOfDay.Milliseconds);

        public Form1()
        {
            InitializeComponent();
            list = new List<Figure>();

            //Для отрисовки вне формы. Картинка будет рисоваться в памяти а потом передаваться в форму.
            DoubleBuffered = true;
        }
        private void Form1_Paint(object sender, PaintEventArgs e)
        {
            for (int i = 0; i < list.Count; i++)
            {
                list[i].Draw(e.Graphics);
            }
        }
        private void button2_Click(object sender, EventArgs e)
        {
            Figure rectangle = new Rect();
            rectangle.Height = r.Next(10,150);
            rectangle.Width = r.Next(10, 150);
            rectangle.X = r.Next(0, (int)((Height - rectangle.Width)));
            rectangle.Y = r.Next(0, (int)(Height - rectangle.Height));
            rectangle.Color = Color.Red;
            list.Add(rectangle);

            Refresh();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            Figure ellipse = new Ellipse();
            ellipse.Height = r.Next(10, 150);
            ellipse.Width = r.Next(10, 150);
            ellipse.X = r.Next(0, (int)(Height - ellipse.Width));
            ellipse.Y = r.Next(0, (int)(Height - ellipse.Height));
            ellipse.Color = Color.Red;
            list.Add(ellipse);

            Refresh();
        }
        private void button1_Click_1(object sender, EventArgs e)
        {
            Figure triangle = new Triangle();
            triangle.Height = r.Next(10, 150);
            triangle.Width = r.Next(10, 150);
            triangle.X = r.Next(0, (int)(Height - triangle.Width));
            triangle.Y = r.Next(0, (int)(Height - triangle.Height));
            triangle.Color = Color.Red;
            list.Add(triangle);

            Refresh();
        }
        private void ColoringFigures(int x, int y)
        {
            Figure f = GetCurrentFigure(x, y);
            foreach (var figure in list)
            {
                figure.Color = Color.Red;
            }

            if (f != null)
            {
                f.Color = Color.Purple;
            }
        }
        private Figure GetCurrentFigure(int x, int y)
        {
            for (int i = 0; i < list.Count; i++)
            {
                if (list[i].IsInside(x, y))
                {
                    return list[i];
                }
            }
            return null;
        }

        private Figure currentFigure;
        private Point currentPoint;

        private void Form1_MouseMove(object sender, MouseEventArgs e)
        {
            if (currentFigure != null)
            {
                currentFigure.X += e.Location.X - currentPoint.X;
                currentFigure.Y += e.Location.Y - currentPoint.Y;
                currentPoint = e.Location;
            }
            else
            {
                ColoringFigures(e.X, e.Y);
            }
            Refresh();
        }
        private void Form1_MouseDown_1(object sender, MouseEventArgs e)
        {
            currentFigure = GetCurrentFigure(e.X, e.Y);
            currentPoint = e.Location;
        }
        private void Form1_MouseUp_1(object sender, MouseEventArgs e)
        {
            currentFigure = null;
        }
    }
}
<file_sep>/WindowsFormsApplication2/Figure.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;

namespace WindowsFormsApplication2
{
    //abstract нельзя наследоваться
    abstract class Figure
    {
        //public - виден везде
        //protected - виден внутри класса и в наследниках
        //private - только внутри класса

        public float X { get; set; } //установка и изменение
        public float Y { get; set; }
        public float Width { get; set; }
        public float Height { get; set; }
        public Color Color { get; set; }

        public abstract void Draw(Graphics gr);
        public abstract bool IsInside(float x, float y);

    }
}
<file_sep>/WindowsFormsApplication2/Ellipse.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
using System.Drawing.Drawing2D;

namespace WindowsFormsApplication2
{
    class Ellipse : Figure
    {
        public override void Draw(Graphics gr) //override для индивидуального редактирования
        {
            Pen pen = new Pen(Color, 5);
            Brush b = new HatchBrush(HatchStyle.Percent50, Color.FromArgb(50, Color.DodgerBlue), Color.FromArgb(50, Color.Blue));
            gr.FillEllipse(b, X, Y, Width, Height);
            gr.DrawEllipse(pen, X, Y, Width, Height);
        }
        //Сделать проверку, что точка внутри эллипса
        public override bool IsInside(float x, float y)
        {

            if ((((x - (X + Width / 2)) * (x - (X + Width / 2))) / ((Width / 2) * (Width / 2)) + ((y - (Y + Height / 2)) * (y - (Y + Height / 2))) / ((Height / 2) * (Height / 2))) <= 1)

            {
                return true;
            }
            return false;
        }
    }
}

repo_language: C#


text:
<file_sep># docker-rabbitmq

NOTE: If you are looking for the wotio/rabbitmq container, it's on the legacy branch. But please don't.

In start.d, there is a start script to initialize a container running the official rabbitmq image.
This repo is not really the right place for the start script, will probably move at some point.

See the Makefile for variables to set for make run.

TODO: Add checks and backups
<file_sep>#!/bin/bash

set -u
set -e
set -x

if [[ -e /var/lib/rabbitmq/BOOTSTRAPPED ]]; then
	echo "RabbitMQ already configured. Starting..."
	exec /usr/lib/rabbitmq/bin/rabbitmq-server
fi

CLUSTER=${CLUSTER:-''}
MESSAGE_TTL=${MESSAGE_TTL:-''} # milliseconds
RABBITMQ_PID_FILE=${RABBITMQ_PID_FILE:-'/var/lib/rabbitmq/pid'}

set_message_policy() {
	local vhost=${1:?'Usage: set_message_policy <vhost>'}

	# Set a message TTL on queues and exchanges if requested.
	if [ "${MESSAGE_TTL}" != "" ]; then
		rabbitmqctl set_policy -p ${vhost} --apply-to all msg-ttl-${MESSAGE_TTL} '.*' '{"message-ttl":'''${MESSAGE_TTL}'''}'
	fi
}

# rabbitmq need to be running to use rabbitmqctl to configure it.
# start rabbitmq and wait until it is up before trying to talk to it.
# we will stop rabbitmq after configured, then exec it to make it process 1

/usr/lib/rabbitmq/bin/rabbitmq-server & rabbitmqctl wait ${RABBITMQ_PID_FILE}

/usr/sbin/rabbitmq-plugins enable rabbitmq_mqtt rabbitmq_stomp rabbitmq_management  rabbitmq_management_agent rabbitmq_management_visualiser rabbitmq_federation rabbitmq_federation_management sockjs rabbitmq_auth_backend_ldap

if [[ -z "$CLUSTER" ]]; then
	echo "Loading passwords"
	#[ -f /.passwords ] && source /.passwords

	if [ -z "${PRODPASSWORD}" ] || [ -z "${WOTPASSWORD}" ] || [ -z "${ADMINPASSWORD}" ]; then
		echo "Local RabbitMQ passwords cannot be set."
		exit 1
	fi

	echo "Configuring master"
	rabbitmqctl add_vhost management
	rabbitmqctl add_user prod $PRODPASSWORD
	rabbitmqctl add_user wot $WOTPASSWORD
	rabbitmqctl add_user admin $ADMINPASSWORD
	rabbitmqctl set_user_tags prod wot-observer
	rabbitmqctl set_user_tags wot management WOT wot-observer
	rabbitmqctl set_user_tags admin administrator WOT wot-administrator
	rabbitmqctl set_permissions admin '.*' '.*' '.*'
	rabbitmqctl set_permissions -p management admin '.*' '.*' '.*'
	rabbitmqctl set_permissions -p management wot '.*' '.*' '.*'

	set_message_policy /
	set_message_policy management

	for VHOST in ${VHOSTS}; do
		rabbitmqctl add_vhost ${VHOST}
		rabbitmqctl set_permissions -p ${VHOST} admin '.*' '.*' '.*'
		rabbitmqctl set_permissions -p ${VHOST} prod '.*' '.*' '.*'
		rabbitmqctl set_permissions -p ${VHOST} wot '.*' '.*' '.*'

		set_message_policy ${VHOST}
	done

else
	echo "Joining cluster at $CLUSTER"
	rabbitmqctl stop_app
	rabbitmqctl reset
	rabbitmqctl join_cluster $CLUSTER
	rabbitmqctl start_app
fi
touch /var/lib/rabbitmq/BOOTSTRAPPED

# stop rabbitmq and wait until it is down before we exec it to make it process 1.
rabbitmqctl stop ${RABBITMQ_PID_FILE}

echo "Starting RabbitMQ..."
exec /usr/lib/rabbitmq/bin/rabbitmq-server
<file_sep>CONTAINER ?= rabbitmq
NAME = $(CONTAINER)
COMMAND ?= /docker-entrypoint.d/start
HOST_NAME ?= rabbitmq00
IMAGE ?= rabbitmq:3.6.2-management
CLUSTER ?=
RABBITMQ_ERLANG_COOKIE ?= 4c16c9ac743c4d6396dbf539e79973a8
RABBITMQ_PID_FILE ?= /var/lib/rabbitmq/pid
MESSAGE_TTL ?= 120000
PRODPASSWORD ?= <PASSWORD>
WOTPASSWORD ?= <PASSWORD>
ADMINPASSWORD ?= <PASSWORD>
VHOSTS ?= dev00

DNS_SERVER ?= 8.8.8.8

PORTS = -p 4369:4369 -p 5671:5671 -p 5672:5672 -p 25672:25672 -p 15671:15671 -p 15672:15672

VOLUMES = -v `pwd`/data:/var/lib/rabbitmq -v `pwd`/start.d:/docker-entrypoint.d -v `pwd`/checks.d:/checks.d

ENVS = \
	--hostname $(HOST_NAME) \
	-e RABBITMQ_ERLANG_COOKIE=$(RABBITMQ_ERLANG_COOKIE) \
	-e RABBITMQ_PID_FILE=$(RABBITMQ_PID_FILE) \
	-e MESSAGE_TTL=$(MESSAGE_TTL) \
	-e PRODPASSWORD=$(PRO<PASSWORD>) \
	-e WOTPASSWORD=$(W<PASSWORD>) \
	-e ADMINPASSWORD=$(ADMINPASSWORD) \
	-e VHOSTS=$(VHOSTS) \
	-e CLUSTER=$(CLUSTER)

run:
	docker run --dns $(DNS_SERVER) --hostname $(HOST_NAME) --name $(NAME) -i -d $(PORTS) $(ENVS) $(VOLUMES) -t $(IMAGE) $(COMMAND)

clean:
	sudo rm -rf ./data
	docker rm $(NAME)

kill:
	docker kill $(NAME)

languages: Makefile Markdown Shell

repo_language: Makefile

repo_name: WoTio/docker-rabbitmq


text:
<repo_name>dockerpedia/annotator<file_sep>/internal/config/config.go
package config

import (
	"fmt"
	"github.com/fsnotify/fsnotify"
	"log"
	"os"

	"github.com/spf13/viper"
)

type ServerConfig struct {
	Listen string
	Port string
}

type EndpointConfig struct {
	Address string `mapstructure:"address"`
}

type ClairConfig struct {
	Address string `mapstructure:"address"`
	Port   string
}

type Config struct {
	Endpoint  	EndpointConfig `mapstructure:"endpoint"`
	Server 		ServerConfig   `mapstructure:"server"`
	Clair       ClairConfig    `mapstructure:"clair"`
}

// NewConfig is used to generate a configuration instance which will be passed around the codebase
func New() (*Config, error) {
	config, err := initViper()
	return config, err
}

func initViper()  (*Config, error){
	v := viper.New()
	v.SetConfigName("config")
	v.AddConfigPath(".")
	err := v.ReadInConfig()
	if err != nil {
		fmt.Printf("couldn't load config: %s", err)
		os.Exit(1)
	}
	v.WatchConfig() // Watch for changes to the configuration file and recompile
	v.OnConfigChange(func(e fsnotify.Event) {
		fmt.Println("Config file changed:", e.Name)
	})

	if err = v.ReadInConfig(); err != nil {
		log.Panicf("Error reading config file, %s", err)
	}

	var c Config
	if err := v.Unmarshal(&c); err != nil {
		fmt.Printf("couldn't read config: %s", err)
	}
	return &c, err
}<file_sep>/config.toml
[server]
listen = ":8081"

[endpoint]
address = "https://dockerpedia.inf.utfsm.cl/v3/data"

[clair]
address = "http://clair.mosorio.me"
port    = "80"
<file_sep>/klar/main.go
package klar

import (
	"fmt"
	"os"
	"time"

	"github.com/dockerpedia/annotator/clair"
	"github.com/dockerpedia/annotator/docker"
	"log"
)

var store = make(map[string][]*clair.Vulnerability)

func DockerAnalyze(imageName, clairHost, clairPort string) ([]*clair.Feature, *docker.Image,  error) {
	clairAddr := fmt.Sprintf("%s:%s", clairHost, clairPort)
	//todo: Timeout must be a configuration parameter
	clairTimeout := time.Duration(1) * time.Minute

	conf, err := newConfig(imageName, clairAddr)
	image, err := docker.NewImage(&conf.DockerConfig)
	if err != nil {
		log.Printf("Can't parse qname: %s", err)
	}

	err = image.Pull()
	if err != nil {
		log.Printf("Can't pull image: %s", err)
	}

	var fs []*clair.Feature
	//obtain the packages using Annotate
	for _, ver := range []int{1, 3} {
		c := clair.NewClair(clairAddr, ver, clairTimeout)
		fs, err = c.Annotate(image)

		if err != nil {
			fmt.Fprintf(os.Stderr, "Failed to analyze using API v%d: %s\n", ver, err)
		} else {
			if !conf.JSONOutput {
				fmt.Printf("Got results from Clair API v%d\n", ver)
			}
			break
		}
	}
	if err != nil {
		log.Printf("Failed to analyze, exiting")
	}

	fmt.Printf("Number of the features %d\n", len(fs))

	return fs, image, nil
}
<file_sep>/dockerpedia/rdf.go
package dockerpedia

import (
	"bytes"
	"fmt"
	"github.com/dockerpedia/annotator/clair"
	"github.com/dockerpedia/annotator/docker"
	tstore "github.com/wallix/triplestore"
	"io/ioutil"
	"log"
	"net/http"
	"strings"
)

/*
type responseFuseki struct {
	count int 		 `json:"count,omitempty"`
	tripleCount int	 `json:"tripleCount,omitempty"`
	quadCount int	 `json:"quadCount,omitempty"`
}
*/
var	siteHost string
var base string

func convertImageName(image SoftwareImage) string {
	imageName := strings.Replace(image.Name, "/", "-", -1)
	return fmt.Sprintf("%s_%s", imageName, image.Version)
}

func sendToFuseki(buffer bytes.Buffer) {
	client := &http.Client{}
	req, err := http.NewRequest("POST", siteHost, &buffer)
	req.Header.Set("Content-Type", "text/plain")

	if err != nil {
		log.Println(err)
	}
	resp, err := client.Do(req)
	if err != nil {
		log.Println(err)
	}

	if resp.StatusCode >= 299 {
		log.Printf("insert failed: \n %s \n", buffer.String())
	}
	_, err = ioutil.ReadAll(resp.Body)
	if err != nil {
		log.Println(err)
	}
	resp.Body.Close()
	if err != nil {
		log.Fatal(err)
	}
}

func buildContext(prefixes []string, base string) (*tstore.Context, error) {
	context := tstore.RDFContext
	for _, prefix := range prefixes {
		splits := strings.SplitN(prefix, ":", 2)
		if splits[0] == "" || splits[1] == "" {
			return context, fmt.Errorf("invalid prefix format: '%s'. expected \"prefix:http://my.uri\"", prefix)
		}
		context.Prefixes[splits[0]] = base + splits[1]
	}
	context.Base = base
	return context, nil
}

func getNamespaceURI(namespaceString string) (string) {
	namespaceSplit := strings.Split(namespaceString, ":")
	var namespace Namespace
	if len(namespaceSplit) == 2 {
		namespace = Namespace{OperatingSystem: namespaceSplit[0], Version: namespaceSplit[1]}
	} else {
		namespace = Namespace{OperatingSystem: "unknown", Version: "unknown"}
	}
	namespaceURI := fmt.Sprintf("OperatingSystem:%s-%s", namespace.OperatingSystem, namespace.Version)
	return namespaceURI
}

//todo: related layer with operating system
func tripleLayers(layers []docker.FsLayer, imageName string, triples *[]tstore.Triple) {
	for _, layer := range layers {
		layerURI := fmt.Sprintf("ImageLayer:%s", layer.BlobSum)
		imageURI := fmt.Sprintf("SoftwareImage:%s", imageName)

		*triples = append(*triples,
			tstore.SubjPred(layerURI, "rdf:type").Resource("vocab:ImageLayer"),
			tstore.SubjPred(layerURI, "vocab:isLayerOf").Resource(imageURI),
			tstore.SubjPred(imageURI, "vocab:composedBy").Resource(layerURI),
		)
	}
}

func triplesNameSpace(namespaceString string, triples *[]tstore.Triple) {
	namespaceURI := getNamespaceURI(namespaceString)
	triple := tstore.SubjPred(namespaceURI, "rdf:type").Resource("vocab:OperatingSystem")
	*triples = append(*triples, triple)
}

func checkAddTriple(source, predicate, object string, triples *[]tstore.Triple) {
	if object != "" {
		*triples = append(*triples,
			tstore.SubjPred(source, predicate).Resource(object),
		)
	}
}
func triplesSoftwareImage(softwareImage SoftwareImage, triples *[]tstore.Triple, context *tstore.Context) {
	var buffer bytes.Buffer
	identifier := convertImageName(softwareImage)
	softwareImageURI := fmt.Sprintf("SoftwareImage:%s", identifier)
	*triples = append(*triples,
		tstore.SubjPred(softwareImageURI, "rdf:type").Resource("vocab:SoftwareImage"),
		tstore.SubjPred(softwareImageURI, "vocab:imageIdentifier").StringLiteral(identifier),
		tstore.SubjPred(softwareImageURI, "vocab:tag").StringLiteral(softwareImage.Version),
		tstore.SubjPred(softwareImageURI, "vocab:size").IntegerLiteral(int(softwareImage.Size)),
	)

	//checkAddTriple(softwareImageURI,"vocab:description", softwareImage.Labels.Description, triples)
	//checkAddTriple(softwareImageURI,"vocab:name", softwareImage.Labels.Name, triples)
	//checkAddTriple(softwareImageURI,"vocab:usage", softwareImage.Labels.Usage, triples)
	//checkAddTriple(softwareImageURI,"vocab:url", softwareImage.Labels.Url, triples)
	//checkAddTriple(softwareImageURI,"vocab:vcsUrl", softwareImage.Labels.VcsUrl, triples)
	//checkAddTriple(softwareImageURI,"vocab:vcsRef", softwareImage.Labels.VcsRef, triples)
	//checkAddTriple(softwareImageURI,"vocab:vendor", softwareImage.Labels.Vendor, triples)
	//checkAddTriple(softwareImageURI,"vocab:schema-version", softwareImage.Labels.SchemaVersion, triples)
	//checkAddTriple(softwareImageURI,"vocab:dockerCmd", softwareImage.Labels.DockerCmd, triples)
	//checkAddTriple(softwareImageURI,"vocab:dockerCmdDevel", softwareImage.Labels.DockerCmdDevel, triples)
	//checkAddTriple(softwareImageURI,"vocab:dockerCmdTest", softwareImage.Labels.DockerCmdTest, triples)
	//checkAddTriple(softwareImageURI,"vocab:dockerCmdDebug", softwareImage.Labels.DockerCmdDebug, triples)
	//checkAddTriple(softwareImageURI,"vocab:dockerCmdHelp", softwareImage.Labels.DockerCmdHelp, triples)
	//checkAddTriple(softwareImageURI,"vocab:dockerCmdParams", softwareImage.Labels.DockerCmdParams, triples)
	//checkAddTriple(softwareImageURI,"vocab:rktCmd", softwareImage.Labels.RktCmd, triples)
	//checkAddTriple(softwareImageURI,"vocab:rktCmdDevel", softwareImage.Labels.RktCmdDevel, triples)
	//checkAddTriple(softwareImageURI,"vocab:rktCmdTest", softwareImage.Labels.RktCmdTest, triples)
	//checkAddTriple(softwareImageURI,"vocab:rktCmdDebug", softwareImage.Labels.RktCmdDebug, triples)
	//checkAddTriple(softwareImageURI,"vocab:rktCmdHelp", softwareImage.Labels.RktCmdHelp, triples)
	//checkAddTriple(softwareImageURI,"vocab:rktCmdParams", softwareImage.Labels.RktCmdParams, triples)

	imageStruct := tstore.TriplesFromStruct(softwareImageURI, &softwareImage)
	enc := tstore.NewLenientNTEncoderWithContext(&buffer, context)
	enc.Encode(imageStruct...)
	sendToFuseki(buffer)
}

func triplesFeatureVersion(imageName string, feature clair.Feature, triples *[]tstore.Triple) {
	//rdf:type
	featureVersionLabel := fmt.Sprintf("%s_%s", feature.Name, feature.Version)
	featureVersionURI := fmt.Sprintf("PackageVersion:%s-%s", feature.Name, feature.Version)
	*triples = append(*triples,
		tstore.SubjPred(featureVersionURI, "rdfs:label").StringLiteral(featureVersionLabel),
		tstore.SubjPred(featureVersionURI, "rdf:type").Resource("vocab:PackageVersion"),
	)
	//relation with ImageLayer
	layerURI := fmt.Sprintf("ImageLayer:%s", feature.AddedBy)
	*triples = append(*triples,
		tstore.SubjPred(featureVersionURI, "vocab:modifyLayer").Resource(layerURI),
		tstore.SubjPred(layerURI, "vocab:ismodifiedBy").Resource(featureVersionURI),
	)

	//relation with SoftwarePackage
	featureURI := fmt.Sprintf("SoftwarePackage:%s", feature.Name)
	*triples = append(*triples,
		tstore.SubjPred(featureVersionURI, "vocab:isVersionOf").Resource(featureURI),
		tstore.SubjPred(featureURI, "vocab:hasVersion").Resource(featureVersionURI),
	)
	//relation with SoftwareImage
	softwareImageURI := fmt.Sprintf("SoftwareImage:%s", imageName)
	*triples = append(*triples,
		tstore.SubjPred(softwareImageURI, "vocab:containsSoftware").Resource(featureVersionURI),
		tstore.SubjPred(featureVersionURI, "vocab:isInstalledOn").Resource(softwareImageURI),
	)

}

func triplesSoftwarePackage(imageName string, feature clair.Feature, triples *[]tstore.Triple) {
	featureURI := fmt.Sprintf("SoftwarePackage:%s", feature.Name)
	deploymentPlanURI := fmt.Sprintf("DeploymentPlan:%s", imageName)

	//rdf:type
	namespaceURI := getNamespaceURI(feature.NamespaceName)
	*triples = append(*triples,
		tstore.SubjPred(featureURI, "rdf:type").Resource("vocab:SoftwarePackage"),
	)

	//relation with DeploymentPlan
	*triples = append(*triples,
		tstore.SubjPred(featureURI, "wicus-stack:isDeploymentPlan").Resource(deploymentPlanURI),
	)

	//relation with OperatingSystem
	*triples = append(*triples,
		tstore.SubjPred(featureURI, "vocab:isPackageOf").Resource(namespaceURI),
		tstore.SubjPred(namespaceURI, "vocab:hasPackages").Resource(featureURI),
	)
}

func encodeSoftwarePackage(feature clair.Feature, context *tstore.Context) {
	var buffer bytes.Buffer
	featureURI := fmt.Sprintf("SoftwarePackage:%s", feature.Name)
	featureStruct := tstore.TriplesFromStruct(featureURI, feature)
	enc := tstore.NewLenientNTEncoderWithContext(&buffer, context)
	enc.Encode(featureStruct...)
	sendToFuseki(buffer)
}

func encodeVulnerability(vulnerability clair.Vulnerability, context *tstore.Context) {
	var buffer bytes.Buffer
	vulnerabilityURI := fmt.Sprintf("SoftwareVulnerability:%s", vulnerability.Name)
	vulnerabilityStruct := tstore.TriplesFromStruct(vulnerabilityURI, vulnerability)
	enc := tstore.NewLenientNTEncoderWithContext(&buffer, context)
	enc.Encode(vulnerabilityStruct...)
	sendToFuseki(buffer)
}

/*
This method encodes:
SoftwareVulnerability rdf:type
TODO: SecurityRevision
 */
func triplesVulnerabilities(vulnerability clair.Vulnerability, feature clair.Feature, triples *[]tstore.Triple) {
	packageVersionURI := fmt.Sprintf("PackageVersion:%s-%s", feature.Name, feature.Version)
	vulnerabilityURI := fmt.Sprintf("SoftwareVulnerability:%s", vulnerability.Name)
	operatingSystemURI := fmt.Sprintf("OperatingSystem:%s", feature.NamespaceName)
	securityRevisionURI := fmt.Sprintf("SecurityRevision:%s", vulnerability.FixedBy)

	//SoftwareVulnerability - PackageVersion
	*triples = append(*triples,
		tstore.SubjPred(vulnerabilityURI, "rdf:type").Resource("vocab:SoftwareVulnerability"),
		tstore.SubjPred(vulnerabilityURI, "vocab:affectsPackageVersion").Resource(packageVersionURI),
		tstore.SubjPred(packageVersionURI, "vocab:hasVulnerability").Resource(vulnerabilityURI),
	)

	//SoftwareVulnerability - OperatingSystem
	*triples = append(*triples,
		tstore.SubjPred(vulnerabilityURI, "vocab:affectOS").Resource(operatingSystemURI),
		tstore.SubjPred(operatingSystemURI, "vocab:isAffectedBy").Resource(vulnerabilityURI),
	)

	if vulnerability.FixedBy != "" {
		//SecurityRevision - Vulnerability
		*triples = append(*triples,
			tstore.SubjPred(securityRevisionURI, "rdf:type").Resource("vocab:SecurityRevision"),
			tstore.SubjPred(securityRevisionURI, "vocab:fixVulnerability").Resource(vulnerabilityURI),
			tstore.SubjPred(vulnerabilityURI, "vocab:isFixedBy").Resource(securityRevisionURI),
		)
		//SecurityRevision - PackageVersion
		*triples = append(*triples,
			tstore.SubjPred(securityRevisionURI, "vocab:fixPackage").Resource(packageVersionURI),
			tstore.SubjPred(packageVersionURI, "vocab:hasRevision").Resource(securityRevisionURI),
		)
	}
}

func preBuildContext() (*tstore.Context, error) {
	prefixes := []string{
		"vocab:vocab#",
		"resource:resource/",
		"SoftwareImage:resource/SoftwareImage/",
		"SoftwarePackage:resource/SoftwarePackage/",
		"PackageVersion:resource/PackageVersion/",
		"OperatingSystem:resource/OperatingSystem/",
		"ImageLayer:resource/ImageLayer/",
		"SoftwareVulnerability:resource/SoftwareVulnerability/",
		"SoftwareRevision:resource/SoftwareRevision",
		"DeploymentPlan:resource/DeploymentPlan",
		"wicus-stack:http://purl.org/net/wicus-stack#",

	}
	context, err := buildContext(prefixes, base)
	if err != nil {
		log.Printf("Error")
	}

	return context, err
}

func AnnotateFuseki(softwareImage SoftwareImage, endpointAddr string) (string, error) {
	siteHost = endpointAddr
	base = "http://dockerpedia.inf.utfsm.cl/"
	var buffer bytes.Buffer
	var triples []tstore.Triple
	context, err := preBuildContext()
	if err != nil {
		log.Println("Failed build the context")
	}
	imageName := convertImageName(softwareImage)

	triplesSoftwareImage(softwareImage, &triples, context)
	tripleLayers(softwareImage.FsLayers, imageName, &triples)
	for _, feature := range softwareImage.Features {

		//featureVersion
		triplesFeatureVersion(imageName, *feature, &triples)

		//namespace
		triplesNameSpace(feature.NamespaceName, &triples)

		//features
		triplesSoftwarePackage(imageName, *feature, &triples)

		encodeSoftwarePackage(*feature, context)

		//vulnerabilities
		/*for _, vulnerability := range feature.Vulnerabilities {
			triplesVulnerabilities(vulnerability, *feature, &triples)
			encodeVulnerability(vulnerability, context)
		}*/

	}

	//encode all triples
	enc := tstore.NewLenientNTEncoderWithContext(&buffer, context)
	err = enc.Encode(triples...)
	if err != nil {
		fmt.Printf("error")
	}
	sendToFuseki(buffer)

	identifier := convertImageName(softwareImage)
	softwareImageURI := fmt.Sprintf("%sresource/SoftwareImage/%s", base, identifier)
	return softwareImageURI, err
}
<file_sep>/Dockerfile
# Dockerfile References: https://docs.docker.com/engine/reference/builder/

# Start from golang v1.11 base image
FROM golang:1.11 as builder

# Add Maintainer Info
LABEL maintainer="Maximiliano <<EMAIL>>"

# Set the Current Working Directory inside the container
WORKDIR /go/src/github.com/dockerpedia/annotator

# Copy everything from the current directory to the PWD(Present Working Directory) inside the container
COPY . .

# Download dependencies
RUN go get -d -v ./...

# Build the Go app
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /go/bin/annotator .

######## Start a new stage from scratch #######
FROM alpine:latest

RUN apk --no-cache add ca-certificates

WORKDIR /root/

# Copy the Pre-built binary file from the previous stage
COPY --from=builder /go/bin/annotator .

# Copy configuration
COPY config.toml .

EXPOSE 8081

CMD ["./annotator"]<file_sep>/whitelist-example.yaml
general:
  - RHSA-2018:1345
images:
  centos:
    - RHSA-2017:2479
    - RHSA-2018:0805
  alpine:
    - CVE-2017-9671<file_sep>/dockerpedia/reader.go
package dockerpedia

import (
	"bytes"
	"net/http"
	"fmt"
	"log"
	"io/ioutil"
	tstore "github.com/wallix/triplestore"
	"strings"
)

func readFromFuseki() ([]byte, error) {
	client := &http.Client{}
	var raw = []byte(`query=
PREFIX vocab: <http://dockerpedia.inf.utfsm.cl/vocab#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
CONSTRUCT {
	<http://dockerpedia.inf.utfsm.cl/resource/SoftwareImage/mosorio-dispel4py> vocab:containsSoftware ?l
} WHERE {
<http://dockerpedia.inf.utfsm.cl/resource/SoftwareImage/mosorio-dispel4py> vocab:containsSoftware  ?p .
  ?p rdfs:label ?l
}
`)

	req, err := http.NewRequest("POST", fmt.Sprintf("%s/test3/sparql", siteHost), bytes.NewBuffer(raw))
	req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
	req.Header.Set("Accept", "text/plain")
	if err != nil {
		log.Println(err)
	}
	resp, err := client.Do(req)
	if err != nil {
		panic(err)
	}
	body, _ := ioutil.ReadAll(resp.Body)
	resp.Body.Close()

	return body, err
}

func convertResponse() []tstore.Triple{
	data, err  := readFromFuseki()
	if err != nil{
		log.Println("error reading the data")
	}
	r:= bytes.NewReader(data)
	dec := tstore.NewDatasetDecoder(tstore.NewLenientNTDecoder, r)

	triples, err := dec.Decode()
	if err != nil {
		log.Println(err)
	}
	return triples

}

func generatePackagesName(subject string, stringsSlice *[]string) {
	new := strings.Replace(subject, "http://dockerpedia.inf.utfsm.cl/vocab", "", -1)
	*stringsSlice = append(*stringsSlice, new)
}

func getSoftwarePackages(){
	triples := convertResponse()
	packages := []string{}
	src := tstore.NewSource()
	src.Add(triples...)
	snap := src.Snapshot()
	softwareTriples := snap.WithPredicate("http://dockerpedia.inf.utfsm.cl/vocab#containsSoftware")
	for _, tri := range softwareTriples {
		literal, _ := tri.Object().Literal()
		generatePackagesName(literal.Value(), &packages)
		packages = append(packages, literal.Value())
	}
	//writeAptGet(packages)
}

func detectFormatPackages(namespace string){
	switch namespace {
	//Debian 6, 7, 8, unstable namespaces
	//Ubuntu 12.04, 12.10, 13.04, 14.04, 14.10, 15.04, 15.10, 16.04 namespaces
	case "dpkg":
		fmt.Println(namespace)
	//CentOS 5, 6, 7 namespaces
	//Oracle Linux 5, 6, 7 namespaces
	case "rpm":
		fmt.Println(namespace)
	//Alpine 3.3, Alpine 3.4, Alpine 3.5 namespaces
	case "apk":
		fmt.Println(namespace)
	}
}

func writeAptGet(packages []string){
	if len(packages) > 0 {
		var buffer bytes.Buffer
		buffer.WriteString(`apt-get update && apt-get install -y \` )
		for i := 0; i < len(packages) - 1; i++{
			buffer.WriteString(fmt.Sprintf("%s \t", packages[i]))
		}
		buffer.WriteString(fmt.Sprintf("%s", packages[len(packages)-1]))
	}
}

func writeYum(packages []string){
	if len(packages) > 0 {
		var buffer bytes.Buffer
		buffer.WriteString(`yum install -y \` )
		for i := 0; i < len(packages) - 1; i++{
			buffer.WriteString(fmt.Sprintf("%s \t", packages[i]))
		}
		buffer.WriteString(fmt.Sprintf("%s", packages[len(packages)-1]))
	}

}<file_sep>/README.md
# DockerPedia Annotator

Disclamer: This note is work-in-progress and will be progressively updated

Experiment reproducibility is the ability to run an experiment with the introduction of changes to it. To allow reproducibility, the scientific community encourages researchers to publish descriptions of the these experiments. However, these recommendations do not include an automated way for creating such descriptions: normally scientists have to annotate their experiments in a semi automated way. In this paper we propose a system to automatically describe computational environments used in in-silico experiments. We propose to use Operating System (OS) virtualization (containerization) for distributing software experiments throughout software images and an annotation system that will allow to describe these software images. The images are a minimal version of an OS (container) that allow the deployment of multiple isolated software packages within it.
<file_sep>/dockerpedia/dockerpedia.go
package dockerpedia

import (
	"bytes"
	"encoding/json"
	"errors"
	"fmt"
	manifestV1 "github.com/docker/distribution/manifest/schema1"
	"github.com/dockerpedia/annotator/clair"
	"github.com/dockerpedia/annotator/docker"
	annotatorConfig "github.com/dockerpedia/annotator/internal/config"
	"github.com/dockerpedia/annotator/klar"
	registryClient "github.com/dockerpedia/docker-registry-client/registry"
	"github.com/gin-gonic/gin"
	"log"
	"net/http"
	"strconv"
	"strings"
	"time"
)

// DebianReleasesMapping translates Debian code names and class names to version numbers
var DebianReleasesMapping = map[string]string{
	// Code names
	"squeeze": "6",
	"wheezy":  "7",
	"jessie":  "8",
	"stretch": "9",
	"buster":  "10",
	"sid":     "unstable",

	// Class names
	"oldoldstable": "7",
	"oldstable":    "8",
	"stable":       "9",
	"testing":      "10",
	"unstable":     "unstable",
}

// UbuntuReleasesMapping translates Ubuntu code names to version numbers
var UbuntuReleasesMapping = map[string]string{
	"precise": "12.04",
	"quantal": "12.10",
	"raring":  "13.04",
	"trusty":  "14.04",
	"utopic":  "14.10",
	"vivid":   "15.04",
	"wily":    "15.10",
	"xenial":  "16.04",
	"yakkety": "16.10",
	"zesty":   "17.04",
	"artful":  "17.10",
	"bionic":  "18.04",
}

//http://dockerpedia.inf.utfsm.cl/resource/SoftwareImage/{id}
type SoftwareImage struct {
	Name       string                     `form:"image" json:"image" binding:"required" predicate:"rdfs:label"`
	Version    string                     `form:"tag" json:"tag" binding:"required"`
	Size       int64                      `json:"size" predicate:"vocab:size"`
	Features   []*clair.Feature           `json:"features"`
	ManifestV1 *manifestV1.SignedManifest `json:"manifest"`
	History    []v1Compatibility          `json:"history"`
	BaseImage  string                     `json:"base_image"`
	Labels     Labels                     `json:"labels"`
	FsLayers   []docker.FsLayer
}

type Labels struct {
	BuildDate       string `json:"org.label-schema.build-date,omitempty",predicate:"vocab:buildDate"`
	Description     string `json:"org.label-schema.description,omitempty"`
	Name            string `json:"org.label-schema.name,omitempty"`
	Usage           string `json:"org.label-schema.usage,omitempty"`
	Url             string `json:"org.label-schema.url,omitempty"`
	VcsUrl          string `json:"org.label-schema.vcs-url,omitempty"`
	VcsRef          string `json:"org.label-schema.vcs-ref,omitempty"`
	Vendor          string `json:"org.label-schema.vendor,omitempty"`
	Version         string `json:"org.label-schema.version,omitempty"`
	SchemaVersion   string `json:"org.label-schema.schema-version,omitempty"`
	DockerCmd       string `json:"org.label-schema.docker.cmd,omitempty"`
	DockerCmdDevel  string `json:"org.label-schema.docker.cmd.devel,omitempty"`
	DockerCmdTest   string `json:"org.label-schema.docker.cmd.test,omitempty"`
	DockerCmdDebug  string `json:"org.label-schema.docker.cmd.debug,omitempty"`
	DockerCmdHelp   string `json:"org.label-schema.docker.cmd.help,omitempty"`
	DockerCmdParams string `json:"org.label-schema.docker.cmd.params,omitempty"`
	RktCmd          string `json:"org.label-schema.rkt.cmd,omitempty"`
	RktCmdDevel     string `json:"org.label-schema.rkt.cmd.devel,omitempty"`
	RktCmdTest      string `json:"org.label-schema.rkt.cmd.test,omitempty"`
	RktCmdDebug     string `json:"org.label-schema.rkt.cmd.debug,omitempty"`
	RktCmdHelp      string `json:"org.label-schema.rkt.cmd.help,omitempty"`
	RktCmdParams    string `json:"org.label-schema.rkt.cmd.params,omitempty"`
}

//V1Compatibility is the raw V1 compatibility information. This will contain the JSON object describing the V1 of this image.
type v1Compatibility struct {
	Architecture    string    `json:architecture`
	ID              string    `json:"id"`
	Parent          string    `json:"parent,omitempty"`
	Comment         string    `json:"comment,omitempty"`
	Created         time.Time `json:"created"`
	Author          string    `json:"author,omitempty"`
	ThrowAway       bool      `json:"throwaway,omitempty"`
	ContainerConfig struct {
		Cmd   []string `json:"Cmd,omitempty"`
		Image string   `json:"Image,omitempty"`
	} `json:"container_config,omitempty"`
	Config struct {
		Labels Labels `json:Labels,omitempty`
	} `json:"config,omitempty"`
}

// http://dockerpedia.inf.utfsm.cl/resource/DockerFile/{id}
type Dockerfile struct {
	Steps []string `json:steps`
}

//	Version of SoftwarePackage
// http://dockerpedia.inf.utfsm.cl/resource/PackageVersion/{id}
type FeatureVersion struct {
	Version string `json:"Version,omitempty" predicate:"rdfs:label"`
}

//Operating system of the SoftwareImage and SoftwarePackage
type Namespace struct {
	OperatingSystem string `json:"NamespaceName,omitempty" predicate:"vocab:operatingSystem"`
	Version         string `json:"Version,omitempty" predicate:"vocab:operatingSystemVersion"`
}

//Layer of DockerImage
type Layer struct {
	Name       string `predicate:"rdfs:label"`
	ParentName string
}

// Get the params of Workflow (API)
type RequestWorkflow struct {
	Name        string `form:"image" json:"image"`
	Version     string `form:"tag" json:"tag"`
	PipPackages string `form:"pip_requirements" json:"pip_requirements"`
	OutputImage string `form:"output_image" json:"output_image"`
}

//Detect the operating system using the information of SoftwarePackage
func detectBaseImage(newImage SoftwareImage) (string) {
	return newImage.Features[0].NamespaceName
}

var dockerurl string = "https://registry-1.docker.io/"
var username string = "" // anonymous
var password string = "" // <PASSWORD>

func NewRepository(c *gin.Context) {
	configuration, _ := annotatorConfig.New()

	var bufferDockerfile bytes.Buffer
	clientRegistry := registryClient.New(dockerurl, username, password)
	var newImage SoftwareImage
	var request RequestWorkflow
	if err := c.ShouldBindJSON(&request); err == nil {
		//Get tag size
		var dockerImage *docker.Image
		//Get the source image from the request
		newImage.Name = request.Name
		newImage.Version = request.Version
		imageFullName := fmt.Sprintf("%s:%s", newImage.Name, newImage.Version)

		/*
		Get the info about the image
		 */
		size, err := clientRegistry.TagSize(newImage.Name, newImage.Version)
		if err != nil {
			log.Printf(newImage.Name, "Unable to the get size of the image %s:%s", newImage.Version)
		}
		newImage.Size = size

		manifest, errManifest := clientRegistry.Manifest(newImage.Name, newImage.Version)
		if errManifest != nil {
			log.Printf("Unable to the get manifest of the image %s:%s", newImage.Name, newImage.Version)
		}
		newImage.ManifestV1 = manifest

		/*
		Ask about the features of image using Klar
		 */
		newImage.Features, dockerImage, err = klar.DockerAnalyze(imageFullName, configuration.Clair.Address, configuration.Clair.Port)
		if err != nil {
			c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
		}
		/*
		Copy layers and history
		 */
		newImage.FsLayers = dockerImage.FsLayers
		newImage.History = parseManifestV1Compatibility(newImage.ManifestV1)

		/*
		If exists, detect the labels of the image
		*/
		if len(newImage.History) > 0 {
			newImage.Labels = newImage.History[0].Config.Labels
		}
		/*
		Detect the base image
		 */
		//if newImage.BaseImage == "" {
		//	newImage.BaseImage = detectBaseImage(newImage)
		//}
		/*
		Find layer that install software and prepare the Dockerfile
		 */
		installedLines, err := findLayerInstaller(newImage.History)
		if err != nil {
			c.JSON(http.StatusInternalServerError, gin.H{
				"err": err,
			})
		}
		writeDockerfileContent(&bufferDockerfile, newImage.BaseImage, installedLines)

		/*
		Annotate using RDF store and build the image
		 */
		softwareImageURI, err := AnnotateFuseki(newImage, configuration.Endpoint.Address)

		c.JSON(http.StatusOK, gin.H{
			"uri": softwareImageURI,
		})
	} else {
		c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
	}
}

func writeDockerfileContent(buffer *bytes.Buffer, baseImage string, installedLines []string) {
	baseInstruction := fmt.Sprintf("FROM %s\n", baseImage)
	buffer.WriteString(baseInstruction)
	for _, line := range installedLines {
		installInstruction := fmt.Sprintf("RUN %s\n", line)
		buffer.WriteString(installInstruction)
	}
}

func findLayerInstaller(history []v1Compatibility) ([]string, error) {
	var lines []string
	if len(history) > 0 {
		author := history[0].Author
		for _, layer := range history {
			if layer.Author == author {
				cmd := strings.Join(layer.ContainerConfig.Cmd, " ")
				cmd = strings.Replace(cmd, "/bin/sh -c ", "", -1)
				lines = append([]string{cmd}, lines...)
			}
		}
	} else {
		err := errors.New("the image doesn't has the author image, please them")
		return nil, err
	}
	return lines, nil
}

func parseManifestV1Compatibility(manifest *manifestV1.SignedManifest) []v1Compatibility {
	var v1Items []v1Compatibility
	for _, history := range manifest.History {
		data, err := json.Marshal(history.V1Compatibility)
		if err != nil {
			log.Fatal("JSON marshaling failed")
		}

		var v1Item v1Compatibility
		var val []byte = []byte(data)
		s, _ := strconv.Unquote(string(val))
		err = json.Unmarshal([]byte(s), &v1Item)
		if err != nil {
			log.Fatalf("JSON marshaling failed %s", err)
		}

		v1Items = append(v1Items, v1Item)
	}
	return v1Items
}
<file_sep>/main.go
package main

import (
	"github.com/dockerpedia/annotator/internal/config"
	"github.com/dockerpedia/annotator/dockerpedia"
	"github.com/gin-gonic/gin"
	_ "github.com/lib/pq"
	"log"
	"net/http"

)

func main() {
	router := gin.Default()
	configuration, err := config.New()
	if err != nil {
		log.Panicln("Configuration error", err)
	}

	v1 := router.Group("/api/v1/")
	{
		v1.POST("/repositories/new", dockerpedia.NewRepository)

	}
	router.StaticFS("/workflows/", http.Dir("workflows/"))
	router.StaticFS("/logs/", http.Dir("logs/"))

	router.Run(configuration.Server.Listen)
}

languages: TOML Markdown Dockerfile YAML Go

repo_language: TOML

repo_name: dockerpedia/annotator


text:
<repo_name>IconsEdged/dotVim<file_sep>/vimrc
" This must be first, because it changes other options as side effect
set nocompatible
"call pathogen#runtime_append_all_bundles()
call pathogen#incubate()
call pathogen#helptags()
execute pathogen#infect()

filetype plugin indent on
filetype indent plugin on

syntax enable
if has('gui_running')
    set background=dark
    colorscheme solarized
else
    set background=light
    colorscheme Mustang
endif
set t_Co=16
let g:solarized_termcolors=16

"http://stackoverflow.com/questions/880668/how-to-avoid-indentation-error-after-changing-tab-stops-in-vim
set tabstop=4
set shiftwidth=4
set expandtab

"easyMotion Plugin for VIM's leader key configuration.
let g:EasyMotion_leader_key = '\'

"NERDTree plugin configuration.

"open a NERDTree automatically when vim starts up
autocmd vimenter * NERDTree
"open a NERDTree automatically when vim starts up if no files were specified
autocmd vimenter * if !argc() | NERDTree | endif
"map a specific key or shortcut to open NERDTree
map <C-n> :NERDTreeToggle<CR>
"close vim if the only window left open is a NERDTree
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
"cursor always starts in the NERDTree window
"http://stackoverflow.com/questions/1447334/how-do-you-add-nerdtree-to-your-vimrc
autocmd VimEnter * wincmd p
"Easy window navigation, Just use CTRL + hjkl for navigation inplace of CTRL + W
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l

"http://stackoverflow.com/questions/2441795/becoming-better-at-vim
"Disable arrow key in Command Mode
map <up> <nop>
map <down> <nop>
map <left> <nop>
map <right> <nop>
"Disable arrow key in insert mode.
imap <up> <nop>
imap <down> <nop>
imap <left> <nop>
imap <right> <nop>

if has("unix")
  let s:uname = system("uname")
  if s:uname == "Darwin\n"
    " Do Mac stuff here
    "http://vimbits.com/bits/139
    "for making this work in Macvim
    set macmeta
  endif
endif

"http://vim.wikia.com/wiki/Moving_lines_up_or_down
"In normal mode or in insert mode, press Alt-j to move the current line down,
"or press Alt-k to move the current line up.
"After visually selecting a block of lines (for example, by pressing V then moving the cursor down),
"press Alt-j to move the whole block down, or press Alt-k to move the block up.

nnoremap <A-j> :m .+1<CR>==
nnoremap <A-k> :m .-2<CR>==
inoremap <A-j> <Esc>:m .+1<CR>==gi
inoremap <A-k> <Esc>:m .-2<CR>==gi
vnoremap <A-j> :m '>+1<CR>gv=gv
vnoremap <A-k> :m '<-2<CR>gv=gv

"http://vimbits.com/bits/13
"80-character line coloring
if exists('+colorcolumn')
    set colorcolumn=80
else
    au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%>80v.\+', -1)
endif

"http://vimbits.com/bits/169
"When opening a file, always jump to the last cursor position
autocmd BufReadPost *
            \ if line("'\"") > 0 && line ("'\"") <= line("$") |
            \ exe "normal g'\"" |
            \ endif

"http://vimbits.com/bits/312
"highlight the current line/column, except when reading
set cursorline cursorcolumn " highlight the current line/column
" f12 to toggle line/column highlighting
noremap <silent><f12> :set cursorline! cursorcolumn!<cr>

"http://vimbits.com/bits/397
"move cursor when insert mode
imap <C-h> <C-o>h
imap <C-j> <C-o>j
imap <C-k> <C-o>k
imap <C-l> <C-o>l

"Show where replace area ends
set cpoptions+=$
"http://vim.wikia.com/wiki/Easier_buffer_switching
:nnoremap <F5> :buffers<CR>:buffer<Space>

<file_sep>/README.md
dotVim
======

vim Configuration

ln -s ~/.vim/vimrc ~/.vimrc

languages:
Markdown
Vim Script

repo_name: IconsEdged/dotVim