text:
package com.twosigma.beaker.jvm.object;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.Set;

import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.JsonSerializer;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.SerializerProvider;

import com.twosigma.beaker.jvm.serialization.BeakerObjectConverter;
import com.twosigma.beaker.jvm.serialization.ObjectDeserializer;

public class TableDisplay {
  private final static Logger logger = Logger.getLogger(TableDisplay.class.getName());
  private final List<List<?>> values;
  private final List<String> columns;
  private final List<String> classes;
  private final String subtype;

  public static final String TABLE_DISPLAY_SUBTYPE = "TableDisplay";
  public static final String LIST_OF_MAPS_SUBTYPE = "ListOfMaps";
  public static final String MATRIX_SUBTYPE = "Matrix";
  public static final String DICTIONARY_SUBTYPE = "Dictionary";

  public TableDisplay(List<List<?>> v, List<String> co, List<String> cl) {
    values = v;
    columns = co;
    classes = cl;
    subtype = TABLE_DISPLAY_SUBTYPE;
  }

  public TableDisplay(Collection<Map<?,?>> v, BeakerObjectConverter serializer) {
    values = new ArrayList<List<?>>();
    columns = new ArrayList<String>();
    classes = new ArrayList<String>();
    subtype = LIST_OF_MAPS_SUBTYPE;

    // create columns
    for(Map<?,?> m : v) {
      Set<?> w = m.entrySet();
      for (Object s : w) {
        Entry<?,?> e = (Entry<?, ?>) s;
        String c = e.getKey().toString();
        if (!columns.contains(c)) {
          columns.add(c);
          String n = e.getValue()!=null ? e.getValue().getClass().getName() : "string";
          classes.add(serializer.convertType(n));
        }
      }
    }

    // now build values
    for(Map<?,?> m : v) {
      List<Object> vals = new ArrayList<Object>();
      for (String cn : columns) {
        if (m.containsKey(cn))
          vals.add(m.get(cn));
        else
          vals.add(null);
      }
      values.add(vals);
    }
  }

  public List<List<?>> getValues() { return values; }
  public List<String> getColumnNames() { return columns; }
  public List<String> getTypes() { return classes; }

  public static class Serializer extends JsonSerializer<TableDisplay> {

    @Override
    public void serialize(TableDisplay value,
        JsonGenerator jgen,
        SerializerProvider provider)
        throws IOException, JsonProcessingException {

      synchronized (value) {
        jgen.writeStartObject();
        jgen.writeObjectField("type", "TableDisplay");
        jgen.writeObjectField("columnNames", value.columns);
        jgen.writeObjectField("values", value.values);
        jgen.writeObjectField("types", value.classes);
        jgen.writeObjectField("subtype", value.subtype);
        jgen.writeEndObject();
      }
    }
  }

  public static class DeSerializer implements ObjectDeserializer {

    private final BeakerObjectConverter parent;

    public DeSerializer(BeakerObjectConverter p) {
      parent = p;
      parent.addKnownBeakerType("TableDisplay");
    }

    @SuppressWarnings("unchecked")
    @Override
    public Object deserialize(JsonNode n, ObjectMapper mapper) {
      Object o = null;
      try {
        List<List<?>> vals = null;
        List<String> cols = null;
        List<String> clas = null;
        String subtype = null;

        if (n.has("columnNames"))
          cols = mapper.readValue(n.get("columnNames"), List.class);
        if (n.has("types"))
          clas = mapper.readValue(n.get("types"), List.class);
        if (n.has("values")) {
          JsonNode nn = n.get("values");
          vals = new ArrayList<List<?>>();
          if (nn.isArray()) {
            for (JsonNode nno : nn) {
              if (nno.isArray()) {
                ArrayList<Object> val = new ArrayList<Object>();
                for (JsonNode nnoo : nno) {
                  Object obj = parent.deserialize(nnoo, mapper);
                  val.add(obj);
                }
                vals.add(val);
              }
            }
          }
        }
        if (n.has("subtype"))
          subtype = mapper.readValue(n.get("subtype"), String.class);
        /*
         * unfortunately the other 'side' of this is in the BeakerObjectSerializer
         */
        if (subtype!=null && subtype.equals(TableDisplay.DICTIONARY_SUBTYPE)) {
          Map<String,Object> m = new HashMap<String,Object>();
          for(List<?> l : vals) {
            if (l.size()!=2)
              continue;
            m.put(l.get(0).toString(), l.get(1));
          }
          o = m;
        } else if(subtype!=null && subtype.equals(TableDisplay.LIST_OF_MAPS_SUBTYPE) && cols!=null && vals!=null) {
          List<Map<String,Object>>  oo = new ArrayList<Map<String,Object>>();
          for(int r=0; r<vals.size(); r++) {
            Map<String,Object> m = new HashMap<String,Object>();
            List<?> row = vals.get(r);
            for(int c=0; c<cols.size(); c++) {
              if(row.size()>c)
                m.put(cols.get(c), row.get(c));
            }
            oo.add(m);
          }
          o = oo;
        } else if(subtype!=null && subtype.equals(TableDisplay.MATRIX_SUBTYPE)) {
          o = vals;
        }
        if (o==null) {
          if (n.has("hasIndex") && mapper.readValue(n.get("hasIndex"), String.class).equals("true")) {
            cols.remove(0);
            clas.remove(0);
            for(List<?> v : vals) {
              v.remove(0);
            }
            o = new TableDisplay(vals, cols, clas);
          } else {
            o = new TableDisplay(vals, cols, clas);
          }
        }
      } catch (Exception e) {
        logger.log(Level.SEVERE, "exception deserializing TableDisplay ", e);
      }
      return o;
    }

    @Override
    public boolean canBeUsed(JsonNode n) {
      return n.has("type") && n.get("type").asText().equals("TableDisplay");
    }
  }
}


text: This is where I would tell you about the app, if there was a point to it.

redpajama_set_name: RedPajamaGithub


text:
title: photobomb!
date: 2014-11-30 00:00:00 Z
permalink: "/2014/11/30/20141130photobomb/"
categories:
- Uncategorized
author: Jennifer
layout: post
---

Soooo, we started off the day with Ima pretending to be bat girl. Super cute right😄😄 It was only later when I was looking to post that I noticed Ever totally photobombing!! that has me cracking up hours later.

![xmas crazy](/teamelam/assets/images/2014-11-30-20141130photobomb.jpg)


text:
#ifndef ossimQuadrilateralMap_HEADER
#define ossimQuadrilateralMap_HEADER
#include <ossim/base/ossimDpt.h>

class OSSIMDLLEXPORT ossimQuadrilateralMap
{
public:
   ossimQuadrilateralMap(const ossimDpt& sourceP1,
                         const ossimDpt& sourceP2,
                         const ossimDpt& sourceP3,
                         const ossimDpt& sourceP4,
                         const ossimDpt& destP1,
                         const ossimDpt& destP2,
                         const ossimDpt& destP3,
                         const ossimDpt& destP4);
   ossimQuadrilateralMap();

  ossimQuadrilateralMap(const ossimQuadrilateralMap& rhs);
   /*!
    * Uses a standard form of quadrilateral to quadrilateral
    * mapping:
    *
    * X = (a*U + b*V + c) / (g*U + h*V + 1)
    * Y = (d*U + e*V+f)/(g*U + h*V + 1)
    *
    * where:
    * X and Y are the mapped destination point.
    * U and V are the source point to warp
    * a, b, c, d, e, f, g, h are coefficients sovled by
    * the points passed to the constructor.
    */
   void map(const ossimDpt& source, ossimDpt& dest)const;

