text:
package org.jdom.adapters;

import java.io.*;
import java.lang.reflect.*;

import org.jdom.*;
import org.jdom.input.*;
import org.w3c.dom.Document;

/**
 * An adapter for any parser supporting the Sun JAXP APIs.
 *
 * @version $Revision: 1.12 $, $Date: 2004/02/06 09:28:31 $
 * @author  Jason Hunter
 */
public class JAXPDOMAdapter extends AbstractDOMAdapter {

    private static final String CVS_ID =
      "@(#) $RCSfile: JAXPDOMAdapter.java,v $ $Revision: 1.12 $ $Date: 2004/02/06 09:28:31 $ $Name: jdom_1_0 $";

    /**
     * This creates a new {@link Document} from an
     * existing InputStream by letting a JAXP
     * parser handle parsing using the supplied stream.
     *
     * @param in InputStream to parse.
     * @param validate boolean to indicate if validation
     *        should occur.
     * @return Document - instance ready for use.
     * @throws IOException when I/O error occurs.
     * @throws JDOMException when errors occur in parsing.
      */
    public Document getDocument(InputStream in, boolean validate)
        throws IOException, JDOMException {

        try {
            // Try using JAXP...
            // Note we need DOM Level 2 and thus JAXP 1.1.
            Class.forName("javax.xml.transform.Transformer");

            // Try JAXP 1.1 calls to build the document
            Class factoryClass =
                Class.forName("javax.xml.parsers.DocumentBuilderFactory");

            // factory = DocumentBuilderFactory.newInstance();
            Method newParserInstance =
                factoryClass.getMethod("newInstance", null);
            Object factory = newParserInstance.invoke(null, null);

            // factory.setValidating(validate);
            Method setValidating =
                factoryClass.getMethod("setValidating",
                                   new Class[]{boolean.class});
            setValidating.invoke(factory,
                                 new Object[]{new Boolean(validate)});

            // factory.setNamespaceAware(true);
            Method setNamespaceAware =
                factoryClass.getMethod("setNamespaceAware",
                                       new Class[]{boolean.class});
            setNamespaceAware.invoke(factory,
                                 new Object[]{Boolean.TRUE});

            // jaxpParser = factory.newDocumentBuilder();
            Method newDocBuilder =
                factoryClass.getMethod("newDocumentBuilder", null);
            Object jaxpParser  = newDocBuilder.invoke(factory, null);

            // jaxpParser.setErrorHandler(null);
            Class parserClass = jaxpParser.getClass();
            Method setErrorHandler =
                parserClass.getMethod("setErrorHandler",
                                 new Class[]{org.xml.sax.ErrorHandler.class});
            setErrorHandler.invoke(jaxpParser,
                                 new Object[]{new BuilderErrorHandler()});

            // domDoc = jaxpParser.parse(in);
            Method parse = parserClass.getMethod(
                "parse", new Class[]{InputStream.class});
            org.w3c.dom.Document domDoc = (org.w3c.dom.Document)
                parse.invoke(jaxpParser, new Object[]{in});

            return domDoc;
        } catch (InvocationTargetException e) {
            Throwable targetException = e.getTargetException();
            if (targetException instanceof IOException) {
                throw (IOException) targetException;
            } else {
                throw new JDOMException(targetException.getMessage(), targetException);
            }
        } catch (Exception e) {
            throw new JDOMException("Reflection failed while parsing a document with JAXP", e);
        }

        // Allow all exceptions to pass through
    }

    /**
     * This creates an empty Document object based
     * on a specific parser implementation.
     *
     * @return Document - created DOM Document.
     * @throws JDOMException when errors occur in parsing.
      */
    public Document createDocument()
        throws JDOMException {

        try {
            // We need DOM Level 2 and thus JAXP 1.1.
            // If JAXP 1.0 is all that's available then we error out.
            Class.forName("javax.xml.transform.Transformer");

            // Try JAXP 1.1 calls to build the document
            Class factoryClass =
                Class.forName("javax.xml.parsers.DocumentBuilderFactory");

            // factory = DocumentBuilderFactory.newInstance();
            Method newParserInstance =
                factoryClass.getMethod("newInstance", null);
            Object factory = newParserInstance.invoke(null, null);

            // jaxpParser = factory.newDocumentBuilder();
            Method newDocBuilder =
                factoryClass.getMethod("newDocumentBuilder", null);
            Object jaxpParser  = newDocBuilder.invoke(factory, null);

            // domDoc = jaxpParser.newDocument();
            Class parserClass = jaxpParser.getClass();
            Method newDoc = parserClass.getMethod("newDocument", null);
            org.w3c.dom.Document domDoc =
                (org.w3c.dom.Document) newDoc.invoke(jaxpParser, null);

            return domDoc;
        } catch (Exception e) {
            throw new JDOMException("Reflection failed while creating new JAXP document", e);
        }

    }
}

redpajama_set_name: RedPajamaGithub


text:
package jp.co.ctc_g.jse.rest.springmvc.showcase.presentation;

import static org.hamcrest.CoreMatchers.is;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.when;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import static org.springframework.test.web.servlet.setup.MockMvcBuilders.webAppContextSetup;

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

import jp.co.ctc_g.jfw.core.exception.ApplicationRecoverableException;
import jp.co.ctc_g.jfw.core.util.Dates;
import jp.co.ctc_g.jfw.core.util.PartialList;
import jp.co.ctc_g.jse.rest.springmvc.showcase.business.domain.UserProfile;
import jp.co.ctc_g.jse.rest.springmvc.showcase.business.domain.UserProfileCriteria;
import jp.co.ctc_g.jse.rest.springmvc.showcase.business.domain.UserProfileSelection;
import jp.co.ctc_g.jse.rest.springmvc.showcase.business.domain.UserProfiles;
import jp.co.ctc_g.jse.rest.springmvc.showcase.business.service.UserProfileService;

import org.codehaus.jackson.map.ObjectMapper;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.filter.CharacterEncodingFilter;

@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@ContextConfiguration(classes = UserProfileResourceTestConfig.class)
public class UserProfileResourceTest {

    private static final String PATH_PREFIX = "/userProfile";

    private MockMvc mockMvc;

    @Autowired
    private WebApplicationContext context;

    @Autowired
    private UserProfileService mock;

    @BeforeClass
    public static void setupClass() {
        Locale.setDefault(new Locale("ja", "JP"));
    }

    @Before
    public void setup() {
        Mockito.reset(mock);
        mockMvc = webAppContextSetup(context).addFilter(encodingFilter(), "/*").build();
    }

    @Test
    public void 検索条件を指定しないで一覧検索が実行される() throws Exception {
        when(mock.listWithPaginating(any(UserProfileCriteria.class))).thenReturn(profiles());
        mockMvc.perform(get(PATH_PREFIX))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.domains[0].id", is(1)))
            .andExpect(jsonPath("$.domains[0].name", is("ユーザー")))
            .andExpect(jsonPath("$.domains[0].birthday", is("2014/04/01")));
    }

    @Test
    public void 検索条件を指定して一覧検索が実行される() throws Exception {
        when(mock.listWithPaginating(any(UserProfileCriteria.class))).thenReturn(profiles());
        mockMvc.perform(get(PATH_PREFIX).param("name", "foo"))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.domains[0].id", is(1)))
            .andExpect(jsonPath("$.domains[0].name", is("ユーザー")))
            .andExpect(jsonPath("$.domains[0].birthday", is("2014/04/01")));
    }

    @Test
    public void 検索時条件でバリデーションエラーが発生した場合メッセージが返される() throws Exception {
        mockMvc.perform(get(PATH_PREFIX)
                        .param("name","foobarfoobarfooba")
                        .locale(Locale.JAPAN))
            .andExpect(status().isBadRequest())
            .andExpect(jsonPath("$.message", is("不正なリクエストです。")))
            .andExpect(jsonPath("$.validationMessages[0].path", is("userProfileCriteria.name")))
            .andExpect(jsonPath("$.validationMessages[0].message", is("16文字以内で入力してください。")));
    }

    @Test
    public void 一覧検索で検索結果がないときはメッセージが返される() throws Exception {
        when(mock.listWithPaginating(any(UserProfileCriteria.class)))
            .thenThrow(new ApplicationRecoverableException("I-USER_PROFILE#004"));
        mockMvc.perform(get(PATH_PREFIX).locale(Locale.JAPAN))
            .andExpect(status().isBadRequest())
            .andExpect(jsonPath("$.status", is(400)))
            .andExpect(jsonPath("$.code", is("I-USER_PROFILE#004")))
            .andExpect(jsonPath("$.message", is("検索結果がありません。")));
    }

    @Test
    public void 主キーでの検索が実行される() throws Exception {
        when(mock.findById(any(UserProfileSelection.class))).thenReturn(profile());
        mockMvc.perform(get(PATH_PREFIX + "/1"))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.id", is(1)))
            .andExpect(jsonPath("$.name", is("ユーザー")))
            .andExpect(jsonPath("$.birthday", is("2014/04/01")));
    }

    @Test
    public void 主キー検索で検索結果がないときはメッセージが返される() throws Exception {
        when(mock.findById(any(UserProfileSelection.class)))
            .thenThrow(new ApplicationRecoverableException("E-USER_PROFILE#001"));
        mockMvc.perform(get(PATH_PREFIX + "/1").locale(Locale.JAPAN))
            .andExpect(status().isBadRequest())
            .andExpect(jsonPath("$.status", is(400)))
            .andExpect(jsonPath("$.code", is("E-USER_PROFILE#001")))
            .andExpect(jsonPath("$.message", is("指定されたID:${id}のデータは既に削除されている可能性があります。")));
    }

    @Test
    public void レコードの新規作成が実行される() throws Exception {
        when(mock.create(any(UserProfile.class))).thenReturn(profile());
        mockMvc.perform(post(PATH_PREFIX)
                         .content(convertObjectToString(profile()))
                         .contentType(MediaType.APPLICATION_JSON))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.id", is(1)))
            .andExpect(jsonPath("$.name", is("ユーザー")))
            .andExpect(jsonPath("$.birthday", is("2014/04/01")));
    }

    @Test
    public void 登録時にバリデーションエラーが発生した場合にメッセージが返される() throws Exception {
        mockMvc.perform(post(PATH_PREFIX).locale(Locale.JAPAN)
                            .content(convertObjectToString(badProfile()))
                            .contentType(MediaType.APPLICATION_JSON))
            .andExpect(status().isBadRequest())
            .andExpect(jsonPath("$.message", is("不正なリクエストです。")))
            .andExpect(jsonPath("$.validationMessages[0].path", is("userProfile.name")))
            .andExpect(jsonPath("$.validationMessages[0].message", is("必須入力です。")));
    }

    @Test
    public void レコードの更新が実行される() throws Exception {
        doNothing().when(mock).update(any(UserProfile.class));
        when(mock.findById(any(UserProfileSelection.class)))
            .thenReturn(profile());
        mockMvc.perform(put(PATH_PREFIX + "/1")
                         .content(convertObjectToString(profile()))
                         .contentType(MediaType.APPLICATION_JSON))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.id", is(1)))
            .andExpect(jsonPath("$.name", is("ユーザー")))
            .andExpect(jsonPath("$.birthday", is("2014/04/01")));
    }

    @Test
    public void 更新対象のレコードが存在しない場合にメッセージが返される() throws Exception {
        doThrow(new ApplicationRecoverableException("E-USER_PROFILE#002"))
            .when(mock).update(any(UserProfile.class));
        mockMvc.perform(put(PATH_PREFIX + "/1")
                        .content(convertObjectToString(profile()))
                        .contentType(MediaType.APPLICATION_JSON))
            .andExpect(status().isBadRequest())
            .andExpect(jsonPath("$.status", is(400)))
            .andExpect(jsonPath("$.code", is("E-USER_PROFILE#002")))
            .andExpect(jsonPath("$.message", is("指定されたID:${id}のデータは、他のユーザにより更新されている可能性があります。")));
    }

    @Test
    public void 更新時にバリデーションエラーが発生した場合にメッセージが返される() throws Exception {
        doNothing().when(mock).update(any(UserProfile.class));
        when(mock.findById(any(UserProfileSelection.class))).thenReturn(profile());
        mockMvc.perform(put(PATH_PREFIX + "/200").locale(Locale.JAPAN)
                            .content(convertObjectToString(badProfile()))
                            .contentType(MediaType.APPLICATION_JSON))
            .andExpect(status().isBadRequest())
            .andExpect(jsonPath("$.message", is("不正なリクエストです。")))
            .andExpect(jsonPath("$.validationMessages[0].path", is("userProfile.name")))
            .andExpect(jsonPath("$.validationMessages[0].message", is("必須入力です。")));
    }

    @Test
    public void ロケールに従ったメッセージが返される() throws Exception {
        doNothing().when(mock).update(any(UserProfile.class));
        when(mock.findById(any(UserProfileSelection.class))).thenReturn(profile());
        mockMvc.perform(put(PATH_PREFIX + "/200").locale(Locale.ENGLISH)
                            .content(convertObjectToString(badProfile()))
                            .contentType(MediaType.APPLICATION_JSON))
            .andExpect(status().isBadRequest())
            .andExpect(jsonPath("$.message", is("Bad Request")))
            .andExpect(jsonPath("$.validationMessages[0].path", is("userProfile.name")))
            .andExpect(jsonPath("$.validationMessages[0].message", is("must not be null")));
    }