   void solveCoefficients(const ossimDpt& sourceP1,
                          const ossimDpt& sourceP2,
                          const ossimDpt& sourceP3,
                          const ossimDpt& sourceP4,
                          const ossimDpt& destP1,
                          const ossimDpt& destP2,
                          const ossimDpt& destP3,
                          const ossimDpt& destP4);

protected:
   double a;
   double b;
   double c;
   double d;
   double e;
   double f;
   double g;
   double h;

};

#endif


text:
import React from 'react';
import Paper from 'material-ui/Paper';
import TextField from 'material-ui/TextField';
import RaisedButton from 'material-ui/RaisedButton';
import Search from 'material-ui/svg-icons/action/search';
import * as RecipesActions from '../actions/RecipesActions';
export default class SearchByName extends React.Component{
  constructor(props) {
    super(props);
    };

  handleCLickSearch(){
    RecipesActions.searchByName(this.refs.search.getValue());
    this.context.router.replace('/recipes');

  };
render(){
  const styleDiv = {
   textAlign: 'center',
   marginTop: '200px'
  }
  const stylePaper = {
    height: 225,
    width: 400,
    textAlign: 'center',
    display: 'inline-block',

  };
  return(

    <Paper style={stylePaper}>

Search by name

      <TextField
      ref='search'
        hintText="Recipe name"
        floatingLabelText="Recipe name"
      />

      <RaisedButton
      label="search"
      primary={true}
      icon={<Search/>}
      onTouchTap={this.handleCLickSearch.bind(this)}
    />
  </Paper>

  )
}

}
SearchByName.contextTypes = {
  router: React.PropTypes.object.isRequired
}


text:
// Copyright 2017 The Nomulus Authors. All Rights Reserved.
//
// 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 google.registry.flows.picker;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableTable;
import com.google.common.collect.Table;
import google.registry.flows.EppException;
import google.registry.flows.EppException.SyntaxErrorException;
import google.registry.flows.EppException.UnimplementedCommandException;
import google.registry.flows.Flow;
import google.registry.flows.contact.ContactCheckFlow;
import google.registry.flows.contact.ContactCreateFlow;
import google.registry.flows.contact.ContactDeleteFlow;
import google.registry.flows.contact.ContactInfoFlow;
import google.registry.flows.contact.ContactTransferApproveFlow;
import google.registry.flows.contact.ContactTransferCancelFlow;
import google.registry.flows.contact.ContactTransferQueryFlow;
import google.registry.flows.contact.ContactTransferRejectFlow;
import google.registry.flows.contact.ContactTransferRequestFlow;
import google.registry.flows.contact.ContactUpdateFlow;
import google.registry.flows.domain.DomainCheckFlow;
import google.registry.flows.domain.DomainClaimsCheckFlow;
import google.registry.flows.domain.DomainCreateFlow;
import google.registry.flows.domain.DomainDeleteFlow;
import google.registry.flows.domain.DomainInfoFlow;
import google.registry.flows.domain.DomainRenewFlow;
import google.registry.flows.domain.DomainRestoreRequestFlow;
import google.registry.flows.domain.DomainTransferApproveFlow;
import google.registry.flows.domain.DomainTransferCancelFlow;
import google.registry.flows.domain.DomainTransferQueryFlow;
import google.registry.flows.domain.DomainTransferRejectFlow;
import google.registry.flows.domain.DomainTransferRequestFlow;
import google.registry.flows.domain.DomainUpdateFlow;
import google.registry.flows.host.HostCheckFlow;
import google.registry.flows.host.HostCreateFlow;
import google.registry.flows.host.HostDeleteFlow;
import google.registry.flows.host.HostInfoFlow;
import google.registry.flows.host.HostUpdateFlow;
import google.registry.flows.poll.PollAckFlow;
import google.registry.flows.poll.PollRequestFlow;
import google.registry.flows.session.HelloFlow;
import google.registry.flows.session.LoginFlow;
import google.registry.flows.session.LogoutFlow;
import google.registry.model.contact.ContactCommand;
import google.registry.model.domain.DomainCommand;
import google.registry.model.domain.launch.LaunchCheckExtension;
import google.registry.model.domain.launch.LaunchCheckExtension.CheckType;
import google.registry.model.domain.launch.LaunchPhase;
import google.registry.model.domain.rgp.RestoreCommand.RestoreOp;
import google.registry.model.domain.rgp.RgpUpdateExtension;
import google.registry.model.eppinput.EppInput;
import google.registry.model.eppinput.EppInput.Hello;
import google.registry.model.eppinput.EppInput.InnerCommand;
import google.registry.model.eppinput.EppInput.Login;
import google.registry.model.eppinput.EppInput.Logout;
import google.registry.model.eppinput.EppInput.Poll;
import google.registry.model.eppinput.EppInput.ResourceCommandWrapper;
import google.registry.model.eppinput.EppInput.Transfer;
import google.registry.model.eppinput.EppInput.Transfer.TransferOp;
import google.registry.model.eppinput.ResourceCommand;
import google.registry.model.host.HostCommand;
import java.util.Map;
import java.util.Optional;

/** Class that picks a flow to handle a given EPP command. */
public class FlowPicker {

  /** Marker class for unimplemented flows. */
  private abstract static class UnimplementedFlow implements Flow {}

  /** Marker class for unimplemented restore flows. */
  private abstract static class UnimplementedRestoreFlow implements Flow {}

  /** A function type that takes an {@link EppInput} and returns a {@link Flow} class. */
  private abstract static class FlowProvider {
    /** Get the flow associated with this {@link EppInput} or return null to signal no match. */
    Class<? extends Flow> get(EppInput eppInput) {
      InnerCommand innerCommand = eppInput.getCommandWrapper().getCommand();
      return get(eppInput, innerCommand, (innerCommand instanceof ResourceCommandWrapper)
          ? ((ResourceCommandWrapper) innerCommand).getResourceCommand() : null);
    }

    /**
     * Subclasses need to implement this to examine the parameters and choose a flow (or null if
     * the subclass doesn't know of an appropriate flow.
     */
    abstract Class<? extends Flow> get(
        EppInput eppInput, InnerCommand innerCommand, ResourceCommand resourceCommand);
  }

  /** The hello flow is keyed on a special {@code CommandWrapper} type. */
  private static final FlowProvider HELLO_FLOW_PROVIDER = new FlowProvider() {
    @Override
    Class<? extends Flow> get(
        EppInput eppInput, InnerCommand innerCommand, ResourceCommand resourceCommand) {
      return eppInput.getCommandWrapper() instanceof Hello ? HelloFlow.class : null;
    }};

  /** Session flows like login and logout are keyed only on the {@link InnerCommand} type. */
  private static final FlowProvider SESSION_FLOW_PROVIDER = new FlowProvider() {
    private final Map<Class<?>, Class<? extends Flow>> commandFlows =
      ImmutableMap.of(
          Login.class, LoginFlow.class,
          Logout.class, LogoutFlow.class);

    @Override
    Class<? extends Flow> get(
        EppInput eppInput, InnerCommand innerCommand, ResourceCommand resourceCommand) {
      return innerCommand == null ? null : commandFlows.get(innerCommand.getClass());
    }};

  /** Poll flows have an {@link InnerCommand} of type {@link Poll}. */
  private static final FlowProvider POLL_FLOW_PROVIDER = new FlowProvider() {
    @Override
    Class<? extends Flow> get(
        EppInput eppInput, InnerCommand innerCommand, ResourceCommand resourceCommand) {
      if (!(innerCommand instanceof Poll)) {
        return null;
      }
      switch (((Poll) innerCommand).getPollOp()) {
        case ACK:
          return PollAckFlow.class;
        case REQUEST:
          return PollRequestFlow.class;
        default:
          return UnimplementedFlow.class;
      }
    }};

  /**
   * The domain restore command is technically a domain {@literal <update>}, but logically a totally
   * separate flow.
   *
   * <p>This provider must be tried before {@link #RESOURCE_CRUD_FLOW_PROVIDER}. Otherwise, the
   * regular domain update flow will match first.
   */
  private static final FlowProvider DOMAIN_RESTORE_FLOW_PROVIDER = new FlowProvider() {
    @Override
    Class<? extends Flow> get(
        EppInput eppInput, InnerCommand innerCommand, ResourceCommand resourceCommand) {
      if (!(resourceCommand instanceof DomainCommand.Update)) {
        return null;
      }
      Optional<RgpUpdateExtension> rgpUpdateExtension =
          eppInput.getSingleExtension(RgpUpdateExtension.class);
      if (!rgpUpdateExtension.isPresent()) {
        return null;
      }
      // Restore command with an op of "report" is not currently supported.
      return (rgpUpdateExtension.get().getRestoreCommand().getRestoreOp() == RestoreOp.REQUEST)
          ? DomainRestoreRequestFlow.class
          : UnimplementedRestoreFlow.class;
    }};

  /**
   * The claims check flow is keyed on the type of the {@link ResourceCommand} and on having the
   * correct extension with a specific phase value.
   */
  private static final FlowProvider DOMAIN_CHECK_FLOW_PROVIDER =
      new FlowProvider() {
        @Override
        Class<? extends Flow> get(
            EppInput eppInput, InnerCommand innerCommand, ResourceCommand resourceCommand) {
          if (!(resourceCommand instanceof DomainCommand.Check)) {
            return null;
          }
          Optional<LaunchCheckExtension> launchCheck =
              eppInput.getSingleExtension(LaunchCheckExtension.class);
          if (!launchCheck.isPresent()
              || CheckType.AVAILABILITY.equals(launchCheck.get().getCheckType())) {
            // We don't distinguish between registry phases for "avail", so don't bother checking
            // phase.
            return DomainCheckFlow.class;
          }
          if (CheckType.CLAIMS.equals(launchCheck.get().getCheckType())
              && LaunchPhase.CLAIMS.equals(launchCheck.get().getPhase())) {
            return DomainClaimsCheckFlow.class;
          }
          return null;
        }
      };

  /** General resource CRUD flows are keyed on the type of their {@link ResourceCommand}. */
  private static final FlowProvider RESOURCE_CRUD_FLOW_PROVIDER = new FlowProvider() {
    private final Map<Class<?>, Class<? extends Flow>> resourceCrudFlows =
        new ImmutableMap.Builder<Class<?>, Class<? extends Flow>>()
            .put(ContactCommand.Check.class, ContactCheckFlow.class)
            .put(ContactCommand.Create.class, ContactCreateFlow.class)
            .put(ContactCommand.Delete.class, ContactDeleteFlow.class)
            .put(ContactCommand.Info.class, ContactInfoFlow.class)
            .put(ContactCommand.Update.class, ContactUpdateFlow.class)
            .put(DomainCommand.Create.class, DomainCreateFlow.class)
            .put(DomainCommand.Delete.class, DomainDeleteFlow.class)
            .put(DomainCommand.Info.class, DomainInfoFlow.class)
            .put(DomainCommand.Renew.class, DomainRenewFlow.class)
            .put(DomainCommand.Update.class, DomainUpdateFlow.class)
            .put(HostCommand.Check.class, HostCheckFlow.class)
            .put(HostCommand.Create.class, HostCreateFlow.class)
            .put(HostCommand.Delete.class, HostDeleteFlow.class)
            .put(HostCommand.Info.class, HostInfoFlow.class)
            .put(HostCommand.Update.class, HostUpdateFlow.class)
            .build();

    @Override
    Class<? extends Flow> get(
        EppInput eppInput, InnerCommand innerCommand, ResourceCommand resourceCommand) {
      return resourceCommand == null ? null : resourceCrudFlows.get(resourceCommand.getClass());
    }};

  /** Transfer flows have an {@link InnerCommand} of type {@link Transfer}. */
  private static final FlowProvider TRANSFER_FLOW_PROVIDER = new FlowProvider() {
    private final Table<Class<?>, TransferOp, Class<? extends Flow>> transferFlows = ImmutableTable
        .<Class<?>, TransferOp, Class<? extends Flow>>builder()
        .put(ContactCommand.Transfer.class, TransferOp.APPROVE, ContactTransferApproveFlow.class)
        .put(ContactCommand.Transfer.class, TransferOp.CANCEL, ContactTransferCancelFlow.class)
        .put(ContactCommand.Transfer.class, TransferOp.QUERY, ContactTransferQueryFlow.class)
        .put(ContactCommand.Transfer.class, TransferOp.REJECT, ContactTransferRejectFlow.class)
        .put(ContactCommand.Transfer.class, TransferOp.REQUEST, ContactTransferRequestFlow.class)
        .put(DomainCommand.Transfer.class, TransferOp.APPROVE, DomainTransferApproveFlow.class)
        .put(DomainCommand.Transfer.class, TransferOp.CANCEL, DomainTransferCancelFlow.class)
        .put(DomainCommand.Transfer.class, TransferOp.QUERY, DomainTransferQueryFlow.class)
        .put(DomainCommand.Transfer.class, TransferOp.REJECT, DomainTransferRejectFlow.class)
        .put(DomainCommand.Transfer.class, TransferOp.REQUEST, DomainTransferRequestFlow.class)
        .build();

    @Override
    Class<? extends Flow> get(
        EppInput eppInput, InnerCommand innerCommand, ResourceCommand resourceCommand) {
      return resourceCommand != null && innerCommand instanceof Transfer
          ? transferFlows.get(resourceCommand.getClass(), ((Transfer) innerCommand).getTransferOp())
          : null;
    }};

  private static final ImmutableList<FlowProvider> FLOW_PROVIDERS =
      ImmutableList.of(
          HELLO_FLOW_PROVIDER,
          SESSION_FLOW_PROVIDER,
          POLL_FLOW_PROVIDER,
          DOMAIN_RESTORE_FLOW_PROVIDER,
          DOMAIN_CHECK_FLOW_PROVIDER,
          RESOURCE_CRUD_FLOW_PROVIDER,
          TRANSFER_FLOW_PROVIDER);

  /** Return the appropriate flow to handle this EPP command. */
  public static Class<? extends Flow> getFlowClass(EppInput eppInput) throws EppException {
    // Do some sanity checking on the input; anything but Hello must have a command type.
    InnerCommand innerCommand = eppInput.getCommandWrapper().getCommand();
    if (innerCommand == null && !(eppInput.getCommandWrapper() instanceof Hello)) {
      throw new MissingCommandException();
    }
    // Try the FlowProviders until we find a match. The order matters because it's possible to
    // match multiple FlowProviders and so more specific matches are tried first.
    for (FlowProvider flowProvider : FLOW_PROVIDERS) {
      Class<? extends Flow> flowClass = flowProvider.get(eppInput);
      if (flowClass == UnimplementedFlow.class) {
        break;  // We found it, but it's marked as not implemented.
      } else if (flowClass == UnimplementedRestoreFlow.class) {
        throw new UnimplementedCommandException(
            "Domain restores are approved and enacted instantly, "
                + "therefore domain restore reports are not supported");
      } else if (flowClass != null) {
        return flowClass;  // We found it!
      }
    }
    // Nothing usable was found, so throw an exception.
    throw new UnimplementedCommandException(innerCommand);
  }