    @Test
    public void レコードの削除が実行される() throws Exception {
        when(mock.delete(any(UserProfileSelection.class))).thenReturn(profile());
        mockMvc.perform(delete(PATH_PREFIX + "/99"))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.id", is(1)))
            .andExpect(jsonPath("$.name", is("ユーザー")))
            .andExpect(jsonPath("$.birthday", is("2014/04/01")));
    }

    @Test
    public void 削除対象のレコードが存在しない場合にメッセージが返される() throws Exception {
        when(mock.delete(any(UserProfileSelection.class)))
            .thenThrow(new ApplicationRecoverableException("E-USER_PROFILE#002"));
        mockMvc.perform(delete(PATH_PREFIX + "/1")
                        .content(convertObjectToString(profile()))
                        .contentType(MediaType.APPLICATION_JSON))
            .andExpect(status().isBadRequest())
            .andExpect(jsonPath("$.status", is(400)))
            .andExpect(jsonPath("$.code", is("E-USER_PROFILE#002")))
            .andExpect(jsonPath("$.message", is("指定されたID:${id}のデータは、他のユーザにより更新されている可能性があります。")));
    }

    private UserProfiles profiles() {
        UserProfiles profiles = new UserProfiles();
        List<UserProfile> ps = new PartialList<UserProfile>();
        ps.add(profile());
        profiles.setDomains(ps);
        return profiles;
    }

    private UserProfile profile() {
        UserProfile profile = new UserProfile();
        profile.setId(1);
        profile.setName("ユーザー");
        profile.setBirthday(Dates.makeFrom(2014, 4, 1));
        return profile;
    }

    private UserProfile badProfile() {
        UserProfile profile = new UserProfile();
        profile.setId(1);
        profile.setName("");
        profile.setBirthday(Dates.makeFrom(2014, 4, 1));
        return profile;
    }

    private static String convertObjectToString(Object object) throws Exception {
        ObjectMapper mapper = new ObjectMapper();
        mapper.setDateFormat(new SimpleDateFormat("yyyy/MM/DD"));
        return mapper.writeValueAsString(object);
    }

    private CharacterEncodingFilter encodingFilter() {
        CharacterEncodingFilter filter = new CharacterEncodingFilter();
        filter.setEncoding("UTF-8");
        filter.setForceEncoding(true);
        return filter;
    }
}


text:
<?py include('admin/header.html') ?>

		撰写新文章
		未发布的文章

	<form method="post" action="">

标题
<input type="text" id="title" name="title"/>

固定链接(格式一般为"YYYY/MM/DD/标题",留空则自动生成)
<input type="text" id="url" name="url"/>

内容

BBCode

HTML

纯文本

			<textarea id="content" name="content" rows="8" cols="120"></textarea>

分类

			<select id="category" name="category">
				<option value="" selected="selected">无分类</option>
<?py for category_name, category_path in categories: ?>
				<option value="${category_name}">${category_path}</option>
<?py #endfor ?>
			</select>

标签

<?py for index, tag in enumerate(tags): ?>
			<input type="checkbox" name="tags" id="tag#{index}" value="${tag}"/>${tag}
<?py #endfor ?>

搜索关键字(以","分隔)
<input type="text" id="keywords" name="keywords"/>

格式

				<input type="checkbox" id="bbcode" name="bbcode" checked="checked"/>BBCode
				<input type="checkbox" id="html" name="html"/>HTML

发布状态
<input type="checkbox" id="public" name="public" checked="checked"/>发布

发布时间(格式为"YYYY-MM-DD HH:MM:SS",留空则使用当前时间)
<input type="text" id="pub_time" name="pub_time"/>

最后修改时间(格式同上,留空则使用当前时间)
<input type="text" id="mod_time" name="mod_time"/>

<input type="submit" value="保存"/>

	</form>
<?py include('admin/footer.html') ?>


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta http-equiv="x-ua-compatible" content="ie=edge">

    <title>Home Page</title>

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.0/css/font-awesome.min.css">

    <link href="css/bootstrap.min.css" rel="stylesheet">

    <link href="css/mdb.min.css" rel="stylesheet">

    <link href="https://fonts.googleapis.com/css?family=Amatic+SC|Bungee+Inline|Bungee+Shade|Baloo+Paaji|Wire+One|Cabin|Fjalla+One|Josefin+Slab|Lobster|Lobster+Two|Oleo+Script|Changa|Pacifico|Satisfy|Farsan" rel="stylesheet">

    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

    <link href="css/style.css" rel="stylesheet">

Welcome

- Created by -

Matt Stevenson

                Log In  check_circle


text:
package common

import (
	"errors"

	log "github.com/Sirupsen/logrus"

	types "github.com/codedellemc/scaleio-framework/scaleio-scheduler/types"
)

const (
	//RebootCmdline reboot now
	RebootCmdline = "shutdown -r now"

	//RebootCheck check for the reboot
	RebootCheck = "reboot in 1 minute"
)

var (
	//ErrInitialStateFailed failed to get the initial state
	ErrInitialStateFailed = errors.New("Failed to get the initial cluster state")

	//ErrFindNodeFailed failed to find MDM Pair
	ErrFindNodeFailed = errors.New("Failed to find the specific node")

	//ErrMdmPairFailed failed to find MDM Pair
	ErrMdmPairFailed = errors.New("Failed to Find MDM Pair")

	//ErrStateChangeNotAcknowledged failed to find MDM Pair
	ErrStateChangeNotAcknowledged = errors.New("The node state change was not acknowledged")
)

//PersonaStringToID String -> PersonaID
func PersonaStringToID(persona string) int {
	switch persona {
	case "primary":
		return types.PersonaMdmPrimary
	case "secondary":
		return types.PersonaMdmSecondary
	case "tiebreaker":
		return types.PersonaTb
	case "data":
		return types.PersonaNode
	default:
		return types.PersonaUnknown
	}
}

//PersonaIDToString PersonaID -> String
func PersonaIDToString(persona int) string {
	switch persona {
	case types.PersonaMdmPrimary:
		return "primary"
	case types.PersonaMdmSecondary:
		return "secondary"
	case types.PersonaTb:
		return "tiebreaker"
	case types.PersonaNode:
		return "data"
	default:
		return "unknown"
	}
}

//GetSelfNode gets self
func GetSelfNode(state *types.ScaleIOFramework, executorID string) *types.ScaleIONode {
	log.Infoln("getSelfNode ENTER")
	for _, node := range state.ScaleIO.Nodes {
		if executorID == node.ExecutorID {
			log.Infoln("getSelfNode Found:", node.ExecutorID)
			log.Infoln("getSelfNode LEAVE")
			return node
		}
	}
	log.Infoln("getSelfNode NOT FOUND")
	log.Infoln("getSelfNode LEAVE")
	return nil
}

func getNodeType(state *types.ScaleIOFramework, nodeType int) (*types.ScaleIONode, error) {
	for _, node := range state.ScaleIO.Nodes {
		if node.Persona == nodeType {
			log.Infoln("Found MDM Node:", node.ExecutorID, "Persona:", node.Persona)
			return node, nil
		}
	}
	return nil, ErrFindNodeFailed
}

//GetPrimaryMdmNode gets the Primary node
func GetPrimaryMdmNode(state *types.ScaleIOFramework) (*types.ScaleIONode, error) {
	return getNodeType(state, types.PersonaMdmPrimary)
}

//GetSecondaryMdmNode gets the Secondary node
func GetSecondaryMdmNode(state *types.ScaleIOFramework) (*types.ScaleIONode, error) {
	return getNodeType(state, types.PersonaMdmSecondary)
}

//GetTiebreakerMdmNode gets the TB node
func GetTiebreakerMdmNode(state *types.ScaleIOFramework) (*types.ScaleIONode, error) {
	return getNodeType(state, types.PersonaTb)
}

func getMdmNodes(state *types.ScaleIOFramework) ([]types.ScaleIONode, error) {
	log.Infoln("getMdmNodes ENTER")

	pri, err := GetPrimaryMdmNode(state)
	if err != nil {
		log.Infoln("Failed to find Primary MDM")
		log.Infoln("getMdmNodes LEAVE")
		return nil, ErrMdmPairFailed
	}

	sec, err := GetSecondaryMdmNode(state)
	if err != nil {
		log.Infoln("Failed to find Secondary MDM")
		log.Infoln("getMdmNodes LEAVE")
		return nil, ErrMdmPairFailed
	}

	var col []types.ScaleIONode
	col = append(col, *pri)
	col = append(col, *sec)

	log.Infoln("Found MDM Pair")
	log.Infoln("getMdmNodes LEAVE")
	return col, nil
}

//CreateMdmPairString just like it sounds
func CreateMdmPairString(state *types.ScaleIOFramework) (string, error) {
	//use pre-configured MDM nodes
	if state.ScaleIO.Preconfig.PreConfigEnabled {
		str := state.ScaleIO.Preconfig.PrimaryMdmAddress + "," +
			state.ScaleIO.Preconfig.SecondaryMdmAddress
		log.Debugln("Using Pre-Configured MDMs:", str)
		return str, nil
	}

	log.Debugln("Creating MDMs based on Configuration")

	nodes, err := getMdmNodes(state)
	if err != nil {
		return "", err
	}

	str := ""
	for _, node := range nodes {
		if len(str) > 0 {
			str += ","
		}
		str += node.IPAddress
	}

	log.Debugln("IP String:", str)
	return str, nil
}

//GenerateSdsName creates the SDS name for this given node
func GenerateSdsName(node *types.ScaleIONode) string {
	str := "sds-" + node.Hostname
	return str
}

//GetGatewayAddress returns the ScaleIO gateway address
func GetGatewayAddress(state *types.ScaleIOFramework) (string, error) {
	if state.ScaleIO.Preconfig.PreConfigEnabled &&
		state.ScaleIO.Preconfig.GatewayAddress != "" {
		log.Debugln("Using Pre-Configured Gateway:",
			state.ScaleIO.Preconfig.GatewayAddress)
		return state.ScaleIO.Preconfig.GatewayAddress, nil
	} else if state.ScaleIO.Preconfig.PreConfigEnabled {
		log.Debugln("Pre-Configured Gateway Not Set:",
			state.ScaleIO.Preconfig.PrimaryMdmAddress)
		return state.ScaleIO.Preconfig.PrimaryMdmAddress, nil
	} else if state.ScaleIO.LbGateway != "" {
		log.Debugln("Using Load Balancing Gateway:",
			state.ScaleIO.LbGateway)
		return state.ScaleIO.LbGateway, nil
	}

	pri, err := GetPrimaryMdmNode(state)
	if err != nil {
		log.Errorln("Unable to find the Primary MDM node")
		return "", err
	}

	log.Debugln("Determined Gateway:", pri.IPAddress)
	return pri.IPAddress, nil
}


text:
package org.apache.hadoop.hive.ql.plan;

/**
 * VectorAppMasterEventDesc.
 *
 * Extra parameters beyond AppMasterEventDesc just for the VectorAppMasterEventDescOperator.
 *
 * We don't extend AppMasterEventDesc because the base OperatorDesc doesn't support
 * clone and adding it is a lot work for little gain.
 */
public class VectorAppMasterEventDesc extends AbstractVectorDesc  {

  private static final long serialVersionUID = 1L;

  public VectorAppMasterEventDesc() {
  }
}


text:
module Distribution.Simple.BuildPaths (
    defaultDistPref, srcPref,
    haddockDirName,
    hscolourPref, hscolourPref', haddockPref, haddockPref',
    autogenModulesDir,

    autogenModuleName,
    cppHeaderName,
    haddockName,

    mkLibName,
    mkProfLibName,
    mkSharedLibName,

    exeExtension,
    objExtension,
    dllExtension,

  ) where

import Distribution.Package
import Distribution.ModuleName as ModuleName
import Distribution.Compiler
import Distribution.PackageDescription
import Distribution.Simple.LocalBuildInfo
import Distribution.Simple.Setup
import Distribution.Text
import Distribution.System

import System.FilePath ((</>), (<.>))

-- ---------------------------------------------------------------------------
-- Build directories and files

srcPref :: FilePath -> FilePath
srcPref distPref = distPref </> "src"

-- Backwards compat, see #4123.
haddockPref, hscolourPref :: FilePath -> PackageDescription -> FilePath
haddockPref  = haddockPref' ForDevelopment
hscolourPref = haddockPref' ForDevelopment

hscolourPref' :: HaddockTarget -> FilePath -> PackageDescription -> FilePath
hscolourPref' = haddockPref'

-- | This is the name of the directory in which the generated haddocks
-- should be stored. It does not include the @<dist>/doc/html@ prefix.
haddockDirName :: HaddockTarget -> PackageDescription -> FilePath
haddockDirName ForDevelopment = display . packageName
haddockDirName ForHackage = (++ "-docs") . display . packageId