  /** Command missing. */
  static class MissingCommandException extends SyntaxErrorException {
    public MissingCommandException() {
      super("Command missing");
    }
  }
}


text:
author: Jeff Van Campen
comments: true
date: 2007-10-01 10:39:24+00:00
layout: post
slug: new-job
title: New Job
wordpress_id: 32
category:
- begins
tags:
- employment
- job
- Neuxpower
- NXPowerLite
---

Those of you who are addicted to facebook will already know this from my status and wall posts, but I thought I'd announce this to the rest of the world (or at least the very small part of it that follows my blog):  After a month and a half of phone calls, interviews and waiting, I've finally accepted a new job.

I'll be working for a company called Neuxpower. They develop a product called [NXPowerLite](http://www.nxpowerlite.com), which is a utility that reduces the size of Microsoft Office files.  Anyone who makes large Powerpoint presentations and emails them should definitely check it out.  It also works for large Word and Excel files.

The role I've accepted is as a web developer, working on improving the website and some of the internal systems.   The interviews with Mike and Andrew went well.  I'm looking forward to working with them and meeting the rest of the team when I start on the 15th of Octoaber.

This means that my illustrious career as a freelancer is over.  I still have a couple of days' work to finish, which I'll be doing in the next week now that I'm not running spending all day in interview and on the phone with recruitment agents.  I'd like to thank everyone that I worked for over the past few months.  It was fun.  I missed working with a team, though, and am happy to have to opportunity to do that again at Neuxpower.


text:
import axios from 'axios'
// ------------------------------------
// Constants
// ------------------------------------
export const LOAD_PROJECT_LIST = 'LOAD_PROJECT_LIST'
export const DELETE_PROJECT = 'DELETE_PROJECT'
// ------------------------------------
// Actions 定义行为,及该行为相关的 state,type为行为名,其他字段为需要 state字段,用于存储数据,与vuex 初始化的state类似
// ------------------------------------
export function increment(value = []) {
    return {
        type: LOAD_PROJECT_LIST,
        payload: value
    }
}
export function deleteAction(id = 0) {
    return {
        type: DELETE_PROJECT,
        id: id
    }
}
/*  This is a thunk, meaning it is a function that immediately
 returns a function for lazy evaluation. It is incredibly useful for
 creating async actions, especially when combined with redux-thunk!

 NOTE: This is solely for demonstration purposes. In a real application,
 you'd probably want to dispatch an action of COUNTER_DOUBLE and let the
 reducer take care of this logic.  */
export const loadProjectList = ()=> {
    return (dispatch, getState)=> {
        axios.get('/web/project_list').then((data)=> {
            if (data) {
                dispatch(increment(data.data))
            }
        })
    }
}
export const deleteProjectInfo = (projectId, callback)=> {
    return (dispatch)=> {
        let url = '/web/project/delete/' + projectId
        axios.delete(url).then((data)=> {
            if (data && data.data) {
                callback(data.data);
                dispatch(deleteAction(projectId))
            }
        })
    }
}
export const actions = {
    increment,
    loadProjectList,
    deleteProjectInfo
}
// ------------------------------------
// Action Handlers action 处理
// ------------------------------------
const ACTION_HANDLERS = {
    [LOAD_PROJECT_LIST]: (state, action) => {
        return action.payload
    },
    [DELETE_PROJECT]: (state, action) => {
        return state.slice().filter(item=>item.project_id !== action.id)
    },
}
// ------------------------------------
// Reducer
// ------------------------------------
const initialState = []
export default function homeReducer(state = initialState, action) {
    const handler = ACTION_HANDLERS[action.type]
    return handler ? handler(state, action) : state
}


text:
var upgrades = upgrades || {};

upgrades.cork = (function() {
  "use strict";

  var corkPosts;
  window.soiDetails = identifySoi();

  function nuke() {
    saveBucket({});
  }

  function saveBucket(v) {
    var s = JSON.stringify(v);
    localStorage.setItem("cork_" + window.soiDetails.fullRoomName, s);
  }

  function getBucket() {
    var s = localStorage.getItem("cork_" + window.soiDetails.fullRoomName);
    if (!s) {
      return {};
    }

    try {
      s = JSON.parse(s);
    } catch (e) {
      alert("Bucket error - clearing");
      s = {};
    }

    return s;
  }

  function parseCork() {
    // There might be another list on the page, so be specific.
    var lis = document.querySelectorAll("li a i");
    corkPosts = [];

    var results = [];
    forEachNode(lis, function(el, idx) {
      try {
        var post = this;
        while (post.tagName.toLowerCase() !== 'li') {
          post = post.parentNode;
        }

        var result = {};

        result.timeStamp = post.querySelector("a").textContent.trim();
        result.isCitizenPost = null;
        result.nickElement = post.querySelector("b").textContent;
        result.title = post.querySelector("i ~ i").previousSibling.textContent;
        result.reactions = parseInt(post.querySelector("i ~ i").textContent, 10);
        result.title = result.title.slice(0, -3).trim();

        corkPosts.push(post);
        results.push(result);
      } catch (err) {
        cpConsole.log("parseCork: Died on cork entry - " + idx + 1);
      }
    });

    return results;
  }

  function createClickHandler(post) {
    return function(_post) {
      var userHasSeen = getBucket();
      var lastLook = userHasSeen[_post.timeStamp] || {};
      lastLook.reactions = _post.reactions;
      lastLook.isNew = false;
      userHasSeen[_post.timeStamp] = lastLook;

      // Have any posts expired?
      var dateElements = document.querySelectorAll("li > a");
      var dates = [];
      forEachNode(dateElements, function(dateElement) {
        var date = dateElement.textContent.substring(0, 16);
        dates.push(date);
      });

      Object.keys(userHasSeen).forEach(function(date) {
        if (dates.indexOf(date) === -1) {
          delete userHasSeen[date];
          //console.log("Deleting memory of cork entry: " + date);
        }
      });

      saveBucket(userHasSeen);
    }(post);
  }

  function renderNewFlags(posts) {
    var userHasSeen = getBucket();

    posts.forEach(function(post, i) {
      var lastLook = userHasSeen[post.timeStamp];

      var title;
      var flag;

      if (!lastLook) {
        lastLook = {
          reactions: 0,
          isNew: true
        };
      }

      if (lastLook.isNew) {
        flag = '*';
        title = "This post has never been read";
      } else if (lastLook.reactions === post.reactions) {
        flag = '-';
        title = "All messages on this thread read";
      } else {
        var tmp = post.reactions - lastLook.reactions;
        flag = tmp;
        if (tmp === 1) {
          title = "" + tmp + " message unread";
        } else {
          title = "" + tmp + " messages unread";
        }
      }

      var link = corkPosts[i].querySelector("a");
      link.innerHTML += " <b class='chatplus_cork_count'>[" + flag + "]</b>";
      link.title = title;
      link.setAttribute("data-cp-cork-flag", flag);

      //TESTING
      link.setAttribute("data-cp-cork-reactions", post.reactions);

      addEvent(link, 'click', function(e) {
        if (typeof QUnit === "object") {
          e.stopPropagation();
          e.preventDefault();
        }
        createClickHandler(post);
      });

      var name = link.parentNode.querySelector("a + b");
      if (name) {
        var info = createUserInfo(name);
        name.className += "chatPlus_nick";
        name.title = info.text;
        name.setAttribute("data-nick", info.fullSoiStyleName);
      }

    });

    saveBucket(userHasSeen);
  }

  function renderTimeAgo(posts, soiTimeStamp, isDst) {
    var soiDate = new Date(soiTimeStamp * 1000);

    posts.forEach(function(post, i) {
      var el = corkPosts[i].querySelector("i");
      var corkDateStamp = el.textContent;
      var corkDate =  dateTimeHandler.getDateFromDateString(corkDateStamp, soiTimeStamp, isDst);

      var ago = dateTimeHandler.timeDifference(soiDate, corkDate);
      var span = document.createElement("span");
      span.innerHTML = ago;
      span.className = "cp-corkago";

      el.parentNode.parentNode.insertBefore(span, el.parentNode);

    });
  }

  function upgrade() {
    //TEST
    var old = document.querySelectorAll(".chatplus_cork_count");
    forEachNode(old, function() {
      this.parentNode.removeChild(this);
    });

    var form = document.querySelector("[name=vqvaj]");
    while (form.tagName.toLowerCase() !== "form") {
      form = form.parentNode;
    }

    var soiTimeString = form.textContent;
    var soiTimeStamp = document.querySelector("[name=vqxti]").value;
    var isDst = dateTimeHandler.isSoiDst(soiTimeStamp, soiTimeString);

    var posts = parseCork();
    renderNewFlags(posts);
    // renderTimeAgo(posts, soiTimeStamp, isDst);
  }

  var internals = {
    parseCork: parseCork,
    nuke: nuke,
    saveBucket: saveBucket,
    getBucket: getBucket
  };

  return {
    upgrade: upgrade,
    internals: internals
  };
}());


text:
Title: Axe/Lynx – Creed
Date: 2010-12-09 16:21
Author: eamonnfaherty
Category: projects
Slug: axelynx-creed

I was responsible for the full application development of Axe/Lynx
Creed. Creed was a video based TopTrumps game where players competed
against each other to complete the game in the fastest time. There was a
leader board and the first 1000 games completed were rewarded a free
pack of cards.


text:
---
layout: post-layout
---

{% assign minutes = content | number_of_words | divided_by: 180 %}
{% if minutes == 0 %}
  {% assign minutes = 1 %}
{% endif %}

{% assign author = site.data.authors[page.author] %}
{% assign ad = [1, 2, 3] %}

{{ page.title }}

{{ page.date | date: "%b %-d, %Y" }} - {% if page.update_date %}Updated: {{ page.update_date | date: "%b %-d, %Y" }} - {% endif %}{{ minutes }} minute read

            {{ content }}

Liked the article and found it useful? How about sharing it with others on twitter? We'd love to get your feedback!

We regularly write articles and offer Git and Angular trainings. Subscribe here to get the latest updates about our articles and trainings in your city:

              <link href="//cdn-images.mailchimp.com/embedcode/slim-081711.css" rel="stylesheet" type="text/css">

              <form style="padding: 0" action="//thoughtram.us8.list-manage.com/subscribe/post?u=dfbb1507fbced5a20d9dc5698&id=731f22cdca" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>

                <input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="Enter email here" required>

<input type="text" name="b_dfbb1507fbced5a20d9dc5698_731f22cdca" tabindex="-1" value="">

<input type="submit" value="Yes, I want updates!" name="subscribe" id="mc-embedded-subscribe" class="button">

              </form>

Oh, and don't forget to subscribe to our  RSS Feed.

              {% if page.relatedLinks %}

Related articles and links

                {% for link in page.relatedLinks %}

                  {{link.title}}

                {% endfor %}

              {% endif %}

          {% if author %}

            Written by {{ author.name }}

          {% endif %}

High quality  articles

Read our collection of high quality, up to date articles about Angular.

            Read more

Rebase {{ ad }}

The complete guide on rebasing in Git

            Learn More

Angular Master Class

Next public trainings happen in Hanover, Amsterdam and Helsinki!

            More info