-- | The directory to which generated haddock documentation should be written.
haddockPref' :: HaddockTarget -> FilePath -> PackageDescription -> FilePath
haddockPref' haddockTarget distPref pkg_descr
    = distPref </> "doc" </> "html" </> haddockDirName haddockTarget pkg_descr

-- |The directory in which we put auto-generated modules
autogenModulesDir :: LocalBuildInfo -> String
autogenModulesDir lbi = buildDir lbi </> "autogen"

cppHeaderName :: String
cppHeaderName = "cabal_macros.h"

-- |The name of the auto-generated module associated with a package
autogenModuleName :: PackageDescription -> ModuleName
autogenModuleName pkg_descr =
  ModuleName.fromString $
    "Paths_" ++ map fixchar (display (packageName pkg_descr))
  where fixchar '-' = '_'
        fixchar c   = c

haddockName :: PackageDescription -> FilePath
haddockName pkg_descr = display (packageName pkg_descr) <.> "haddock"

-- ---------------------------------------------------------------------------
-- Library file names

mkLibName :: UnitId -> String
mkLibName lib = "lib" ++ getHSLibraryName lib <.> "a"

mkProfLibName :: UnitId -> String
mkProfLibName lib =  "lib" ++ getHSLibraryName lib ++ "_p" <.> "a"

-- Implement proper name mangling for dynamical shared objects
-- libHS<packagename>-<compilerFlavour><compilerVersion>
-- e.g. libHSbase-2.1-ghc6.6.1.so
mkSharedLibName :: CompilerId -> UnitId -> String
mkSharedLibName (CompilerId compilerFlavor compilerVersion) lib
  = "lib" ++ getHSLibraryName lib ++ "-" ++ comp <.> dllExtension
  where comp = display compilerFlavor ++ display compilerVersion

-- ------------------------------------------------------------
-- * Platform file extensions
-- ------------------------------------------------------------