text:
/*
 * 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.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.securitycenter.v1.model;

/**
 * Security Command Center managed properties. These properties are managed by Security Command
 * Center and cannot be modified by the user.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Security Command Center API. For a detailed
 * explanation see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class GoogleCloudSecuritycenterV1p1beta1SecurityCenterProperties extends com.google.api.client.json.GenericJson {

  /**
   * The user defined display name for this resource.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String resourceDisplayName;

  /**
   * The full resource name of the Google Cloud resource this asset represents. This field is
   * immutable after create time. See:
   * https://cloud.google.com/apis/design/resource_names#full_resource_name
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String resourceName;

  /**
   * Owners of the Google Cloud resource.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<java.lang.String> resourceOwners;

  /**
   * The full resource name of the immediate parent of the resource. See:
   * https://cloud.google.com/apis/design/resource_names#full_resource_name
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String resourceParent;

  /**
   * The user defined display name for the parent of this resource.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String resourceParentDisplayName;

  /**
   * The full resource name of the project the resource belongs to. See:
   * https://cloud.google.com/apis/design/resource_names#full_resource_name
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String resourceProject;

  /**
   * The user defined display name for the project of this resource.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String resourceProjectDisplayName;

  /**
   * The type of the Google Cloud resource. Examples include: APPLICATION, PROJECT, and
   * ORGANIZATION. This is a case insensitive field defined by Security Command Center and/or the
   * producer of the resource and is immutable after create time.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String resourceType;

  /**
   * The user defined display name for this resource.
   * @return value or {@code null} for none
   */
  public java.lang.String getResourceDisplayName() {
    return resourceDisplayName;
  }

  /**
   * The user defined display name for this resource.
   * @param resourceDisplayName resourceDisplayName or {@code null} for none
   */
  public GoogleCloudSecuritycenterV1p1beta1SecurityCenterProperties setResourceDisplayName(java.lang.String resourceDisplayName) {
    this.resourceDisplayName = resourceDisplayName;
    return this;
  }

  /**
   * The full resource name of the Google Cloud resource this asset represents. This field is
   * immutable after create time. See:
   * https://cloud.google.com/apis/design/resource_names#full_resource_name
   * @return value or {@code null} for none
   */
  public java.lang.String getResourceName() {
    return resourceName;
  }

  /**
   * The full resource name of the Google Cloud resource this asset represents. This field is
   * immutable after create time. See:
   * https://cloud.google.com/apis/design/resource_names#full_resource_name
   * @param resourceName resourceName or {@code null} for none
   */
  public GoogleCloudSecuritycenterV1p1beta1SecurityCenterProperties setResourceName(java.lang.String resourceName) {
    this.resourceName = resourceName;
    return this;
  }

  /**
   * Owners of the Google Cloud resource.
   * @return value or {@code null} for none
   */
  public java.util.List<java.lang.String> getResourceOwners() {
    return resourceOwners;
  }

  /**
   * Owners of the Google Cloud resource.
   * @param resourceOwners resourceOwners or {@code null} for none
   */
  public GoogleCloudSecuritycenterV1p1beta1SecurityCenterProperties setResourceOwners(java.util.List<java.lang.String> resourceOwners) {
    this.resourceOwners = resourceOwners;
    return this;
  }

  /**
   * The full resource name of the immediate parent of the resource. See:
   * https://cloud.google.com/apis/design/resource_names#full_resource_name
   * @return value or {@code null} for none
   */
  public java.lang.String getResourceParent() {
    return resourceParent;
  }

  /**
   * The full resource name of the immediate parent of the resource. See:
   * https://cloud.google.com/apis/design/resource_names#full_resource_name
   * @param resourceParent resourceParent or {@code null} for none
   */
  public GoogleCloudSecuritycenterV1p1beta1SecurityCenterProperties setResourceParent(java.lang.String resourceParent) {
    this.resourceParent = resourceParent;
    return this;
  }

  /**
   * The user defined display name for the parent of this resource.
   * @return value or {@code null} for none
   */
  public java.lang.String getResourceParentDisplayName() {
    return resourceParentDisplayName;
  }

  /**
   * The user defined display name for the parent of this resource.
   * @param resourceParentDisplayName resourceParentDisplayName or {@code null} for none
   */
  public GoogleCloudSecuritycenterV1p1beta1SecurityCenterProperties setResourceParentDisplayName(java.lang.String resourceParentDisplayName) {
    this.resourceParentDisplayName = resourceParentDisplayName;
    return this;
  }

  /**
   * The full resource name of the project the resource belongs to. See:
   * https://cloud.google.com/apis/design/resource_names#full_resource_name
   * @return value or {@code null} for none
   */
  public java.lang.String getResourceProject() {
    return resourceProject;
  }

  /**
   * The full resource name of the project the resource belongs to. See:
   * https://cloud.google.com/apis/design/resource_names#full_resource_name
   * @param resourceProject resourceProject or {@code null} for none
   */
  public GoogleCloudSecuritycenterV1p1beta1SecurityCenterProperties setResourceProject(java.lang.String resourceProject) {
    this.resourceProject = resourceProject;
    return this;
  }

  /**
   * The user defined display name for the project of this resource.
   * @return value or {@code null} for none
   */
  public java.lang.String getResourceProjectDisplayName() {
    return resourceProjectDisplayName;
  }

  /**
   * The user defined display name for the project of this resource.
   * @param resourceProjectDisplayName resourceProjectDisplayName or {@code null} for none
   */
  public GoogleCloudSecuritycenterV1p1beta1SecurityCenterProperties setResourceProjectDisplayName(java.lang.String resourceProjectDisplayName) {
    this.resourceProjectDisplayName = resourceProjectDisplayName;
    return this;
  }

  /**
   * The type of the Google Cloud resource. Examples include: APPLICATION, PROJECT, and
   * ORGANIZATION. This is a case insensitive field defined by Security Command Center and/or the
   * producer of the resource and is immutable after create time.
   * @return value or {@code null} for none
   */
  public java.lang.String getResourceType() {
    return resourceType;
  }

  /**
   * The type of the Google Cloud resource. Examples include: APPLICATION, PROJECT, and
   * ORGANIZATION. This is a case insensitive field defined by Security Command Center and/or the
   * producer of the resource and is immutable after create time.
   * @param resourceType resourceType or {@code null} for none
   */
  public GoogleCloudSecuritycenterV1p1beta1SecurityCenterProperties setResourceType(java.lang.String resourceType) {
    this.resourceType = resourceType;
    return this;
  }

  @Override
  public GoogleCloudSecuritycenterV1p1beta1SecurityCenterProperties set(String fieldName, Object value) {
    return (GoogleCloudSecuritycenterV1p1beta1SecurityCenterProperties) super.set(fieldName, value);
  }

  @Override
  public GoogleCloudSecuritycenterV1p1beta1SecurityCenterProperties clone() {
    return (GoogleCloudSecuritycenterV1p1beta1SecurityCenterProperties) super.clone();
  }

}


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

  angular.module('app.core')
    .directive('baSidebarToggleMenu', BaSidebarToggleMenuDirective);

  BaSidebarToggleMenuDirective.$inject = ['baSidebarService'];

  function BaSidebarToggleMenuDirective(baSidebarService) {
    return {
      restrict: 'A',
      link: BaSidebarToggleMenuLink
    };

    function BaSidebarToggleMenuLink(scope, elem) {
      elem.on('click', function ($evt) {
        $evt.originalEvent.$sidebarEventProcessed = true;
        scope.$apply(function () {
          baSidebarService.toggleMenuCollapsed();
        });
      });
    }
  }
})();


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

<TITLE>
URLImportTask (Ant Contrib)
</TITLE>

<META NAME="keywords" CONTENT="net.sf.antcontrib.net.URLImportTask class">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

net.sf.antcontrib.net

Class URLImportTask

java.lang.Object
  org.apache.tools.ant.ProjectComponent
      org.apache.tools.ant.Task
          net.sf.antcontrib.net.URLImportTask

public class URLImportTask
extends org.apache.tools.ant.Task

Task to import a build file from a url.  The build file can be a build.xml,
 or a .zip/.jar, in which case we download and extract the entire archive, and
 import the file "build.xml"

Author:

inger

Field Summary

Fields inherited from class org.apache.tools.ant.Task

description, location, target, taskName, taskType, wrapper

Fields inherited from class org.apache.tools.ant.ProjectComponent

project

Constructor Summary

URLImportTask()

Method Summary

 void
execute()

 void
setIvyConfFile(java.io.File ivyConfFile)

 void
setIvyConfUrl(java.net.URL ivyConfUrl)

 void
setModule(java.lang.String module)

 void
setOrg(java.lang.String org)

 void
setRev(java.lang.String rev)

Methods inherited from class org.apache.tools.ant.Task

getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType

Methods inherited from class org.apache.tools.ant.ProjectComponent

getProject, setProject

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

URLImportTask

public URLImportTask()

Method Detail

setModule

public void setModule(java.lang.String module)

setOrg

public void setOrg(java.lang.String org)

setRev

public void setRev(java.lang.String rev)

setIvyConfFile

public void setIvyConfFile(java.io.File ivyConfFile)

setIvyConfUrl

public void setIvyConfUrl(java.net.URL ivyConfUrl)

execute

public void execute()
             throws org.apache.tools.ant.BuildException

Overrides:
execute in class org.apache.tools.ant.Task

Throws:

org.apache.tools.ant.BuildException

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD


text:
<!doctype html>

	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Blog of Feeling Responsive</title>
	<link rel="stylesheet" type="text/css" href="http://localhost:4000/assets/css/styles_feeling_responsive.css">

		<link href='http://fonts.googleapis.com/css?family=Lato:400,700,400italic%7CVolkhov' rel='stylesheet' type='text/css'>

	<meta name="description" content="This is the Feeling Responsive Blog Template.">
  	<meta name="google-site-verification" content="">
	<meta name="msvalidate.01" content="" >
	<link rel="author" href="">

	<meta name="robots" content="noindex">

	<meta property="og:title" content="Blog of Feeling Responsive">
	<meta property="og:description" content="This is the Feeling Responsive Blog Template.">
	<meta property="og:url" content="http://localhost:4000/blog/">
	<meta property="og:locale" content="en_EN">
	<meta property="og:type" content="website">
	<meta property="og:site_name" content="The Politics of Informal Governance">

	<link type="text/plain" rel="author" href="http://localhost:4000/humans.txt">

	<link rel="icon" sizes="32x32" href="http://localhost:4000/assets/img/favicon-32x32.png">

	<link rel="icon" sizes="192x192" href="http://localhost:4000/assets/img/touch-icon-192x192.png">

	<link rel="apple-touch-icon-precomposed" sizes="180x180" href="http://localhost:4000/assets/img/apple-touch-icon-180x180-precomposed.png">

	<link rel="apple-touch-icon-precomposed" sizes="152x152" href="http://localhost:4000/assets/img/apple-touch-icon-152x152-precomposed.png">

	<link rel="apple-touch-icon-precomposed" sizes="144x144" href="http://localhost:4000/assets/img/apple-touch-icon-144x144-precomposed.png">

	<link rel="apple-touch-icon-precomposed" sizes="120x120" href="http://localhost:4000/assets/img/apple-touch-icon-120x120-precomposed.png">

	<link rel="apple-touch-icon-precomposed" sizes="114x114" href="http://localhost:4000/assets/img/apple-touch-icon-114x114-precomposed.png">

	<link rel="apple-touch-icon-precomposed" sizes="76x76" href="http://localhost:4000/assets/img/apple-touch-icon-76x76-precomposed.png">

	<link rel="apple-touch-icon-precomposed" sizes="72x72" href="http://localhost:4000/assets/img/apple-touch-icon-72x72-precomposed.png">

	<link rel="apple-touch-icon-precomposed" href="http://localhost:4000/assets/img/apple-touch-icon-precomposed.png">

	<meta name="msapplication-TileImage" content="http://localhost:4000/assets/img/msapplication_tileimage.png">

	<meta name="msapplication-TileColor" content="#fabb00">

 The Politics of Informal Governance

Navigation

Search

Home

Project

Data

Publications

People

Events

Links

event · news

Workshop in Geneva

        Read More ›

event · news

Workshop at University of St.Gallen

        Read More ›

publication – Book review by Oliver Westerwinter

The Continent of International Law

        Read More ›

event – The Informalization of Global Governance

ECPR Workshop

        Read More ›

publication – Book review by Oliver Westerwinter

Informal International Lawmaking

        Read More ›

    Blog Archive

Sidebar

			Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

			Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

			This is an advertisment with a crazy cat! More cats, please!

        

About This Site

              Official Project Website
              More ›

Services

                    sitemap.xml

Created with Jekyll based on Feeling Responsive.


text:
<?php

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

defined('MOODLE_INTERNAL') || die();

$string['activatecustomlinks'] = 'Activar Enlaces Personalizados';
$string['allowresize'] = 'Permitir que la ventana pueda cambiar de tamaño';
$string['allowscroll'] = 'Permitir que la ventana pueda desplazarse';
$string['blockgeneralsettings'] = 'Configuraciones Generales del Bloque';
$string['blockname'] = 'Menú del Curso';
$string['cannotmoveright'] = 'No puede moverse a la derecha';
$string['cannotmovetopicdown'] = 'No puede moverse el tema a la derecha. Hay otro tema arriba de este.';
$string['cannotmovetopicup'] = 'No puede moverse el tema de arriba. Hay otro tema arriba de este subcapítulo.';
$string['change'] = 'Cambiar';
$string['chapter'] = 'Capítulo';
$string['chaptering'] = 'Activar Agrupamiento Capítulo';
$string['chapters'] = 'Capítulos';
$string['correcturlmsg'] = '*La URL debe escribirse como una URL absoluta, que también contenga el protocolo (ejemplos de URLs correctas: http://www.moodle.org, ftp://ftp.moodle.org; Ejemplos de URLs incorrectas: www.moodle.org, moodle.org)';
$string['courseadministration'] = 'Administración del curso';
$string['coursemainpage'] = 'Página principal del curso';
$string['customlink'] = 'Enlace Personalizado';
$string['defaultgrouping'] = 'Agrupamiento por defecto';
$string['defaultheight'] = 'Altura de la ventana por defecto (en pixeles)';
$string['defaultwidth'] = 'Ancho de la ventana por defecto (en pixeles)';
$string['displaydirectory'] = 'Mostrar directorio';
$string['dockedbg'] = 'Color del fondo en modo acoplado';
$string['dockedbgdesc'] = 'Color del fondo del bloque cuando está acoplado';
$string['elements'] = 'Elementos';
$string['emptychapname'] = '¡El nombre del capítulo no puede estar vacío!';
$string['emptysubchapname'] = '¡El nombre del subcapítulo no puede estar vacío!';
$string['expandable_tree'] = 'Árbol expandible';
$string['hide'] = 'Ocultar';
$string['icon'] = 'Icono';
$string['keeppagenavigation'] = 'Mantener la navegación de página visible en la misma página';
$string['link'] = 'Enlace';
$string['linkfileorsite'] = 'Enlace a un archivo o sitio web';
$string['linknoname'] = 'El nombre del enlace no puede estar vacío. Por favor escriba el nombre del enlace.';
$string['linknourl'] = 'El nombre de la URL no puede estar vacío. Por favor escriba el nombre de la URL.';
$string['links'] = 'Enlaces';
$string['linkswrongnumber'] = '¡El número de enlaces debe ser un número correcto (dígitos solamente) y mayor de 1!';
$string['mycourses'] = 'Mis cursos';
$string['myprofile'] = 'Mi perfil';
$string['myprofilesettings'] = 'Configuraciones de mi perfil';
$string['name'] = 'Nombre';
$string['namescorm'] = 'SCORM';
$string['namesite'] = 'Sitio';
$string['namesitelevel'] = 'Nombre a nivel del sitio';
$string['namesiteleveldescription'] = 'Nombre alternativo que se mostrará en el encabezado del bloque a nivel del sitio';
$string['namesocial'] = 'Social';
$string['nametopics'] = 'Tema';
$string['nameweeks'] = 'Semana';
$string['newwindow'] = 'Nueva ventana';
$string['noicon'] = 'Sin icono';
$string['notapplicable'] = 'No aplicable';
$string['numberofchapter'] = 'Número de capítulos';
$string['numberoflinks'] = 'Número de enlaces personalizados';
$string['numberofsubchapter'] = 'Número de subcapítulos';
$string['participantlist'] = 'Lista de participantes';
$string['participants'] = 'Participantes';
$string['pluginname'] = 'Menú del curso';
$string['reports'] = 'Informes';
$string['samewindow'] = 'Misma ventana';
$string['show'] = 'Mostrar';
$string['showdirectorylinks'] = 'Mostrar los enlaces del directorio';
$string['showlocationbar'] = 'Mostrar la barra de localización';
$string['showmenubar'] = 'Mostrar barra de menú';
$string['showstatusbar'] = 'Mostrar barra de estado';
$string['showtoolbar'] = 'Mostrar barra de herramientas';
$string['sitepages'] = 'Páginas del sitio';
$string['subchapter'] = 'Subcapítulo';
$string['subchaptering'] = 'Activar Agrupamiento de Subcapítulo';
$string['subchapters'] = 'Subcapítulos';
$string['topics'] = 'Temas';
$string['topicsweeks'] = 'Temas/Semanas';
$string['trimlength'] = 'A cuántos caracteres se recortará';
$string['trimmode'] = 'Modo recortar nombre de sección';
$string['trimmodecenter'] = 'Cortar caracteres del centro';
$string['trimmodeleft'] = 'Cortar caracteres de la izquierda';
$string['trimmoderight'] = 'Cortar caracteres de la derecha';
$string['url'] = 'URL*';
$string['warningchapnochange'] = 'Al cambiar el número de capítulos, todos sus subcapítulos y configuraciones de subcapítulo se restaurarán a como eran antes por defecto. ¿Quiere continuar de todas formas?';
$string['warningsubchapenable'] = '¡Advertencia! Después de habilitar subcapíulos, se producirá un agrupamiento por defecto. ¿Desea continuar?';
$string['warningsubchapnochange'] = '¡Al cambiar el número de subcapítulos todas sus configuraciones de capítulo y subcapítulo se restaurarán a sus valores por defecto! ¿Quiere continuar de todas formas?';
$string['weeks'] = 'Semanas';
$string['window'] = 'Ventana';
$string['wrongnumber'] = '¡El número de capítulos debe ser un número correcto (solo dígitos), mayor que el número de subcapítulos y menor que el número de temas/semanas visibles !';
$string['wrongsubchapnumber'] = '¡El número de subcapítulos debe ser un número correcto (solo dígitos), mayor que el número de capítulos y menor que el número de temas/semanas visibles !';