-- | Default extension for executable files on the current platform.
-- (typically @\"\"@ on Unix and @\"exe\"@ on Windows or OS\/2)
exeExtension :: String
exeExtension = case buildOS of
                   Windows -> "exe"
                   _       -> ""

-- | Extension for object files. For GHC the extension is @\"o\"@.
objExtension :: String
objExtension = "o"

-- | Extension for dynamically linked (or shared) libraries
-- (typically @\"so\"@ on Unix and @\"dll\"@ on Windows)
dllExtension :: String
dllExtension = case buildOS of
                   Windows -> "dll"
                   OSX     -> "dylib"
                   _       -> "so"


text:
#ifdef UWP
#include "..\adventures-of-orchi\Include\Input\MobileController.hpp"
#include "Engine\Include\Model\Player.hpp"
#elif defined(IOS)
#include "MobileController.hpp"
#include "Player.hpp"
#endif

//
//
//
MobileController::MobileController()
{

}

//
//
//
bool MobileController::Process(
	Player * pPlayer,
	int nCollisionState,
	float * pfHeading,
	float * pfForwardVelocity,
	int nFramesPerSecond,
	Subdivision * pSubdivision)
{
	return false;
}

//
//
//
unsigned short MobileController::CheckAButton(Player * pPlayer, Subdivision * pSubdivision)
{
	return 0;
}

//
//
//
unsigned short MobileController::CheckBButton(Player * pPlayer, Subdivision * pSubdivision)
{
	return 0;
}

//
//
//
unsigned short MobileController::CheckXButton(Player * pPlayer, Subdivision * pSubdivision)
{
	return 0;
}

//
//
//
unsigned short MobileController::CheckYButton(Player * pPlayer, Subdivision * pSubdivision)
{
	return 0;
}

//
//
//
double MobileController::CheckLTButton(Player * pPlayer, Subdivision * pSubdivision)
{
	return 0.0;
}

//
//
//
void MobileController::CheckLBButton(Player * pPlayer, Subdivision * pSubdivision)
{

}

//
//
//
double MobileController::CheckRTButton(Player * pPlayer, Subdivision * pSubdivision)
{
	return 0.0;
}

//
//
//
unsigned short MobileController::CheckRBButton(Player * pPlayer, Subdivision * pSubdivision)
{
	return 0;
}

//
//
//
void MobileController::CheckLeftThumbstick(Player * pPlayer, short sInputX, short sInputY)
{

}

//
//
//
void MobileController::CheckRightThumbstick(Player * pPlayer, short sInputX, short sInputY)
{

}

//
//
//
void MobileController::CheckDirectionalKeypad(Player * pPlayer, WORD wButtons)
{

}

//
//
//
void MobileController::CheckKey(Player * pPlayer, int asciiCode)
{

}

//
//
//
bool MobileController::GetIsConnected()
{
	return false;
}


text:
import { genStandardFileName } from './filenames';

describe('file name generator', () => {
  it('should return the correct string', () => {
    const actual = genStandardFileName('txt');
    const testRegex = /kaeru\-card_\d{1,2}-\d{1,2}-\d{4}-\d{1,2}:\d{2}:\d{2}-\w{2}\.\w+/;

    expect(actual.match(testRegex)).toBeTruthy();
  });
});


text:
{{myTabName[$index].name}}

            <my-skill name="{{skill.name}}" pourcentage="{{skill.level}}" comment="{{skill.comment}}" imgurl="{{skill.url}}"></my-skill>


text:
/* ###
 * IP: GHIDRA
 *
 * 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.
 */
package ghidra.feature.vt.gui.actions;

import docking.ActionContext;
import docking.action.DockingAction;
import docking.action.MenuData;
import docking.tool.ToolConstants;
import ghidra.feature.vt.api.main.VTSession;
import ghidra.feature.vt.gui.plugin.VTController;
import ghidra.feature.vt.gui.plugin.VTPlugin;
import ghidra.framework.main.DataTreeDialog;
import ghidra.framework.model.DomainFile;
import ghidra.framework.model.DomainFileFilter;
import ghidra.framework.plugintool.PluginTool;
import ghidra.util.HelpLocation;

public class OpenVersionTrackingSessionAction extends DockingAction {

	private final VTController controller;

	public OpenVersionTrackingSessionAction(VTController controller) {
		super("Open Session", VTPlugin.OWNER);
		this.controller = controller;
		String[] menuPath = { ToolConstants.MENU_FILE, "Open Session..." };
		setMenuBarData(new MenuData(menuPath, "AAA"));
		setDescription("Opens a Version Tracking Session");
		setHelpLocation(new HelpLocation("VersionTrackingPlugin", "Open_Session"));
	}

	@Override
	public void actionPerformed(ActionContext context) {
		PluginTool tool = controller.getTool();
		DataTreeDialog dialog =
			new DataTreeDialog(tool.getToolFrame(), "Open Version Tracking Session",
				DataTreeDialog.OPEN, new VTDomainFileFilter());

		tool.showDialog(dialog);
		if (!dialog.wasCancelled()) {
			DomainFile domainFile = dialog.getDomainFile();
			controller.openVersionTrackingSession(domainFile);
		}
	}

	class VTDomainFileFilter implements DomainFileFilter {
		public boolean accept(DomainFile f) {
			Class<?> c = f.getDomainObjectClass();
			return VTSession.class.isAssignableFrom(c);
		}

		@Override
		public boolean followLinkedFolders() {
			return false;
		}
	}
}


text:
#ifndef RTPCONFIG_UNIX_H

#define RTPCONFIG_UNIX_H

#define JRTPLIB_IMPORT
#define JRTPLIB_EXPORT
#ifdef JRTPLIB_COMPILING
	#define JRTPLIB_IMPORTEXPORT JRTPLIB_EXPORT
#else
	#define JRTPLIB_IMPORTEXPORT JRTPLIB_IMPORT
#endif // JRTPLIB_COMPILING

#define RTP_HAVE_SYS_FILIO

#define RTP_HAVE_SYS_SOCKIO

// Little endian system

#define RTP_SOCKLENTYPE_UINT

#define RTP_HAVE_SOCKADDR_LEN

#define RTP_SUPPORT_IPV4MULTICAST

#define RTP_SUPPORT_THREAD

#define RTP_SUPPORT_SDESPRIV

#define RTP_SUPPORT_PROBATION

#define RTP_SUPPORT_GETLOGINR

#define RTP_SUPPORT_IPV6

#define RTP_SUPPORT_IPV6MULTICAST

#define RTP_SUPPORT_IFADDRS

#define RTP_SUPPORT_SENDAPP

#define RTP_SUPPORT_MEMORYMANAGEMENT

// No support for sending unknown RTCP packets

#endif // RTPCONFIG_UNIX_H


text:
#include "ruby_gdiplus.h"

const rb_data_type_t tStringFormat = _MAKE_DATA_TYPE(
    "StringFormat", 0, GDIP_OBJ_FREE(StringFormat *), NULL, NULL, &cStringFormat);

/**
 * @overload initialize()
 * @overload initialize(format)
 *   @param format [StringFormat]
 * @overload initialize(options, language=0)
 *   @param options [StringFormatFlags]
 *   @param language [LangId] Specifies the language of the text.
 */
static VALUE
gdip_strfmt_init(int argc, VALUE *argv, VALUE self)
{
    StringFormat *strfmt = Data_Ptr<StringFormat *>(self);
    if (strfmt != NULL) {
        _VERBOSE("Object already initialized.");
        return self;
    }

    if (argc > 2) {
        rb_raise(rb_eArgError, "wrong number of arguments (%d for 0..2)", argc);
    }

    int flags = 0;
    LANGID language = LANG_NEUTRAL;

    if (argc == 1) {
        if (_KIND_OF(argv[0], &tStringFormat)) {
            StringFormat *format = Data_Ptr<StringFormat *>(argv[0]);
            Check_NULL(format, "The StringFormat of the argument does not exist.");
            _DATA_PTR(self) = gdip_obj_create(new StringFormat(format));
            return self;
        }
        else {
            gdip_arg_to_enumint(cStringFormatFlags, argv[0], &flags, "The first argument should be StringFormatFlags or StringFormat.", ArgOptionAcceptInt);
        }
    }
    else if (argc == 2) {
        if (!gdip_arg_to_enumint(cStringFormatFlags, argv[0], &flags) || !gdip_arg_to_langid(argv[1], &language)) {
            rb_raise(rb_eTypeError, "Argument types do not match.");
        }
    }
    _DATA_PTR(self) = gdip_obj_create(new StringFormat(flags, language));
    return self;
}

static VALUE vGenericDefault = Qnil;
static VALUE vGenericTypographic = Qnil;

/**
 * Gets a generic default StringFormat object.
 * @return [StringFormat]
 */
static VALUE
gdip_strfmt_s_get_generic_default(VALUE self)
{
    if (RB_NIL_P(vGenericDefault)) {
        vGenericDefault = typeddata_alloc_null<&tStringFormat>(cStringFormat);
        #if IFVC
            _DATA_PTR(vGenericDefault) = gdip_obj_create(StringFormat::GenericDefault()->Clone());
        #else
            _DATA_PTR(vGenericDefault) = gdip_obj_create(const_cast<StringFormat *>(StringFormat::GenericDefault()));
        #endif
        RB_OBJ_FREEZE(vGenericDefault);
        rb_gc_register_address(&vGenericDefault);
    }
    return vGenericDefault;
}

/**
 * Gets a generic typographic StringFormat object.
 * @return [StringFormat]
 */
static VALUE
gdip_strfmt_s_get_generic_typographic(VALUE self)
{
    if (RB_NIL_P(vGenericTypographic)) {
        vGenericTypographic = typeddata_alloc_null<&tStringFormat>(cStringFormat);
        #if IFVC
            _DATA_PTR(vGenericTypographic) = gdip_obj_create(StringFormat::GenericTypographic()->Clone());
        #else
            _DATA_PTR(vGenericTypographic) = gdip_obj_create(const_cast<StringFormat *>(StringFormat::GenericTypographic()));
        #endif
        RB_OBJ_FREEZE(vGenericTypographic);
        rb_gc_register_address(&vGenericTypographic);
    }
    return vGenericTypographic;
}

/**
 * Gets or sets the horizontal alignment.
 * @return [StringAlignment]
 */
static VALUE
gdip_strfmt_get_alignment(VALUE self)
{
    StringFormat *format = Data_Ptr<StringFormat *>(self);
    Check_NULL(format, "The StringFormat object does not exist.");
    return gdip_enumint_create(cStringAlignment, format->GetAlignment());
}

static VALUE
gdip_strfmt_set_alignment(VALUE self, VALUE arg)
{
    Check_Frozen(self);
    StringFormat *format = Data_Ptr<StringFormat *>(self);
    Check_NULL(format, "The StringFormat object does not exist.");
    int enumint = 0;
    gdip_arg_to_enumint(cStringAlignment, arg, &enumint, "The argument should be StringAlignment.", ArgOptionAcceptInt);
    Status status = format->SetAlignment(static_cast<StringAlignment>(enumint));
    Check_Status(status);
    return self;
}

/**
 * Gets the substitute language for western digits.
 * @return [LangId]
 */
static VALUE
gdip_strfmt_get_digit_substitution_language(VALUE self)
{
    StringFormat *format = Data_Ptr<StringFormat *>(self);
    Check_NULL(format, "The StringFormat object does not exist.");
    return gdip_langid_create(format->GetDigitSubstitutionLanguage());
}

/**
 * Gets the method for digit substitution.
 * @return [StringDigitSubstitute]
 */
static VALUE
gdip_strfmt_get_digit_substitution_method(VALUE self)
{
    StringFormat *format = Data_Ptr<StringFormat *>(self);
    Check_NULL(format, "The StringFormat object does not exist.");
    return gdip_enumint_create(cStringDigitSubstitute, format->GetDigitSubstitutionMethod());
}

/**
 * Gets or sets a StringFormatFlags.
 * @return [StringFormatFlags]
 */
static VALUE
gdip_strfmt_get_format_flags(VALUE self)
{
    StringFormat *format = Data_Ptr<StringFormat *>(self);
    Check_NULL(format, "The StringFormat object does not exist.");
    return gdip_enumint_create(cStringFormatFlags, format->GetFormatFlags());
}

static VALUE
gdip_strfmt_set_format_flags(VALUE self, VALUE arg)
{
    Check_Frozen(self);
    StringFormat *format = Data_Ptr<StringFormat *>(self);
    Check_NULL(format, "The StringFormat object does not exist.");
    int enumint = 0;
    gdip_arg_to_enumint(cStringFormatFlags, arg, &enumint, "The argument should be StringFormatFlags.", ArgOptionAcceptInt);
    Status status = format->SetFormatFlags(static_cast<StringFormatFlags>(enumint));
    Check_Status(status);
    return self;
}

/**
 * Gets or sets the HotkeyPrefix for this StringFormat.
 * @return [HotkeyPrefix]
 */
static VALUE
gdip_strfmt_get_hotkey_prefix(VALUE self)
{
    StringFormat *format = Data_Ptr<StringFormat *>(self);
    Check_NULL(format, "The StringFormat object does not exist.");
    return gdip_enumint_create(cHotkeyPrefix, format->GetHotkeyPrefix());
}

static VALUE
gdip_strfmt_set_hotkey_prefix(VALUE self, VALUE arg)
{
    Check_Frozen(self);
    StringFormat *format = Data_Ptr<StringFormat *>(self);
    Check_NULL(format, "The StringFormat object does not exist.");
    int enumint = 0;
    gdip_arg_to_enumint(cHotkeyPrefix, arg, &enumint, "The argument should be HotkeyPrefix.", ArgOptionAcceptInt);
    Status status = format->SetHotkeyPrefix(static_cast<HotkeyPrefix>(enumint));
    Check_Status(status);
    return self;
}

/**
 * Gets or sets the vertical alignment.
 * @return [StringAlignment]
 */
static VALUE
gdip_strfmt_get_line_alignment(VALUE self)
{
    StringFormat *format = Data_Ptr<StringFormat *>(self);
    Check_NULL(format, "The StringFormat object does not exist.");
    return gdip_enumint_create(cStringAlignment, format->GetLineAlignment());
}

static VALUE
gdip_strfmt_set_line_alignment(VALUE self, VALUE arg)
{
    Check_Frozen(self);
    StringFormat *format = Data_Ptr<StringFormat *>(self);
    Check_NULL(format, "The StringFormat object does not exist.");
    int enumint = 0;
    gdip_arg_to_enumint(cStringAlignment, arg, &enumint, "The argument should be StringAlignment.", ArgOptionAcceptInt);
    Status status = format->SetLineAlignment(static_cast<StringAlignment>(enumint));
    Check_Status(status);
    return self;
}

/**
 * Gets or sets the StringTrimming.
 * @return [StringTrimming]
 */
static VALUE
gdip_strfmt_get_trimming(VALUE self)
{
    StringFormat *format = Data_Ptr<StringFormat *>(self);
    Check_NULL(format, "The StringFormat object does not exist.");
    return gdip_enumint_create(cStringTrimming, format->GetTrimming());
}

static VALUE
gdip_strfmt_set_trimming(VALUE self, VALUE arg)
{
    Check_Frozen(self);
    StringFormat *format = Data_Ptr<StringFormat *>(self);
    Check_NULL(format, "The StringFormat object does not exist.");
    int enumint = 0;
    gdip_arg_to_enumint(cStringTrimming, arg, &enumint, "The argument should be StringTrimming.", ArgOptionAcceptInt);
    Status status = format->SetTrimming(static_cast<StringTrimming>(enumint));
    Check_Status(status);
    return self;
}

/**
 * Gets the tab stops.
 * @return [Array<Float>] distances between tab stops
 */
static VALUE
gdip_strfmt_get_tab_stops(VALUE self)
{
    StringFormat *format = Data_Ptr<StringFormat *>(self);
    Check_NULL(format, "The StringFormat object does not exist.");
    float offset = 0.0f;
    VALUE r = Qnil;
    int count = format->GetTabStopCount();
    if (count == 0) {
        r = rb_ary_new();
    }
    else {
        float *stops = static_cast<float *>(ruby_xmalloc(count * sizeof(float)));
        Status status = format->GetTabStops(count, &offset, stops);
        if (status == Ok) {
            r = rb_ary_new_capa(count);
            for (int i = 0; i < count; ++i) {
                rb_ary_push(r, SINGLE2NUM(stops[i]));
            }
        }
        ruby_xfree(stops);
        Check_Status(status);
    }
    return r;
}

/**
 * Gets the first tab offset.
 * @return [Float]
 */
static VALUE
gdip_strfmt_get_first_tab_offset(VALUE self)
{
    StringFormat *format = Data_Ptr<StringFormat *>(self);
    Check_NULL(format, "The StringFormat object does not exist.");
    float offset = 0.0f;
    float stops;
    Status status = format->GetTabStops(0, &offset, &stops);
    Check_Status(status);
    return SINGLE2NUM(offset);
}

/**
 * Sets the tab stops.
 * @param first_offset [Float]
 * @param tab_stops [Array<Float>]
 * @return [self]
 */
static VALUE
gdip_strfmt_set_tab_stops(VALUE self, VALUE first_offset, VALUE tab_stops)
{
    Check_Frozen(self);
    StringFormat *format = Data_Ptr<StringFormat *>(self);
    Check_NULL(format, "The StringFormat object does not exist.");

    float first = 0.0f;
    gdip_arg_to_single(first_offset, &first, "The first argument should be Float.");
    if (_RB_ARRAY_P(tab_stops)) {
        int count = 0;
        float *ary = alloc_array_of_single(tab_stops, count);
        Status status = Ok;
        if (ary == NULL) {
            float tmp = 0.0f;
            status = format->SetTabStops(first, 0, &tmp);
        }
        else {
            status = format->SetTabStops(first, count, ary);
            ruby_xfree(ary);
        }
        Check_Status(status);
    }
    else {
        rb_raise(rb_eTypeError, "The second argument should be Array of Float.");
    }

    return self;
}

/**
 * Sets the language and method for substitution of digits.
 * @param language [LangId]
 * @param substitute [StringSubstitute]
 * @return [self]
 */
static VALUE
gdip_strfmt_set_digit_substitution(VALUE self, VALUE language, VALUE substitute)
{
    Check_Frozen(self);
    StringFormat *format = Data_Ptr<StringFormat *>(self);
    Check_NULL(format, "The StringFormat object does not exist.");

    LANGID langid = 0;
    gdip_arg_to_langid(language, &langid, "The first argument should be LangId.");
    int enumint = 0;
    gdip_arg_to_enumint(cStringDigitSubstitute, substitute, &enumint, "The second argument should be StringDigitSubstitute.", ArgOptionAcceptInt);
    Status status = format->SetDigitSubstitution(langid, static_cast<StringDigitSubstitute>(enumint));
    Check_Status(status);

    return self;
}

/**
 * Sets ranges for Graphics#MeasureCharacterRanges method.
 * @param ranges [Array<Range>]
 * @return [self]
 * @example
 *   strfmt.SetMeasurableCharacterRanges([0..3, 6..10])
 */
static VALUE
gdip_strfmt_set_measurable_character_ranges(VALUE self, VALUE ranges)
{
    //Check_Frozen(self);
    StringFormat *format = Data_Ptr<StringFormat *>(self);
    Check_NULL(format, "The StringFormat object does not exist.");

    int ranges_len = RARRAY_LEN(ranges);
    if (_RB_ARRAY_P(ranges) && ranges_len > 0) {
        int count = 0;
        for (int i = 0; i < ranges_len; ++i) {
            VALUE range = rb_ary_entry(ranges, i);
            if (_RB_RANGE_P(range)) {
                VALUE beg = _rb_range_beg(range);
                VALUE end = _rb_range_end(range);
                if (Integer_p(beg, end)) {
                    count += 1;
                }
            }
        }
        if (count != ranges_len || count == 0) {
            _VERBOSE("The argument should be Array of Range, and the begin and end of Range should be Integer.");
        }
        if (count > 0) {
            CharacterRange *cranges = static_cast<CharacterRange *>(RB_ZALLOC_N(CharacterRange, count));
            VALUE tmp = _wrap_tmp_buffer(cranges);
            int idx = 0;
            for (int i = 0; i < ranges_len; ++i) {
                VALUE range = rb_ary_entry(ranges, i);
                if (_RB_RANGE_P(range)) {
                    VALUE beg = _rb_range_beg(range);
                    VALUE end = _rb_range_end(range);
                    if (Integer_p(beg, end)) {
                        int n_beg = RB_NUM2INT(beg);
                        int n_end = RB_NUM2INT(end);
                        cranges[idx].First = n_beg;
                        cranges[idx].Length = n_end - n_beg + (_rb_range_excl_p(range) ? 0 : 1);
                        idx += 1;
                    }
                }
            }
            Status status = format->SetMeasurableCharacterRanges(count, cranges);
            // ruby_xfree(cranges);
            _rb_free_tmp_buffer(&tmp);
            Check_Status(status);
        }
    }
    else {
        rb_raise(rb_eTypeError, "The argument should be Array of Range.");
    }

    return self;
}

void
Init_stringformat()
{
    cStringFormat = rb_define_class_under(mGdiplus, "StringFormat", cGpObject);
    rb_define_alloc_func(cStringFormat, &typeddata_alloc_null<&tStringFormat>);
    rb_define_method(cStringFormat, "initialize", RUBY_METHOD_FUNC(gdip_strfmt_init), -1);

    CLASS_ATTR_R(cStringFormat, GenericDefault, generic_default, strfmt);
    CLASS_ATTR_R(cStringFormat, GenericTypographic, generic_typographic, strfmt);

    ATTR_RW(cStringFormat, Alignment, alignment, strfmt);
    ATTR_R(cStringFormat, DigitSubstitutionLanguage, digit_substitution_language, strfmt);
    ATTR_R(cStringFormat, DigitSubstitutionMethod, digit_substitution_method, strfmt);
    ATTR_RW(cStringFormat, FormatFlags, format_flags, strfmt);
    ATTR_RW(cStringFormat, HotkeyPrefix, hotkey_prefix, strfmt);
    ATTR_RW(cStringFormat, LineAlignment, line_alignment, strfmt);
    ATTR_RW(cStringFormat, Trimming, trimming, strfmt);

    rb_define_method(cStringFormat, "GetTabStops", RUBY_METHOD_FUNC(gdip_strfmt_get_tab_stops), 0);
    rb_define_alias(cStringFormat, "get_tab_stops", "GetTabStops");
    rb_define_method(cStringFormat, "GetFirstTabOffset", RUBY_METHOD_FUNC(gdip_strfmt_get_first_tab_offset), 0);
    rb_define_alias(cStringFormat, "get_first_tab_offset", "GetFirstTabOffset");
    rb_define_method(cStringFormat, "SetTabStops", RUBY_METHOD_FUNC(gdip_strfmt_set_tab_stops), 2);
    rb_define_alias(cStringFormat, "set_tab_stops", "SetTabStops");
    rb_define_method(cStringFormat, "SetDigitSubstitution", RUBY_METHOD_FUNC(gdip_strfmt_set_digit_substitution), 2);
    rb_define_alias(cStringFormat, "set_digit_substitution", "SetDigitSubstitution");
    rb_define_method(cStringFormat, "SetMeasurableCharacterRanges", RUBY_METHOD_FUNC(gdip_strfmt_set_measurable_character_ranges), 1);
    rb_define_alias(cStringFormat, "set_measurable_character_ranges", "SetMeasurableCharacterRanges");

}


text:
module MongoJob
  module Mixins
    module Document
      def connection
        MongoJob.connection
      end

      def database_name
        MongoJob.database_name
      end
    end
  end
end


text:
layout: post
title: What is ICN with Perfect Forward Secrecy?
---

The IETF and related standards organizations converged towards the fundamental requirements
for transport security in the Internet. The Snowden revelations accelerated this decision as a way to curb mass surveillance. The growing consensus is that (perfect) forward secrecy is necessary to protect
communication [1] [2] [3]. Forward secrecy is a property of a communication session which states that the key used
to protect traffic for the session is derived from a non-deterministic algorithm. In practice, this means that each
party contributes a fresh Diffie-Hellman key share used to derive the session key. Secure session protocols like
TLS [2] build on this basic key exchange primitive to make session-based communication more efficient. But at the end
of the day, they all share the property of forward secrecy. Transport security must be, at a minimum, forward secure.

Unfortunately, the ICN community seems to be in a state of denial about this fundamental requirement. Many research
papers and applications depend on traffic which is not only non-forward secure but not encrypted at all. I am guilty
of writing papers like this myself. Indeed, if the world decides to deploy ICN in the Internet, then it absolutely
must be held to the same security requirements as modern TCP/IP protocols.

Last week, Mark Stapp and I put together a document entitled ["ICN Privacy Principles"](https://github.com/chris-wood/icn-privacy-principles)
to make these requirements explicit. In it, we outline six basic principles that we believe should drive the baseline
of communication in ICN. Without restating these principles verbatim, I will summarize the main theme of the document in two sentences:

1. All traffic must be encrypted by default using ephemeral keys (i.e., traffic must be forward secure).
2. An entity must properly authenticate an endpoint before sending any application data
to it. (This remains true for both consumers and producers.)

If you are a believer in the IETF's stance on privacy, e.g., that correlation is an attack on users and
forward secrecy is a necessity, then these principles should strike a chord with you. However, they raise some
fundamental questions about ICN as an architecture. The original ICN vision relied on in-network state
and intelligence based on cleartext names [4]. So if ICN messages (interests and content objects) contain
only some routable prefix (or none at all) and everything else protected by ephemeral keys, then
is this network truly "information-centric"?

In my opinion: no, it's not. Forward secrecy implies the existence of a session, which also implies that
communication happens between two well-defined endpoints. In IP, these endpoints are machines with specific
addresses. However, in ICN, these endpoints are a consumer and something like a service (or producer)
which can generate or produce data. Routable prefixes identify these services and the encrypted body
of an interest or content object contains the application data to be transferred. Make no mistake: this is not a step
backwards. Many applications today scale to resemble these types of services. A huge number of applications
use CDNs to push data close to consumers who then interact with these services to get data. This means that
service-centric networking, as opposed to information-centric networking, seems to more closely align with
modern web and mobile application models.

And is it not the point of the ICN research vision to develop a network architecture that better suits
modern applications?

# References

- [1] Specification for DNS over TLS, [https://tools.ietf.org/html/draft-ietf-dprive-dns-over-tls-09](https://tools.ietf.org/html/draft-ietf-dprive-dns-over-tls-09)
- [2] The Transport Layer Security (TLS) Protocol Version 1.3, [https://tools.ietf.org/html/draft-ietf-tls-tls13-11](https://tools.ietf.org/html/draft-ietf-tls-tls13-11)/
- [3] tcpcrypt, [http://www.tcpcrypt.org/](http://www.tcpcrypt.org/).
- [4] Jacobson, Van, et al. "Networking named content." Proceedings of the 5th international conference on Emerging networking experiments and technologies. ACM, 2009.


text:
package com.ebaotech.salesplatform.rest.model.quotation;

import java.io.Serializable;

public class QuotationRole implements Serializable {
	private static final long serialVersionUID = -4011108586686396287L;

	private String prospectOfflineId;

	public String getProspectOfflineId() {
		return prospectOfflineId;
	}

	public void setProspectOfflineId(String prospectOfflineId) {
		this.prospectOfflineId = prospectOfflineId;
	}
}


text:
"""Cloud Pub/Sub subscription list command."""
import re
from googlecloudsdk.api_lib.pubsub import util
from googlecloudsdk.calliope import base
from googlecloudsdk.calliope import exceptions as sdk_ex
from googlecloudsdk.core.console import console_io as io

class List(base.Command):
  """Lists Cloud Pub/Sub subscriptions.

  Lists all of the Cloud Pub/Sub subscriptions that exist in a given project.
  """

  @staticmethod
  def Args(parser):
    """Register flags for this command."""

    parser.add_argument(
        '--name-filter', default='',
        help=('A regular expression that will limit which subscriptions are'
              ' returned by matching on subscription name.'))
    parser.add_argument(
        '--max-results', type=int, default=0,
        help=('The maximum number of subscriptions that this'
              ' command may return. This option is ignored'
              ' if --name-filter is set.'))

  @util.MapHttpError
  def Run(self, args):
    """This is what gets called when the user runs this command.

    Args:
      args: an argparse namespace. All the arguments that were provided to this
        command invocation.

    Yields:
      Subscription paths that match the regular expression in args.name_filter.

    Raises:
      sdk_ex.HttpException if there is an error with the regular
      expression syntax.
    """
    msgs = self.context['pubsub_msgs']
    pubsub = self.context['pubsub']

    page_token = None
    subscriptions_listed = 0
    should_truncate_res = args.max_results and not args.name_filter

    try:
      while True:
        list_subscriptions_req = msgs.PubsubProjectsSubscriptionsListRequest(
            project=util.ProjectFormat(),
            pageToken=page_token)

        if should_truncate_res:
          list_subscriptions_req.pageSize = min(args.max_results,
                                                util.MAX_LIST_RESULTS)

        list_subscriptions_response = pubsub.projects_subscriptions.List(
            list_subscriptions_req)

        for subscription in list_subscriptions_response.subscriptions:
          if not util.SubscriptionMatches(subscription.name, args.name_filter):
            continue

          # If max_results > 0 and we have already sent that
          # amount of subscriptions, just raise (StopIteration) iff name_filter
          # is not set, else this limit wouldn't make sense.
          if should_truncate_res and subscriptions_listed >= args.max_results:
            raise StopIteration()

          subscriptions_listed += 1
          yield subscription

        page_token = list_subscriptions_response.nextPageToken
        if not page_token:
          break

    except re.error as e:
      raise sdk_ex.HttpException(str(e))

  def Display(self, args, result):
    """This method is called to print the result of the Run() method.

    Args:
      args: The arguments that command was run with.
      result: The value returned from the Run() method.
    """
    tbl = io.TablePrinter(
        ['SUBSCRIPTION', 'TYPE', 'ACK DEADLINE'],
        justification=tuple(
            [io.TablePrinter.JUSTIFY_LEFT] * 3))

    tbl.Print(
        [TableValues(subscription) for subscription in result])

def TableValues(subscription):
  """Converts a Subscription into a tuple of column values."""

  type_ = 'PULL'
  if subscription.pushConfig.pushEndpoint:
    type_ = 'PUSH'
  return (subscription.name, type_, str(subscription.ackDeadlineSeconds))


text:
Wit.ai php demo
===============

This is an interactive demo using the [tgallice/wit-php][1] sdk.

- You should create a [wit.ai][2] account before run the demo.
- Make sure to install dependencies with composer before
running the demo.

All these demos are built with the [symfony/console][3] component and should be used with a CLI.

Install
-------
```bash

$ git clone git@github.com:tgallice/wit-php-example.git
$ cd wit-php-example
$ composer install

```

Quickstart demo
---------------

It's based on the quickstart tutorial of wit.ai which can be found [here][4]

```bash
$ php demo.php wit:quickstart <access_token>
>>> What is the weather ?
+ Action : getForecast
+++ Where exactly?
>>> In London
+ Action : getForecast
+ Entities provided:
{
    "location": [
        {
            "confidence": 0.99930685842002,
            "type": "value",
            "value": "London",
            "suggested": true
        }
    ]
}

+ Say : The weather will be sunny in London
+++ The weather will be sunny in London
+ Stop

```

Intent by text
--------------

This command provides an easy way to extract meaning based on message input.

```bash
$ php demo.php wit:message <access_token>
>>> I live in London
+ Response body :
{
    "msg_id": "e8cca629-cf2a-445a-b1c8-7bd1d569330e",
    "_text": "I live in London",
    "entities": {
        "location": [
            {
                "confidence": 0.99984823481825,
                "type": "value",
                "value": "London",
                "suggested": true
            }
        ]
    }
}
>>>

```

Intent by speech
----------------

You can test to extract meaning by speech. A sample is provided, but you can use your own.

```bash
$ php demo.php wit:speech <access_token>
File path >>> sample/sample.mp3
+ Please wait...
+ Response body :
{
    "msg_id": "702657bc-5672-444e-a0cc-5a673306aa8b",
    "_text": "hello i live in london",
    "entities": {
        "location": [
            {
                "confidence": 0.99984823481825,
                "type": "value",
                "value": "london",
                "suggested": true
            }
        ]
    }
}
File path >>>

```

[1]: https://github.com/tgallice/wit-php
[2]: https://wit.ai/
[3]: http://symfony.com/doc/current/components/console/introduction.html
[4]: https://wit.ai/docs/quickstart


text:
package com.sgota.tkcg;

import org.slf4j.Logger;
import org.slf4j.impl.StaticLoggerBinder;

/**
 * @author tiankuo
 */
public class TkcgCmdLog extends TkcgLog {

    private static TkcgCmdLog service = new TkcgCmdLog();
    private Logger logger = StaticLoggerBinder.getSingleton().getLoggerFactory().getLogger(Logger.ROOT_LOGGER_NAME);

    /**
     * constructor
     */
    private TkcgCmdLog(){
        // private
    }

    public static void register() {
        TkcgLog.log = service;
    }

    @Override
    public void internalInfo(String message) {
        logger.info(message);
    }

    @Override
    public void internalError(String message) {
        logger.error(message);
    }
}


text:
layout: post
title: Create an ".EBextensions" Folder on Windows
permalink: create-an-ebextensions-folder-on-windows
date: '2015-05-11 19:29:03'
tags: [Tips, Elastic Beanstalk, Development]
cover: http://assets.boringgeek.com/imacSceneryReduced.jpg
description: "Hidden folder that start with a period are common on Linux, but not on Windows.  Here's how to create an .ebextensions folder for use with Elastic Beanstalk"
comments: true
---

I have a number of Linux-based applications that have been using the .ebextensions functionality of Elastic Beanstalk for quite some time. Its a great way of managing the configuration of your environments and running tasks both pre and post-deploy. However, one of my current projects is a C# .NET app and it took me a while to remember how to create a folder in Windows with a leading (.) period.  It seems so trivial, but, honestly, I can't recall the last time I've had to do it - chances are many of you can't either.

So here it is in all of its strange simplicity:

<code>.ebextensions.</code>

Yes, you're seeing that correctly - simply add a trailing (.) period and Windows will create the folder and remove the trailing period.

Enjoy!


text:
!DOCTYPE html>
        {% autoescape true %}

    <title>Chapman University Game Development | {{ titleDesc }}</title>
    <meta property="og:image" content="images/favicon.png" />
    <meta content="width=device-width, initial-scale=1, minimum-scale=1" name="viewport"/>
    <link type="text/css" rel="stylesheet" href="/bootstrap/css/bootstrap.css"  media="screen"/>

 {% include 'templates/navbar.html' %}

New User Signup

Please enter in all the required fields!

Once complete, the submitted application will be reviewed by the instructor. If approved, you will automatically be given access to the class.

        <form id="characterInfo" action="/signup" method="post">

Student Name: <input style="margin-bottom: 0px" class="input-large" name="fullName" type="text" placeholder="Samus Aran">

Nickname: <input style="margin-bottom: 0px" class="input-large" name="nickname" type="text" placeholder="MetroidKiller227">

Student Image URL: <input style="margin-bottom: 0px" class="input-xlarge" id="imgURL" name="imageURL" type="text" placeholder="http://i.imgur.com/gOhQSGd.jpg"><button class="btn btn-info btn-mini" onclick="PreviewImage(document.getElementById('imgURL').value, 'preview');" type=button>Preview</button>

Enrolled Course:
                <select id="selectedCourse" name="selectedCourse" style="margin-bottom: 0px" class="input-xxlarge" form="characterInfo">
                    {% if allCourses %}
                    {% for course in allCourses %}
                        <option value="{{course.key.integer_id()}}">{{course.courseNumber}}-{{course.courseName}}</option>
                    {% endfor %}
                    {% endif %}
                </select>

                <input type="submit" class="btn btn-warning btn-large" value="Submit!">

        </form>

        {% endautoescape %}


text:
package graval

import (
	"fmt"
	"github.com/jehiah/go-strftime"
	"regexp"
	"strconv"
	"strings"
)

type ftpCommand interface {
	RequireParam() bool
	RequireAuth() bool
	Execute(*ftpConn, string)
}

type commandMap map[string]ftpCommand

var (
	commands = commandMap{
		"ALLO": commandAllo{},
		"CDUP": commandCdup{},
		"CWD":  commandCwd{},
		"DELE": commandDele{},
		"EPRT": commandEprt{},
		"EPSV": commandEpsv{},
		"FEAT": commandFeat{},
		"LIST": commandList{},
		"NLST": commandNlst{},
		"MDTM": commandMdtm{},
		"MKD":  commandMkd{},
		"MODE": commandMode{},
		"NOOP": commandNoop{},
		"OPTS": commandOpts{},
		"PASS": commandPass{},
		"PASV": commandPasv{},
		"PORT": commandPort{},
		"PWD":  commandPwd{},
		"QUIT": commandQuit{},
		"RETR": commandRetr{},
		"RNFR": commandRnfr{},
		"RNTO": commandRnto{},
		"RMD":  commandRmd{},
		"SIZE": commandSize{},
		"STOR": commandStor{},
		"STRU": commandStru{},
		"SYST": commandSyst{},
		"TYPE": commandType{},
		"USER": commandUser{},
		"XCUP": commandCdup{},
		"XCWD": commandCwd{},
		"XPWD": commandPwd{},
		"XRMD": commandRmd{},
	}

	// Some FTP clients send flags to the LIST and NLST commands. Server support for these varies,
	// and implementing them all would be a lot of work with uncertain payoff. For now, we ignore them
	listFlagsRegexp = `^-[alt]+$`
)

// commandAllo responds to the ALLO FTP command.
//
// This is essentially a ping from the client so we just respond with an
// basic OK message.
type commandAllo struct{}

func (cmd commandAllo) RequireParam() bool {
	return false
}

func (cmd commandAllo) RequireAuth() bool {
	return false
}

func (cmd commandAllo) Execute(conn *ftpConn, param string) {
	conn.writeMessage(202, "Obsolete")
}

// commandCdup responds to the CDUP FTP command.
//
// Allows the client change their current directory to the parent.
type commandCdup struct{}

func (cmd commandCdup) RequireParam() bool {
	return false
}

func (cmd commandCdup) RequireAuth() bool {
	return true
}

func (cmd commandCdup) Execute(conn *ftpConn, param string) {
	otherCmd := &commandCwd{}
	otherCmd.Execute(conn, "..")
}

// commandCwd responds to the CWD FTP command. It allows the client to change the
// current working directory.
type commandCwd struct{}

func (cmd commandCwd) RequireParam() bool {
	return true
}

func (cmd commandCwd) RequireAuth() bool {
	return true
}

func (cmd commandCwd) Execute(conn *ftpConn, param string) {
	path := conn.buildPath(param)
	if conn.driver.ChangeDir(path) {
		conn.namePrefix = path
		conn.writeMessage(250, "Directory changed to "+path)
	} else {
		conn.writeMessage(550, "Action not taken")
	}
}

// commandDele responds to the DELE FTP command. It allows the client to delete
// a file
type commandDele struct{}

func (cmd commandDele) RequireParam() bool {
	return true
}

func (cmd commandDele) RequireAuth() bool {
	return true
}

func (cmd commandDele) Execute(conn *ftpConn, param string) {
	path := conn.buildPath(param)
	if conn.driver.DeleteFile(path) {
		conn.writeMessage(250, "File deleted")
	} else {
		conn.writeMessage(550, "Action not taken")
	}
}

// commandEprt responds to the EPRT FTP command. It allows the client to
// request an active data socket with more options than the original PORT
// command. It mainly adds ipv6 support.
type commandEprt struct{}

func (cmd commandEprt) RequireParam() bool {
	return true
}

func (cmd commandEprt) RequireAuth() bool {
	return true
}

func (cmd commandEprt) Execute(conn *ftpConn, param string) {
	delim := string(param[0:1])
	parts := strings.Split(param, delim)
	addressFamily, err := strconv.Atoi(parts[1])
	host := parts[2]
	port, err := strconv.Atoi(parts[3])

	if addressFamily != 1 && addressFamily != 2 {
		conn.writeMessage(522, "Network protocol not supported, use (1,2)")
		return
	}

	_, err = conn.newActiveSocket(host, port)

	if err != nil {
		conn.writeMessage(425, "Data connection failed")
		return
	}
	conn.writeMessage(200, fmt.Sprintf("Connection established (%d)", port))
}

// commandEpsv responds to the EPSV FTP command. It allows the client to
// request a passive data socket with more options than the original PASV
// command. It mainly adds ipv6 support, although we don't support that yet.
type commandEpsv struct{}

func (cmd commandEpsv) RequireParam() bool {
	return false
}

func (cmd commandEpsv) RequireAuth() bool {
	return true
}

func (cmd commandEpsv) Execute(conn *ftpConn, param string) {
	socket, err := conn.newPassiveSocket()
	if err != nil {
		conn.writeMessage(425, "Data connection failed")
		return
	}
	msg := fmt.Sprintf("Entering Extended Passive Mode (|||%d|)", socket.Port())
	conn.writeMessage(229, msg)
}

// commandFeat responds to the FEAT FTP command.
//
// List all new features supported as defined in RFC-2398.
type commandFeat struct{}

func (cmd commandFeat) RequireParam() bool {
	return false
}

func (cmd commandFeat) RequireAuth() bool {
	return false
}

func (cmd commandFeat) Execute(conn *ftpConn, param string) {
	conn.writeLines(211,
		"211-Features supported:",
		" EPRT",
		" EPSV",
		" MDTM",
		" SIZE",
		" UTF8",
		"211 End FEAT.",
	)
}

// commandList responds to the LIST FTP command. It allows the client to retreive
// a detailed listing of the contents of a directory.
type commandList struct{}

func (cmd commandList) RequireParam() bool {
	return false
}

func (cmd commandList) RequireAuth() bool {
	return true
}

func (cmd commandList) Execute(conn *ftpConn, param string) {
	conn.writeMessage(150, "Opening ASCII mode data connection for file list")
	matched, _ := regexp.MatchString(listFlagsRegexp, param)
	if matched {
		param = ""
	}
	path := conn.buildPath(param)
	files := conn.driver.DirContents(path)
	formatter := newListFormatter(files)
	conn.sendOutofbandData(formatter.Detailed())
}

// commandNlst responds to the NLST FTP command. It allows the client to
// retreive a list of filenames in the current directory.
type commandNlst struct{}

func (cmd commandNlst) RequireParam() bool {
	return false
}

func (cmd commandNlst) RequireAuth() bool {
	return true
}

func (cmd commandNlst) Execute(conn *ftpConn, param string) {
	conn.writeMessage(150, "Opening ASCII mode data connection for file list")
	matched, _ := regexp.MatchString(listFlagsRegexp, param)
	if matched {
		param = ""
	}
	path := conn.buildPath(param)
	files := conn.driver.DirContents(path)
	formatter := newListFormatter(files)
	conn.sendOutofbandData(formatter.Short())
}

// commandMdtm responds to the MDTM FTP command. It allows the client to
// retreive the last modified time of a file.
type commandMdtm struct{}

func (cmd commandMdtm) RequireParam() bool {
	return true
}

func (cmd commandMdtm) RequireAuth() bool {
	return true
}

func (cmd commandMdtm) Execute(conn *ftpConn, param string) {
	path := conn.buildPath(param)
	time, err := conn.driver.ModifiedTime(path)
	if err == nil {
		conn.writeMessage(213, strftime.Format("%Y%m%d%H%M%S", time))
	} else {
		conn.writeMessage(450, "File not available")
	}
}

// commandMkd responds to the MKD FTP command. It allows the client to create
// a new directory
type commandMkd struct{}

func (cmd commandMkd) RequireParam() bool {
	return true
}

func (cmd commandMkd) RequireAuth() bool {
	return true
}

func (cmd commandMkd) Execute(conn *ftpConn, param string) {
	path := conn.buildPath(param)
	if conn.driver.MakeDir(path) {
		conn.writeMessage(257, "Directory created")
	} else {
		conn.writeMessage(550, "Action not taken")
	}
}

// commandMode responds to the MODE FTP command.
//
// the original FTP spec had various options for hosts to negotiate how data
// would be sent over the data socket, In reality these days (S)tream mode
// is all that is used for the mode - data is just streamed down the data
// socket unchanged.
type commandMode struct{}

func (cmd commandMode) RequireParam() bool {
	return true
}

func (cmd commandMode) RequireAuth() bool {
	return true
}

func (cmd commandMode) Execute(conn *ftpConn, param string) {
	if strings.ToUpper(param) == "S" {
		conn.writeMessage(200, "OK")
	} else {
		conn.writeMessage(504, "MODE is an obsolete command")
	}
}

// commandNoop responds to the NOOP FTP command.
//
// This is essentially a ping from the client so we just respond with an
// basic 200 message.
type commandNoop struct{}

func (cmd commandNoop) RequireParam() bool {
	return false
}

func (cmd commandNoop) RequireAuth() bool {
	return false
}

func (cmd commandNoop) Execute(conn *ftpConn, param string) {
	conn.writeMessage(200, "OK")
}

// commandOpts responds to the OPTS FTP command.
//
// This is essentially a ping from the client so we just respond with an
// basic 200 message.
type commandOpts struct{}

func (cmd commandOpts) RequireParam() bool {
	return false
}

func (cmd commandOpts) RequireAuth() bool {
	return true
}

func (cmd commandOpts) Execute(conn *ftpConn, param string) {
	if param == "UTF8 ON" || param == "UTF8" {
		conn.writeMessage(200, "OK")
		return
	}

	conn.writeMessage(500, "Command not found")
}

// commandPass respond to the PASS FTP command by asking the driver if the
// supplied username and password are valid
type commandPass struct{}

func (cmd commandPass) RequireParam() bool {
	return true
}

func (cmd commandPass) RequireAuth() bool {
	return false
}

func (cmd commandPass) Execute(conn *ftpConn, param string) {
	if conn.driver.Authenticate(conn.reqUser, param) {
		conn.user = conn.reqUser
		conn.reqUser = ""
		conn.writeMessage(230, "Password ok, continue")
	} else {
		conn.writeMessage(530, "Incorrect password, not logged in")
		conn.writeMessage(221, "Goodbye.")
		conn.Close()
	}
}

// commandPasv responds to the PASV FTP command.
//
// The client is requesting us to open a new TCP listing socket and wait for them
// to connect to it.
type commandPasv struct{}

func (cmd commandPasv) RequireParam() bool {
	return false
}

func (cmd commandPasv) RequireAuth() bool {
	return true
}

func (cmd commandPasv) Execute(conn *ftpConn, param string) {
	socket, err := conn.newPassiveSocket()
	if err != nil {
		conn.writeMessage(425, "Data connection failed")
		return
	}

	p1 := socket.Port() / 256
	p2 := socket.Port() - (p1 * 256)

	// if the server has been configured to send a specific IP for clients to connect to, use it. Otherwise
	// fallback to the IP that the passive port is listening on
	host := conn.pasvAdvertisedIp
	if host == "" {
		host = socket.Host()
	}
	quads := strings.Split(host, ".")
	target := fmt.Sprintf("(%s,%s,%s,%s,%d,%d)", quads[0], quads[1], quads[2], quads[3], p1, p2)
	msg := "Entering Passive Mode " + target
	conn.writeMessage(227, msg)
}

// commandPort responds to the PORT FTP command.
//
// The client has opened a listening socket for sending out of band data and
// is requesting that we connect to it
type commandPort struct{}

func (cmd commandPort) RequireParam() bool {
	return true
}

func (cmd commandPort) RequireAuth() bool {
	return true
}

func (cmd commandPort) Execute(conn *ftpConn, param string) {
	nums := strings.Split(param, ",")
	portOne, _ := strconv.Atoi(nums[4])
	portTwo, _ := strconv.Atoi(nums[5])
	port := (portOne * 256) + portTwo
	host := nums[0] + "." + nums[1] + "." + nums[2] + "." + nums[3]

	_, err := conn.newActiveSocket(host, port)

	if err != nil {
		conn.writeMessage(425, "Data connection failed")
		return
	}
	conn.writeMessage(200, fmt.Sprintf("Connection established (%d)", port))
}

// commandPwd responds to the PWD FTP command.
//
// Tells the client what the current working directory is.
type commandPwd struct{}

func (cmd commandPwd) RequireParam() bool {
	return false
}

func (cmd commandPwd) RequireAuth() bool {
	return true
}

func (cmd commandPwd) Execute(conn *ftpConn, param string) {
	conn.writeMessage(257, "\""+conn.namePrefix+"\" is the current directory")
}

// CommandQuit responds to the QUIT FTP command. The client has requested the
// connection be closed.
type commandQuit struct{}

func (cmd commandQuit) RequireParam() bool {
	return false
}

func (cmd commandQuit) RequireAuth() bool {
	return false
}

func (cmd commandQuit) Execute(conn *ftpConn, param string) {
	conn.Close()
}

// commandRetr responds to the RETR FTP command. It allows the client to
// download a file.
type commandRetr struct{}

func (cmd commandRetr) RequireParam() bool {
	return true
}

func (cmd commandRetr) RequireAuth() bool {
	return true
}

func (cmd commandRetr) Execute(conn *ftpConn, param string) {
	path := conn.buildPath(param)
	reader, err := conn.driver.GetFile(path)
	if err == nil {
		defer reader.Close()
		conn.writeMessage(150, "Data connection open. Transfer starting.")
		conn.sendOutofbandReader(reader)
	} else {
		conn.writeMessage(551, "File not available")
	}
}

// commandRnfr responds to the RNFR FTP command. It's the first of two commands
// required for a client to rename a file.
type commandRnfr struct{}

func (cmd commandRnfr) RequireParam() bool {
	return true
}

func (cmd commandRnfr) RequireAuth() bool {
	return true
}

func (cmd commandRnfr) Execute(conn *ftpConn, param string) {
	conn.renameFrom = conn.buildPath(param)
	conn.writeMessage(350, "Requested file action pending further information.")
}

// commandRnto responds to the RNTO FTP command. It's the second of two commands
// required for a client to rename a file.
type commandRnto struct{}

func (cmd commandRnto) RequireParam() bool {
	return true
}

func (cmd commandRnto) RequireAuth() bool {
	return true
}

func (cmd commandRnto) Execute(conn *ftpConn, param string) {
	if conn.renameFrom == "" {
		conn.writeMessage(503, "Bad sequence of commands: use RNFR first.")
		return
	}

	toPath := conn.buildPath(param)
	if conn.driver.Rename(conn.renameFrom, toPath) {
		conn.writeMessage(250, "File renamed")
	} else {
		conn.writeMessage(550, "Action not taken")
	}
}

// commandRmd responds to the RMD FTP command. It allows the client to delete a
// directory.
type commandRmd struct{}

func (cmd commandRmd) RequireParam() bool {
	return true
}

func (cmd commandRmd) RequireAuth() bool {
	return true
}

func (cmd commandRmd) Execute(conn *ftpConn, param string) {
	path := conn.buildPath(param)
	if conn.driver.DeleteDir(path) {
		conn.writeMessage(250, "Directory deleted")
	} else {
		conn.writeMessage(550, "Action not taken")
	}
}

// commandSize responds to the SIZE FTP command. It returns the size of the
// requested path in bytes.
type commandSize struct{}

func (cmd commandSize) RequireParam() bool {
	return true
}

func (cmd commandSize) RequireAuth() bool {
	return true
}

func (cmd commandSize) Execute(conn *ftpConn, param string) {
	path := conn.buildPath(param)
	bytes := conn.driver.Bytes(path)
	if bytes >= 0 {
		conn.writeMessage(213, fmt.Sprintf("%d", bytes))
	} else {
		conn.writeMessage(450, "file not available")
	}
}

// commandStor responds to the STOR FTP command. It allows the user to upload a
// new file.
type commandStor struct{}

func (cmd commandStor) RequireParam() bool {
	return true
}

func (cmd commandStor) RequireAuth() bool {
	return true
}

func (cmd commandStor) Execute(conn *ftpConn, param string) {
	targetPath := conn.buildPath(param)
	conn.writeMessage(150, "Data transfer starting")
	if ok := conn.driver.PutFile(targetPath, conn.dataConn); ok {
		conn.writeMessage(226, "Transfer complete.")
	} else {
		conn.writeMessage(450, "error during transfer")
	}
}

// commandStru responds to the STRU FTP command.
//
// like the MODE and TYPE commands, stru[cture] dates back to a time when the
// FTP protocol was more aware of the content of the files it was transferring,
// and would sometimes be expected to translate things like EOL markers on the
// fly.
//
// These days files are sent unmodified, and F(ile) mode is the only one we
// really need to support.
type commandStru struct{}

func (cmd commandStru) RequireParam() bool {
	return true
}

func (cmd commandStru) RequireAuth() bool {
	return true
}

func (cmd commandStru) Execute(conn *ftpConn, param string) {
	if strings.ToUpper(param) == "F" {
		conn.writeMessage(200, "OK")
	} else {
		conn.writeMessage(504, "STRU is an obsolete command")
	}
}

// commandSyst responds to the SYST FTP command by providing a canned response.
type commandSyst struct{}

func (cmd commandSyst) RequireParam() bool {
	return false
}

func (cmd commandSyst) RequireAuth() bool {
	return true
}

func (cmd commandSyst) Execute(conn *ftpConn, param string) {
	conn.writeMessage(215, "UNIX Type: L8")
}

// commandType responds to the TYPE FTP command.
//
//  like the MODE and STRU commands, TYPE dates back to a time when the FTP
//  protocol was more aware of the content of the files it was transferring, and
//  would sometimes be expected to translate things like EOL markers on the fly.
//
//  Valid options were A(SCII), I(mage), E(BCDIC) or LN (for local type). Since
//  we plan to just accept bytes from the client unchanged, I think Image mode is
//  adequate. The RFC requires we accept ASCII mode however, so accept it, but
//  ignore it.
type commandType struct{}

func (cmd commandType) RequireParam() bool {
	return false
}

func (cmd commandType) RequireAuth() bool {
	return true
}

func (cmd commandType) Execute(conn *ftpConn, param string) {
	if strings.ToUpper(param) == "A" {
		conn.writeMessage(200, "Type set to ASCII")
	} else if strings.ToUpper(param) == "I" {
		conn.writeMessage(200, "Type set to binary")
	} else {
		conn.writeMessage(500, "Invalid type")
	}
}

// commandUser responds to the USER FTP command by asking for the password
type commandUser struct{}

func (cmd commandUser) RequireParam() bool {
	return true
}

func (cmd commandUser) RequireAuth() bool {
	return false
}

func (cmd commandUser) Execute(conn *ftpConn, param string) {
	conn.reqUser = param
	conn.writeMessage(331, "User name ok, password required")
}


text:
<?php

class Api_Login_Model extends CI_Model {

	public function insert_api_info($userProfile,$id){
		$unique_id = $this->get_user_details($id);

		if($unique_id != $userProfile['api_id']){
			$this->db->insert('tbl_users', $userProfile);
		} else {
			echo "user already saved in db";
		}
	}

	public function get_user_details($id){
		$options =  array(
			'api_id' => $id,
			);
		$this->db->where($options);
		$data = $this->db->get("tbl_users")->row_array();
		return $data['api_id'];
	}

}
?>


text:
<?php

/**
 * Nederlandse vertaling van de berichten (utf8 encoded!)
 *
 * @author Toon Van de Putte (gebaseerd op Robert de Ruiter)
 */

// line 45 in phpfreechatconfig.class.php
$GLOBALS["i18n"]["My Chat"] = "Mijn chat";

// line 201 in phpfreechatconfig.class.php
$GLOBALS["i18n"]["%s not found, %s library can't be found."] = "%s niet gevonden, %s bestand niet gevonden.";

// line 355 in phpfreechat.class.php
$GLOBALS["i18n"]["Please enter your nickname"] = "Vul hier een nickname in";

// line 565 in phpfreechat.class.php
$GLOBALS["i18n"]["Text cannot be empty"] = "Tekstvak kan niet leeg zijn";

// line 392 in phpfreechat.class.php
$GLOBALS["i18n"]["%s changes his nickname to %s"] = "%s verandert de nickname in %s";

// line 398 in phpfreechat.class.php
$GLOBALS["i18n"]["%s is connected"] = "%s is verbonden";

// line 452 in phpfreechat.class.php
$GLOBALS["i18n"]["%s quit"] = "%s stop";

// line 468 in phpfreechat.class.php
$GLOBALS["i18n"]["%s disconnected (timeout)"] = "%s niet verbonden (timeout)";

// line 262 in phpfreechat.class.php
$GLOBALS["i18n"]["Unknown command [%s]"] = "Onbekende opdracht [%s]";

// line 149 in phpfreechatconfig.class.php
$GLOBALS["i18n"]["%s doesn't exist: %s"] = "%s bestaat niet: %s";

// line 180 in phpfreechatconfig.class.php
$GLOBALS["i18n"]["You need %s"] = "Je hebt nodig %s";

// line 241 in phpfreechatconfig.class.php
$GLOBALS["i18n"]["%s doesn't exist, %s library can't be found"] = "%s bestaat niet, %s bestand niet gevonden";

// line 280 in phpfreechatconfig.class.php
$GLOBALS["i18n"]["%s doesn't exist"] = "%s bestaat niet";

// line 433 in phpfreechatconfig.class.php
$GLOBALS["i18n"]["%s directory must be specified"] = "%s geef de directory aan";

// line 439 in phpfreechatconfig.class.php
$GLOBALS["i18n"]["%s must be a directory"] = "%s moet een directory zijn";

// line 446 in phpfreechatconfig.class.php
$GLOBALS["i18n"]["%s can't be created"] = "%s kan niet worden gemaakt";

// line 451 in phpfreechatconfig.class.php
$GLOBALS["i18n"]["%s is not writeable"] = "%s kan niet worden beschreven";

// line 496 in phpfreechatconfig.class.php
$GLOBALS["i18n"]["%s is not readable"] = "%s is niet leesbaar";

// line 469 in phpfreechatconfig.class.php
$GLOBALS["i18n"]["%s is not a file"] = "%s is geen bestand";

// line 491 in phpfreechatconfig.class.php
$GLOBALS["i18n"]["%s is not a directory"] = "%s is geen directory";

// line 23 in chat.html.tpl.php
$GLOBALS["i18n"]["PHP FREE CHAT [powered by phpFreeChat-%s]"] = "PHP FREE CHAT [powered by phpFreeChat-%s]";

// line 296 in javascript1.js.tpl.php
$GLOBALS["i18n"]["Hide nickname marker"] = "Geen gekleurde nicknames";

// line 304 in javascript1.js.tpl.php
$GLOBALS["i18n"]["Show nickname marker"] = "Toon gekleurde nicknames";

// line 389 in javascript1.js.tpl.php
$GLOBALS["i18n"]["Disconnect"] = "Verbreek verbinding";

// line 395 in javascript1.js.tpl.php
$GLOBALS["i18n"]["Connect"] = "Maak contact";

// line 427 in javascript1.js.tpl.php
$GLOBALS["i18n"]["Magnify"] = "Vergroot";

// line 434 in javascript1.js.tpl.php
$GLOBALS["i18n"]["Cut down"] = "Verklein";

// line 345 in javascript1.js.tpl.php
$GLOBALS["i18n"]["Hide dates and hours"] = "Verberg data en tijd";

// line 353 in javascript1.js.tpl.php
$GLOBALS["i18n"]["Show dates and hours"] = "Toon data en tijd";

// line 21 in chat.html.tpl.php
$GLOBALS["i18n"]["Enter your message here"] = "Voer hier je bericht in";

// line 24 in chat.html.tpl.php
$GLOBALS["i18n"]["Enter your nickname here"] = "Voer hier je nickname in";

// line 93 in phpfreechatconfig.class.php
$GLOBALS["i18n"]["Error: undefined or obsolete parameter '%s', please correct or remove this parameter"] = "Fout: niet-gedefinieerde of lege parameter '%s', verbeter of verwijder deze parameter";

// line 86 in pfcclient.js.tpl.php
$GLOBALS["i18n"]["Hide smiley box"] = "Verberg smiley venster";

// line 87 in pfcclient.js.tpl.php
$GLOBALS["i18n"]["Show smiley box"] = "Toon smiley venster";

// line 88 in pfcclient.js.tpl.php
$GLOBALS["i18n"]["Hide online users box"] = "Verberg online venster";

// line 89 in pfcclient.js.tpl.php
$GLOBALS["i18n"]["Show online users box"] = "Toon online venster";

// line 33 in chat.html.tpl.php
$GLOBALS["i18n"]["Bold"] = "Vet";

// line 34 in chat.html.tpl.php
$GLOBALS["i18n"]["Italics"] = "Cursief";

// line 35 in chat.html.tpl.php
$GLOBALS["i18n"]["Underline"] = "Onderstreept";

// line 36 in chat.html.tpl.php
$GLOBALS["i18n"]["Delete"] = "Verwijder";

// line 37 in chat.html.tpl.php
$GLOBALS["i18n"]["Pre"] = "Pre";

// line 38 in chat.html.tpl.php
$GLOBALS["i18n"]["Mail"] = "Mail";

// line 39 in chat.html.tpl.php
$GLOBALS["i18n"]["Color"] = "Kleur";

// line 48 in phpfreechattemplate.class.php
$GLOBALS["i18n"]["%s template could not be found"] = "%s template niet gevonden";

// line 512 in phpfreechatconfig.class.php
$GLOBALS["i18n"]["Error: '%s' could not be found, please check your themepath '%s' and your theme '%s' are correct"] = "Fout: '%s' kan niet worden gevonden, controleer het pad naar thema '%s' en uw thema '%s' is correct";

// line 75 in pfccommand.class.php
$GLOBALS["i18n"]["%s must be implemented"] = "%s moet worden geïmplementeerd";

// line 343 in phpfreechatconfig.class.php
$GLOBALS["i18n"]["'%s' parameter is mandatory by default use '%s' value"] = "'%s' parameter is verplicht bij standaard gebruik '%s' waarde";

// line 378 in phpfreechatconfig.class.php
$GLOBALS["i18n"]["'%s' parameter must be a positive number"] = "'%s' parameter moet een positief getal zijn";

// line 386 in phpfreechatconfig.class.php
$GLOBALS["i18n"]["'%s' parameter is not valid. Available values are : '%s'"] = "'%s' parameter is niet geldig. Beschikbare waarden zijn: '%s'";

// line 186 in pfcglobalconfig.class.php
$GLOBALS["i18n"]["My room"] = "Mijn Kamer";

// line 19 in unban.class.php
$GLOBALS["i18n"]["Missing parameter"] = "Deze parameter ontbreekt";

// line 38 in ban.class.php
$GLOBALS["i18n"]["banished from %s by %s"] = "verbannen uit %s door %s";

// line 23 in banlist.class.php
$GLOBALS["i18n"]["The banished user's id list is:"] = "De id-lijst van de verbannen gebruiker is:";

// line 32 in banlist.class.php
$GLOBALS["i18n"]["Empty"] = "Leeg";

// line 34 in banlist.class.php
$GLOBALS["i18n"]["'/unban {id}' will unban the user identified by {id}"] = "'/unban {id}' maakt de verbanning van gebruiker {id} ongedaan";

// line 35 in banlist.class.php
$GLOBALS["i18n"]["'/unban all'  will unban all the users on this channel"] = "'/unban all' maakt alle verbanningen in dit kanaal ongedaan";

// line 24 in update.class.php
$GLOBALS["i18n"]["%s quit (timeout)"] = "%s is vertrokken (timeout)";

// line 46 in join.class.php
$GLOBALS["i18n"]["%s joins %s"] = "%s komt binnen in %s";

// line 31 in kick.class.php
$GLOBALS["i18n"]["kicked from %s by %s"] = "gekickt uit %s door %s";

// line 38 in send.class.php
$GLOBALS["i18n"]["Can't send the message, %s is offline"] = "Kan de boodschap niet versturen, % is offline";

// line 27 in unban.class.php
$GLOBALS["i18n"]["Nobody has been unbanished"] = "Geen enkele verbanning werd ongedaan gemaakt";

// line 42 in unban.class.php
$GLOBALS["i18n"]["%s has been unbanished"] = "% is niet langer verbannen";

// line 49 in unban.class.php
$GLOBALS["i18n"]["%s users have been unbanished"] = "%s gebruikers zijn niet langer verbannen";

// line 47 in auth.class.php
$GLOBALS["i18n"]["You are not allowed to run '%s' command"] = "Je hebt geen toelating om het commando '%s' uit te voeren";

// line 66 in auth.class.php
$GLOBALS["i18n"]["Can't join %s because you are banished"] = "Kan niet in %s omdat je verbannen bent";

// line 76 in auth.class.php
$GLOBALS["i18n"]["Can't join %s because the channels list is restricted"] = "Kan niet in %s omdat de kanalenlijst beperkt is";

// line 89 in auth.class.php
$GLOBALS["i18n"]["You are not allowed to change your nickname"] = "Je mag je nickname niet veranderen";

// line 56 in noflood.class.php
$GLOBALS["i18n"]["Please don't post so many message, flood is not tolerated"] = "Niet zo veel berichten plaatsen, flooden is niet toegelaten";

// line 109 in pfcclient.js.tpl.php
$GLOBALS["i18n"]["Private message"] = "Privé-bericht";

// line 110 in pfcclient.js.tpl.php
$GLOBALS["i18n"]["Close this tab"] = "Sluit deze tab";

// line 199 in pfcgui.js.tpl.php
$GLOBALS["i18n"]["Do you really want to leave this room ?"] = "Wil je echt vertrekken uit deze kamer?";

// line 169 in pfcglobalconfig.class.php
$GLOBALS["i18n"]["Error: '%s' is a private parameter, you are not allowed to change it"] = "Fout: '%s' is een private parameter, je mag die niet veranderen";

// line 253 in pfcglobalconfig.class.php
$GLOBALS["i18n"]["'%s' parameter must be an array"] = "'%s' parameter moet een array zijn";

// line 265 in pfcglobalconfig.class.php
$GLOBALS["i18n"]["'%s' parameter must be a boolean"] = "'%s' parameter moet een boolean zijn";

// line 271 in pfcglobalconfig.class.php
$GLOBALS["i18n"]["'%s' parameter must be a charatere string"] = "'%s' moet een charactere string zijn";

// line 395 in pfcglobalconfig.class.php
$GLOBALS["i18n"]["'%s' must be writable"] = "'%s' moet schrijfbaar zijn";

// line 425 in pfcglobalconfig.class.php
$GLOBALS["i18n"]["'%s' directory doesn't exist"] = "'%s' directory bestaat niet";

// line 544 in pfcglobalconfig.class.php
$GLOBALS["i18n"]["Please correct these errors"] = "Pas deze fouten aan";

// line 21 in pfcinfo.class.php
$GLOBALS["i18n"]["Error: the cached config file doesn't exists"] = "Fout: het gebufferde configuratiebestand bestaat niet";

// line 190 in phpfreechat.class.php
$GLOBALS["i18n"]["Error: the chat cannot be loaded! two possibilities: your browser doesn't support javascript or you didn't setup correctly the server directories rights - don't hesitate to ask some help on the forum"] = "Error: de chat kan niet geladen worden! Twee mogelijkheden: je browser ondersteunt geen javascript of de chat staat fout ingesteld. Mail naar webmaster@yeti.be";

// line 31 in help.class.php
$GLOBALS["i18n"]["Here is the command list:"] = "Dit is de lijst met commando's:";

// line 63 in identify.class.php
$GLOBALS["i18n"]["Succesfully identified"] = "Identificatie succesvol";

// line 68 in identify.class.php
$GLOBALS["i18n"]["Identification failure"] = "Identificatie mislukt";

// line 25 in send.class.php
$GLOBALS["i18n"]["Your must be connected to send a message"] = "Je moet verbonden zijn om een bericht te kunnen sturen";

// line 87 in chat.js.tpl.php
$GLOBALS["i18n"]["Click here to send your message"] = "Klik hier om je bericht te versturen";

// line 80 in chat.js.tpl.php
$GLOBALS["i18n"]["Enter the text to format"] = "Voer de tekst in die geformatteerd moet worden";

// line 81 in chat.js.tpl.php
$GLOBALS["i18n"]["Configuration has been rehashed"] = "Configuratie is gerehashed";

// line 82 in chat.js.tpl.php
$GLOBALS["i18n"]["A problem occurs during rehash"] = "Er is een probleem opgetreden bij het rehashen";

// line 83 in chat.js.tpl.php
$GLOBALS["i18n"]["Choosen nickname is allready used"] = "Die nickname is al in gebruik";

// line 84 in chat.js.tpl.php
$GLOBALS["i18n"]["phpfreechat current version is %s"] = "phpfreechat versie is %s";

// line 85 in chat.js.tpl.php
$GLOBALS["i18n"]["Maximum number of joined channels has been reached"] = "Het maximum aantal kanalen dat je kan betreden is bereikt";

// line 86 in chat.js.tpl.php
$GLOBALS["i18n"]["Maximum number of private chat has been reached"] = "Het maximum aantal privé-chats is bereikt";

// line 88 in chat.js.tpl.php
$GLOBALS["i18n"]["Send"] = "Verzenden";

// line 86 in mysql.class.php
$GLOBALS["i18n"]["Mysql container: connect error"] = "Mysql container: verbindingsfout";

// line 101 in mysql.class.php
$GLOBALS["i18n"]["Mysql container: create database error '%s'"] = "Mysql container: database creatie fout";

// line 112 in mysql.class.php
$GLOBALS["i18n"]["Mysql container: create table error '%s'"] = "Mysql container: tabel creatie fout";

// line 80 in chat.js.tpl.php
$GLOBALS["i18n"]["You are not allowed to speak to yourself"] = "Je mag niet tegen jezelf praten";

// line 82 in chat.js.tpl.php
$GLOBALS["i18n"]["Choosen nickname is not allowed"] = "De gekozen nickname is niet toegelaten";

// line 83 in chat.js.tpl.php
$GLOBALS["i18n"]["Enable sound notifications"] = "Geluidsmeldingen aanzetten";

// line 84 in chat.js.tpl.php
$GLOBALS["i18n"]["Disable sound notifications"] = "Geluidsmeldingen uitzetten";

// line 23 in kick.class.php
$GLOBALS["i18n"]["no reason"] = "geen reden";

// line 24 in banlist.class.php
$GLOBALS["i18n"]["The banished user list is:"] = "De lijst van verbannen gebruikers is:";

// line 39 in banlist.class.php
$GLOBALS["i18n"]["'/unban {nickname}' will unban the user identified by {nickname}"] = "'/unban {nickname}' maakt de verbanning van gebruiker {nickname} ongedaan";

// line 43 in kick.class.php
$GLOBALS["i18n"]["kicked from %s by %s - reason: %s"] = "gekickt uit %s door %s - reden: %s";

// line 20 in quit.class.php
$GLOBALS["i18n"]["%s quit (%s)"] = "%s is vertrokken (%s)";

// line 124 in chat.js.tpl.php
$GLOBALS["i18n"]["Chat loading ..."] = "Chat is bezig met inladen ...";

// line 124 in chat.js.tpl.php
$GLOBALS["i18n"]["Please wait"] = "Even geduld";

// line 139 in chat.js.tpl.php
$GLOBALS["i18n"]["%s appears to be either disabled or unsupported by your browser."] = "%s lijkt uitgeschakeld te zijn of wordt niet ondersteund door uw browser.";

// line 139 in chat.js.tpl.php
$GLOBALS["i18n"]["This web application requires %s to work properly."] = "Deze web-applicatie vereist %s";

// line 135 in chat.js.tpl.php
$GLOBALS["i18n"]["Please enable %s in your browser settings, or upgrade to a browser with %s support and try again."] = "Zet %s aan in de instellingen van je browser, of upgrade naar een browser die %s ondersteunt.";

// line 137 in chat.js.tpl.php
$GLOBALS["i18n"]["Please upgrade to a browser with %s support and try again."] = "Upgrade naar een browser die %s ondersteunt en probeer opnieuw.";

// line 139 in chat.js.tpl.php
$GLOBALS["i18n"]["In Internet Explorer versions earlier than 7.0, Ajax is implemented using ActiveX. Please enable ActiveX in your browser security settings or upgrade to a browser with Ajax support and try again."] = "In Internet Explorer voor versie 7.0 wordt Ajax toegepast via ActiveX. Zet ActiveX aan in de veiligheidsinstellingen of upgrade naar een browser met standaard Ajax ondersteuning.";

// line 359 in pfcglobalconfig.class.php
$GLOBALS["i18n"]["%s doesn't exist, data_public_path cannot be installed"] = "%s bestaat niet, data_public_path kan niet geïnstalleerd worden";

// line 73 in invite.class.php
$GLOBALS["i18n"]["You must join %s to invite users in this channel"] = "Je moet bij %s gaan om gebruikers in dit kanaal uit te nodigen";

// line 47 in chat.html.tpl.php
$GLOBALS["i18n"]["Ping"] = "Ping";

// line 477 in phpfreechat.class.php
$GLOBALS["i18n"]["Input Required"] = "Invoer vereist";

// line 478 in phpfreechat.class.php
$GLOBALS["i18n"]["OK"] = "OK";

// line 479 in phpfreechat.class.php
$GLOBALS["i18n"]["Cancel"] = "Annuleren";

// line 430 in pfcglobalconfig.class.php
$GLOBALS["i18n"]["cannot create %s"] = "kan %s niet aanmaken";

// line 436 in pfcglobalconfig.class.php
$GLOBALS["i18n"]["cannot copy %s in %s"] = "kan %s niet in %s kopiëren";

// line 667 in pfcglobalconfig.class.php
$GLOBALS["i18n"]["Error: '%s' could not be found, please check your theme_path '%s' and your theme '%s' are correct"] = "Fout: '%s' kan niet gevonden worden, kijk of je theme_path '%s' en je theme '%s' correct zijn";

// line 414 in phpfreechat.class.php
$GLOBALS["i18n"]["Are you sure you want to close this tab ?"] = "Ben je zeker dat je deze tab wil sluiten?";

// line 42 in ban.class.php
$GLOBALS["i18n"]["%s banished from %s by %s"] = "%s is verbannen uit %s door %s";

// line 446 in phpfreechat.class.php
$GLOBALS["i18n"]["Chosen nickname is already used"] = "";

// line 454 in phpfreechat.class.php
$GLOBALS["i18n"]["Chosen nickname is not allowed"] = "";

// line 460 in phpfreechat.class.php
$GLOBALS["i18n"]["You are trying to speak to a unknown (or not connected) user"] = "";

// line 89 in invite.class.php
$GLOBALS["i18n"]["%s was invited by %s"] = "";

?>


text:
configuration Sample_xVMHyperV_SimpleWithDvdDrive
{
    param
    (
        [System.String[]]
        $NodeName = 'localhost',

        [Parameter(Mandatory = $true)]
        [System.String]
        $VMName,

        [Parameter(Mandatory = $true)]
        [System.String]
        $VhdPath,

        [System.String]
        $ISOPath
    )

    Import-DscResource -ModuleName 'xHyper-V'

    Node $NodeName
    {
        # Install HyperV feature, if not installed - Server SKU only
        WindowsFeature HyperV
        {
            Ensure = 'Present'
            Name   = 'Hyper-V'
        }

        # Ensures a VM with default settings
        xVMHyperV NewVM
        {
            Ensure    = 'Present'
            Name      = $VMName
            VhdPath   = $VhdPath
            Generation = $VhdPath.Split('.')[-1]
            DependsOn = '[WindowsFeature]HyperV'
        }

        # Adds DVD Drive with ISO
        xVMDvdDrive NewVMDvdDriveISO
        {
            Ensure             = 'Present'
            VMName               = $VMName
            ControllerNumber   = 0
            ControllerLocation = 0
            Path               = $ISOPath
            DependsOn          = '[xVMHyperV]NewVM'
        }
    }
}