text:
package net.spals.appbuilder.app.examples.grpc.rest.web;

import com.google.inject.Inject;
import com.google.protobuf.Descriptors.FieldDescriptor;
import io.grpc.stub.StreamObserver;
import net.spals.appbuilder.annotations.service.AutoBindSingleton;
import net.spals.appbuilder.app.examples.grpc.rest.*;
import net.spals.appbuilder.mapstore.core.MapStore;
import net.spals.appbuilder.mapstore.core.model.MapStoreKey;

import java.util.Map;
import java.util.Optional;
import java.util.UUID;
import java.util.stream.Collectors;

/**
 * A sample gRPC service using proto2
 * which has a complementary RESTful interface.
 *
 * @author tkral
 */
@AutoBindSingleton
public class UserGrpcServiceV2 extends UserServiceV2Grpc.UserServiceV2ImplBase {

    private final MapStore mapStore;

    @Inject
    UserGrpcServiceV2(final MapStore mapStore) {
        this.mapStore = mapStore;
    }

    @Override
    public void deleteUserV2(
        final DeleteUserRequestV2 request,
        final StreamObserver<DeleteUserResponseV2> responseObserver
    ) {
        final MapStoreKey userRecordKey = createUserRecordKey(request.getId());
        mapStore.deleteItem("users", userRecordKey);

        responseObserver.onNext(
            DeleteUserResponseV2.newBuilder()
                .setId(request.getId())
                .build()
        );
        responseObserver.onCompleted();
    }

    @Override
    public void getUserV2(
        final GetUserRequestV2 request,
        final StreamObserver<GetUserResponseV2> responseObserver
    ) {
        final MapStoreKey userRecordKey = createUserRecordKey(request.getId());
        final Optional<Map<String, Object>> userRecordMap = mapStore.getItem("users", userRecordKey);

        final GetUserResponseV2.Builder responseBuilder = GetUserResponseV2.newBuilder();
        userRecordMap.ifPresent(map -> {
            map.entrySet().stream()
                .filter(entry -> GetUserResponseV2.getDescriptor().findFieldByName(entry.getKey()) != null)
                .forEach(entry -> {
                    final FieldDescriptor fieldDescriptor = GetUserResponseV2.getDescriptor().findFieldByName(entry.getKey());
                    responseBuilder.setField(fieldDescriptor, entry.getValue());
                });
        });

        responseObserver.onNext(responseBuilder.build());
        responseObserver.onCompleted();
    }

    @Override
    public void postUserV2(
        final PostUserRequestV2 request,
        final StreamObserver<PostUserResponseV2> responseObserver
    ) {
        final String userId = UUID.randomUUID().toString();

        final MapStoreKey userRecordKey = createUserRecordKey(userId);
        final UserRecordV2 userRecord = UserRecordV2.newBuilder()
            .setId(userId)
            .setName(request.getName())
            .build();

        final Map<String, Object> userRecordMap = userRecord.getAllFields().entrySet().stream()
            .collect(Collectors.toMap(entry -> entry.getKey().getName(), Map.Entry::getValue));
        mapStore.putItem("users", userRecordKey, userRecordMap);

        responseObserver.onNext(
            PostUserResponseV2.newBuilder()
                .setId(userId)
                .setName(request.getName())
                .build()
        );
        responseObserver.onCompleted();
    }

    private MapStoreKey createUserRecordKey(final String userId) {
        return new MapStoreKey.Builder()
            .setHash("id", userId)
            .build();
    }
}


text:
package io.grpc.netty;

import io.grpc.Status;

/**
 * A command to trigger close and close all streams. It is buffered differently than normal close
 * and also includes reason for closure.
 */
class ForcefulCloseCommand extends WriteQueue.AbstractQueuedCommand {
  private final Status status;

  public ForcefulCloseCommand(Status status) {
    this.status = status;
  }

  public Status getStatus() {
    return status;
  }
}


text:
"""
This is the main point of entry.  It does some really ugly things to provide
end users with the most convenience.  It sets a global `SETTINGS` constant
so that users don't need to remember to pass settings or configuration when
creating new connections to new devices.
"""
from __future__ import print_function
import lib.router as router
import argparse
import yaml
import code
from lxml import etree

def parse_arguments():
    """
    Returns parsed CLI arguments.
    """
    arg_parser = argparse.ArgumentParser(description="Router Power Shell")
    arg_parser.add_argument("-d", "--device", help="Router hostname")
    return arg_parser.parse_args()

def parse_config():
    """
    Return the settings specified in `settings_file`.

    """
    settings_file = 'etc/settings.yml'
    with open(settings_file) as fname:
        return yaml.load(fname)

def connect(host):
    """
    Returns a router object, which should also connect the user to the router.
    """
    return router.Router(host=host,
                         user=SETTINGS['credentials']['username'],
                         password=SETTINGS['credentials']['password'])

def main():
    """
    Main point of entry for the script.  Parses arguments, creates
    connections, and creates an interactive Python interpreter.
    """
    args = parse_arguments()
    print("Krait Power Shell for Junos")
    print("Author: Tyler Christiansen <code@tylerc.me>")
    if args.device is not None:
        device = connect(host=args.device)
        print(etree.tostring(device.get_header()))

    # Start an interactive shell for end users to abuse junos-eznc! :)
    var = globals()
    var.update(locals())
    shell = code.InteractiveConsole(var)
    shell.interact()

# Ugly globalness to allow users to call connect more effortlessly from
# the shell
if __name__ == '__main__':
    SETTINGS = parse_config()
    main()


text:
'use strict';

// Transform interpolate system
// -----------------------------------------
new CONV.System.Interpolate({
    name: 'Interpolate',

    requiredDependencies: ['TransformInterpolate', 'TransformInterpolatePristine', 'TransformMatrix'],

    process: function (entities, interpolation) {
        _.each(entities, function (e) {
            var before = e.TransformInterpolatePristine,
                after = e.TransformInterpolate,
                beforePosition = before.position,
                beforeRotate = before.rotate,
                beforeScale = before.scale,
                afterPosition = after.position,
                afterRotate = after.rotate,
                afterScale = after.scale;

            afterPosition.lerp(beforePosition, 1 - interpolation);
            afterRotate.slerp(beforeRotate, 1 - interpolation);
            afterScale.lerp(beforeScale, 1 - interpolation);
            e.TransformMatrix.compose(afterPosition, afterRotate, afterScale);
        });
    },
});