text:
@class RawMessageSet;
@class RawMessageSet_Builder;
@class RawMessageSet_Item;
@class RawMessageSet_Item_Builder;
@class TestMessageSet;
@class TestMessageSetContainer;
@class TestMessageSetContainer_Builder;
@class TestMessageSetExtension1;
@class TestMessageSetExtension1_Builder;
@class TestMessageSetExtension2;
@class TestMessageSetExtension2_Builder;
@class TestMessageSet_Builder;

@interface UnittestMsetRoot : NSObject {
}
+ (PBExtensionRegistry*) extensionRegistry;
+ (void) registerAllExtensions:(PBMutableExtensionRegistry*) registry;
@end

@interface TestMessageSet : PBExtendableMessage {
@private
}

+ (TestMessageSet*) defaultInstance;
- (TestMessageSet*) defaultInstance;

- (BOOL) isInitialized;
- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output;
- (TestMessageSet_Builder*) builder;
+ (TestMessageSet_Builder*) builder;
+ (TestMessageSet_Builder*) builderWithPrototype:(TestMessageSet*) prototype;

+ (TestMessageSet*) parseFromData:(NSData*) data;
+ (TestMessageSet*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
+ (TestMessageSet*) parseFromInputStream:(NSInputStream*) input;
+ (TestMessageSet*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
+ (TestMessageSet*) parseFromCodedInputStream:(PBCodedInputStream*) input;
+ (TestMessageSet*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
@end

@interface TestMessageSet_Builder : PBExtendableMessage_Builder {
@private
  TestMessageSet* result;
}

- (TestMessageSet*) defaultInstance;

- (TestMessageSet_Builder*) clear;
- (TestMessageSet_Builder*) clone;

- (TestMessageSet*) build;
- (TestMessageSet*) buildPartial;

- (TestMessageSet_Builder*) mergeFrom:(TestMessageSet*) other;
- (TestMessageSet_Builder*) mergeFromCodedInputStream:(PBCodedInputStream*) input;
- (TestMessageSet_Builder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
@end

@interface TestMessageSetContainer : PBGeneratedMessage {
@private
  BOOL hasMessageSet_:1;
  TestMessageSet* messageSet;
}
- (BOOL) hasMessageSet;
@property (readonly, retain) TestMessageSet* messageSet;

+ (TestMessageSetContainer*) defaultInstance;
- (TestMessageSetContainer*) defaultInstance;

- (BOOL) isInitialized;
- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output;
- (TestMessageSetContainer_Builder*) builder;
+ (TestMessageSetContainer_Builder*) builder;
+ (TestMessageSetContainer_Builder*) builderWithPrototype:(TestMessageSetContainer*) prototype;

+ (TestMessageSetContainer*) parseFromData:(NSData*) data;
+ (TestMessageSetContainer*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
+ (TestMessageSetContainer*) parseFromInputStream:(NSInputStream*) input;
+ (TestMessageSetContainer*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
+ (TestMessageSetContainer*) parseFromCodedInputStream:(PBCodedInputStream*) input;
+ (TestMessageSetContainer*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
@end

@interface TestMessageSetContainer_Builder : PBGeneratedMessage_Builder {
@private
  TestMessageSetContainer* result;
}

- (TestMessageSetContainer*) defaultInstance;

- (TestMessageSetContainer_Builder*) clear;
- (TestMessageSetContainer_Builder*) clone;

- (TestMessageSetContainer*) build;
- (TestMessageSetContainer*) buildPartial;

- (TestMessageSetContainer_Builder*) mergeFrom:(TestMessageSetContainer*) other;
- (TestMessageSetContainer_Builder*) mergeFromCodedInputStream:(PBCodedInputStream*) input;
- (TestMessageSetContainer_Builder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;

- (BOOL) hasMessageSet;
- (TestMessageSet*) messageSet;
- (TestMessageSetContainer_Builder*) setMessageSet:(TestMessageSet*) value;
- (TestMessageSetContainer_Builder*) setMessageSetBuilder:(TestMessageSet_Builder*) builderForValue;
- (TestMessageSetContainer_Builder*) mergeMessageSet:(TestMessageSet*) value;
- (TestMessageSetContainer_Builder*) clearMessageSet;
@end

@interface TestMessageSetExtension1 : PBGeneratedMessage {
@private
  BOOL hasI_:1;
  int32_t i;
}
- (BOOL) hasI;
@property (readonly) int32_t i;

+ (TestMessageSetExtension1*) defaultInstance;
- (TestMessageSetExtension1*) defaultInstance;

+ (id<PBExtensionField>) messageSetExtension;
- (BOOL) isInitialized;
- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output;
- (TestMessageSetExtension1_Builder*) builder;
+ (TestMessageSetExtension1_Builder*) builder;
+ (TestMessageSetExtension1_Builder*) builderWithPrototype:(TestMessageSetExtension1*) prototype;

+ (TestMessageSetExtension1*) parseFromData:(NSData*) data;
+ (TestMessageSetExtension1*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
+ (TestMessageSetExtension1*) parseFromInputStream:(NSInputStream*) input;
+ (TestMessageSetExtension1*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
+ (TestMessageSetExtension1*) parseFromCodedInputStream:(PBCodedInputStream*) input;
+ (TestMessageSetExtension1*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
@end

@interface TestMessageSetExtension1_Builder : PBGeneratedMessage_Builder {
@private
  TestMessageSetExtension1* result;
}

- (TestMessageSetExtension1*) defaultInstance;

- (TestMessageSetExtension1_Builder*) clear;
- (TestMessageSetExtension1_Builder*) clone;

- (TestMessageSetExtension1*) build;
- (TestMessageSetExtension1*) buildPartial;

- (TestMessageSetExtension1_Builder*) mergeFrom:(TestMessageSetExtension1*) other;
- (TestMessageSetExtension1_Builder*) mergeFromCodedInputStream:(PBCodedInputStream*) input;
- (TestMessageSetExtension1_Builder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;

- (BOOL) hasI;
- (int32_t) i;
- (TestMessageSetExtension1_Builder*) setI:(int32_t) value;
- (TestMessageSetExtension1_Builder*) clearI;
@end

@interface TestMessageSetExtension2 : PBGeneratedMessage {
@private
  BOOL hasStr_:1;
  NSString* str;
}
- (BOOL) hasStr;
@property (readonly, retain) NSString* str;

+ (TestMessageSetExtension2*) defaultInstance;
- (TestMessageSetExtension2*) defaultInstance;

+ (id<PBExtensionField>) messageSetExtension;
- (BOOL) isInitialized;
- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output;
- (TestMessageSetExtension2_Builder*) builder;
+ (TestMessageSetExtension2_Builder*) builder;
+ (TestMessageSetExtension2_Builder*) builderWithPrototype:(TestMessageSetExtension2*) prototype;

+ (TestMessageSetExtension2*) parseFromData:(NSData*) data;
+ (TestMessageSetExtension2*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
+ (TestMessageSetExtension2*) parseFromInputStream:(NSInputStream*) input;
+ (TestMessageSetExtension2*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
+ (TestMessageSetExtension2*) parseFromCodedInputStream:(PBCodedInputStream*) input;
+ (TestMessageSetExtension2*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
@end

@interface TestMessageSetExtension2_Builder : PBGeneratedMessage_Builder {
@private
  TestMessageSetExtension2* result;
}

- (TestMessageSetExtension2*) defaultInstance;

- (TestMessageSetExtension2_Builder*) clear;
- (TestMessageSetExtension2_Builder*) clone;

- (TestMessageSetExtension2*) build;
- (TestMessageSetExtension2*) buildPartial;

- (TestMessageSetExtension2_Builder*) mergeFrom:(TestMessageSetExtension2*) other;
- (TestMessageSetExtension2_Builder*) mergeFromCodedInputStream:(PBCodedInputStream*) input;
- (TestMessageSetExtension2_Builder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;

- (BOOL) hasStr;
- (NSString*) str;
- (TestMessageSetExtension2_Builder*) setStr:(NSString*) value;
- (TestMessageSetExtension2_Builder*) clearStr;
@end

@interface RawMessageSet : PBGeneratedMessage {
@private
  NSMutableArray* mutableItemList;
}
- (NSArray*) itemList;
- (RawMessageSet_Item*) itemAtIndex:(int32_t) index;

+ (RawMessageSet*) defaultInstance;
- (RawMessageSet*) defaultInstance;

- (BOOL) isInitialized;
- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output;
- (RawMessageSet_Builder*) builder;
+ (RawMessageSet_Builder*) builder;
+ (RawMessageSet_Builder*) builderWithPrototype:(RawMessageSet*) prototype;

+ (RawMessageSet*) parseFromData:(NSData*) data;
+ (RawMessageSet*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
+ (RawMessageSet*) parseFromInputStream:(NSInputStream*) input;
+ (RawMessageSet*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
+ (RawMessageSet*) parseFromCodedInputStream:(PBCodedInputStream*) input;
+ (RawMessageSet*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
@end

@interface RawMessageSet_Item : PBGeneratedMessage {
@private
  BOOL hasTypeId_:1;
  BOOL hasMessage_:1;
  int32_t typeId;
  NSData* message;
}
- (BOOL) hasTypeId;
- (BOOL) hasMessage;
@property (readonly) int32_t typeId;
@property (readonly, retain) NSData* message;

+ (RawMessageSet_Item*) defaultInstance;
- (RawMessageSet_Item*) defaultInstance;

- (BOOL) isInitialized;
- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output;
- (RawMessageSet_Item_Builder*) builder;
+ (RawMessageSet_Item_Builder*) builder;
+ (RawMessageSet_Item_Builder*) builderWithPrototype:(RawMessageSet_Item*) prototype;

+ (RawMessageSet_Item*) parseFromData:(NSData*) data;
+ (RawMessageSet_Item*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
+ (RawMessageSet_Item*) parseFromInputStream:(NSInputStream*) input;
+ (RawMessageSet_Item*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
+ (RawMessageSet_Item*) parseFromCodedInputStream:(PBCodedInputStream*) input;
+ (RawMessageSet_Item*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;
@end

@interface RawMessageSet_Item_Builder : PBGeneratedMessage_Builder {
@private
  RawMessageSet_Item* result;
}

- (RawMessageSet_Item*) defaultInstance;

- (RawMessageSet_Item_Builder*) clear;
- (RawMessageSet_Item_Builder*) clone;

- (RawMessageSet_Item*) build;
- (RawMessageSet_Item*) buildPartial;

- (RawMessageSet_Item_Builder*) mergeFrom:(RawMessageSet_Item*) other;
- (RawMessageSet_Item_Builder*) mergeFromCodedInputStream:(PBCodedInputStream*) input;
- (RawMessageSet_Item_Builder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;

- (BOOL) hasTypeId;
- (int32_t) typeId;
- (RawMessageSet_Item_Builder*) setTypeId:(int32_t) value;
- (RawMessageSet_Item_Builder*) clearTypeId;

- (BOOL) hasMessage;
- (NSData*) message;
- (RawMessageSet_Item_Builder*) setMessage:(NSData*) value;
- (RawMessageSet_Item_Builder*) clearMessage;
@end

@interface RawMessageSet_Builder : PBGeneratedMessage_Builder {
@private
  RawMessageSet* result;
}

- (RawMessageSet*) defaultInstance;

- (RawMessageSet_Builder*) clear;
- (RawMessageSet_Builder*) clone;

- (RawMessageSet*) build;
- (RawMessageSet*) buildPartial;

- (RawMessageSet_Builder*) mergeFrom:(RawMessageSet*) other;
- (RawMessageSet_Builder*) mergeFromCodedInputStream:(PBCodedInputStream*) input;
- (RawMessageSet_Builder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry;

- (NSArray*) itemList;
- (RawMessageSet_Item*) itemAtIndex:(int32_t) index;
- (RawMessageSet_Builder*) replaceItemAtIndex:(int32_t) index with:(RawMessageSet_Item*) value;
- (RawMessageSet_Builder*) addItem:(RawMessageSet_Item*) value;
- (RawMessageSet_Builder*) addAllItem:(NSArray*) values;
- (RawMessageSet_Builder*) clearItemList;
@end


text:
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

CREATE TABLE IF NOT EXISTS `comments` (
  `id` int(11) NOT NULL,
  `entry_id` int(10) DEFAULT NULL,
  `author` varchar(128) DEFAULT NULL,
  `email` varchar(255) NOT NULL,
  `comment` text,
  `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `entry` (
  `id` int(10) NOT NULL,
  `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `title` varchar(512) DEFAULT NULL,
  `author_id` int(11) DEFAULT NULL,
  `content` text
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `users` (
  `id` int(11) NOT NULL,
  `username` varchar(256) NOT NULL,
  `password` varchar(256) NOT NULL,
  `enabled` tinyint(4) NOT NULL DEFAULT '1'
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `user_roles` (
  `user_role_id` int(11) NOT NULL,
  `username` varchar(45) NOT NULL,
  `ROLE` varchar(45) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

ALTER TABLE `comments`
  ADD PRIMARY KEY (`id`), ADD KEY `entry_id` (`entry_id`);

ALTER TABLE `entry`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `users`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `user_roles`
  ADD PRIMARY KEY (`user_role_id`), ADD UNIQUE KEY `uni_username_role` (`ROLE`,`username`);

ALTER TABLE `comments`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=4;
ALTER TABLE `entry`
  MODIFY `id` int(10) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3;
ALTER TABLE `users`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
ALTER TABLE `user_roles`
  MODIFY `user_role_id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;

ALTER TABLE `comments`
ADD CONSTRAINT `comments_ibfk_1` FOREIGN KEY (`entry_id`) REFERENCES `entry` (`id`);

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

redpajama_set_name: RedPajamaGithub


text:
package com.ibasco.agql.protocols.valve.source.query;

import com.ibasco.agql.core.transport.NettyChannelFactory;
import com.ibasco.agql.core.transport.NettyChannelFactoryInitializer;
import com.ibasco.agql.protocols.valve.source.query.challenge.SourceQueryChallengeDecoder;
import com.ibasco.agql.protocols.valve.source.query.challenge.SourceQueryChallengeEncoder;
import com.ibasco.agql.protocols.valve.source.query.common.handlers.SourceQueryPacketDecoder;
import com.ibasco.agql.protocols.valve.source.query.common.handlers.SourceQuerySplitPacketAssembler;
import com.ibasco.agql.protocols.valve.source.query.info.SourceQueryInfoDecoder;
import com.ibasco.agql.protocols.valve.source.query.info.SourceQueryInfoEncoder;
import com.ibasco.agql.protocols.valve.source.query.players.SourceQueryPlayersDecoder;
import com.ibasco.agql.protocols.valve.source.query.players.SourceQueryPlayersEncoder;
import com.ibasco.agql.protocols.valve.source.query.rules.SourceQueryRulesDecoder;
import com.ibasco.agql.protocols.valve.source.query.rules.SourceQueryRulesEncoder;
import io.netty.channel.ChannelInboundHandler;
import io.netty.channel.ChannelOutboundHandler;
import java.util.LinkedList;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *
SourceQueryChannelFactory class.

 *
 * @author Rafael Luis Ibasco
 */
public class SourceQueryChannelFactory extends NettyChannelFactoryInitializer {

    private static final Logger log = LoggerFactory.getLogger(SourceQueryChannelFactory.class);

    /**
     *
Constructor for SourceQueryChannelFactory.

     *
     * @param channelFactory
     *         a {@link com.ibasco.agql.core.transport.NettyChannelFactory} object
     */
    public SourceQueryChannelFactory(final NettyChannelFactory channelFactory) {
        super(channelFactory);
    }

    /** {@inheritDoc} */
    @Override
    public void registerInboundHandlers(final LinkedList<ChannelInboundHandler> handlers) {
        log.debug("INIT => Registering Source Query INBOUND Handlers");
        handlers.addLast(new SourceQueryPacketDecoder());
        handlers.addLast(new SourceQuerySplitPacketAssembler());
        handlers.addLast(new SourceQueryChallengeDecoder());
        handlers.addLast(new SourceQueryInfoDecoder());
        handlers.addLast(new SourceQueryPlayersDecoder());
        handlers.addLast(new SourceQueryRulesDecoder());
    }

    /** {@inheritDoc} */
    @Override
    public void registerOutboundHandlers(final LinkedList<ChannelOutboundHandler> handlers) {
        log.debug("INIT => Registering Source Query OUTBOUND Handlers");
        handlers.addLast(new SourceQueryChallengeEncoder());
        handlers.addLast(new SourceQueryInfoEncoder());
        handlers.addLast(new SourceQueryPlayersEncoder());
        handlers.addLast(new SourceQueryRulesEncoder());
    }
}


text:
pub use mydht_base::*;
use msgenc::bincode::Bincode;
use msgenc::MsgEnc;
use transport::Transport;
use transport::udp::Udp;
use utils::SocketAddrExt;
use utils;
use keyval::KeyVal;
use std::net::{SocketAddr,Ipv4Addr};
use kvstore::StoragePriority;
use query::{QueryConf,QueryMode,QueryChunk,QueryPriority};
use super::{
  initpeers,
  ALLTESTMODE,
  DHTRULES_DEFAULT,
};
use rules::simplerules::{DhtRules};
use peer::test::TestingRules;
#[cfg(test)]
use node::Node;
use DHT;
use peer::PeerMgmtMeths;
use procs::RunningTypes;
use std::marker::PhantomData;
use rules::simplerules::SimpleRules;
use num::traits::ToPrimitive;
use procs::ClientMode;

#[cfg(test)]
use transport::test::connect_rw_with_optional_non_managed;

struct RunningTypesImpl<M : PeerMgmtMeths<Node, Node>, T : Transport, E : MsgEnc> (PhantomData<(M,T,E)>);

impl<M : PeerMgmtMeths<Node, Node>, T : Transport<Address=SocketAddr>, E : MsgEnc> RunningTypes for RunningTypesImpl<M, T, E> {
  type A = SocketAddr;
  type P = Node;
  type V = Node;
  type M = M;
  type R = SimpleRules;
  type E = E;
  type T = T;
}

#[test]
fn connect_rw () {
  let start_port = 60000;

  let a1 = SocketAddrExt(utils::sa4(Ipv4Addr::new(127,0,0,1), start_port));
  let a2 = SocketAddrExt(utils::sa4(Ipv4Addr::new(127,0,0,1), start_port+1));
  let tcp_transport_1 : Udp = Udp::new (&a1, 500, true).unwrap();
  let tcp_transport_2 : Udp = Udp::new (&a2, 500, true).unwrap();

  connect_rw_with_optional_non_managed(tcp_transport_1,tcp_transport_2,&a1,&a2,false,false,false);
}

#[test]
fn connect_rw_nospawn () {
  let start_port = 60100;

  let a1 = SocketAddrExt(utils::sa4(Ipv4Addr::new(127,0,0,1), start_port));
  let a2 = SocketAddrExt(utils::sa4(Ipv4Addr::new(127,0,0,1), start_port+1));
  let tcp_transport_1 : Udp = Udp::new (&a1, 500, false).unwrap();
  let tcp_transport_2 : Udp = Udp::new (&a2, 500, false).unwrap();

  connect_rw_with_optional_non_managed(tcp_transport_1,tcp_transport_2,&a1,&a2,false,false,true);
}

fn initpeers_udp<M : PeerMgmtMeths<Node, Node> + Clone> (start_port : u16, nbpeer : usize, map : &[&[usize]], meths : M, rules : DhtRules, sim : Option<u32>) -> Vec<(Node, DHT<RunningTypesImpl<M,Udp,Bincode>>)>{
  let mut nodes = Vec::new();
  let mut transports = Vec::new();

  for i in 0 .. nbpeer {
    let addr = utils::sa4(Ipv4Addr::new(127,0,0,1), start_port + i.to_u16().unwrap());
    let udp_transport = Udp::new(&addr,2048,true).unwrap(); // here udp with a json encoding with last sed over a few hop : we need a big buffer
    transports.push(udp_transport);
    nodes.push(Node {nodeid: "NodeID".to_string() + &(i + 1).to_string()[..], address : SocketAddrExt(addr)});
  };
  initpeers(nodes, transports, map, meths, rules,Bincode,sim)
}

#[test]
fn simpeer2hopfindval_udp () {
    let nbpeer = 4;
    // addr dummy (used as keyval so no ping validation)
    let addr = utils::sa4(Ipv4Addr::new(127,0,0,1), 999);
    let val = Node {nodeid: "to_find".to_string(), address : SocketAddrExt(addr)};

    let map : &[&[usize]] = &[&[],&[1,3],&[],&[3]];

    let mut startport = 73440;
    let prio = 1;

    let mut rules = DHTRULES_DEFAULT.clone();
    rules.clientmode = ClientMode::Local(true);
    rules.nbhopfact = 3;
    let peers = initpeers_udp(startport,nbpeer, map, TestingRules::new_no_delay(), rules, Some(2000));
    let ref dest = peers.get(nbpeer -1).unwrap().1;
    for conf in ALLTESTMODE.iter(){
      let queryconf = QueryConf {
        mode : conf.clone(),
        chunk : QueryChunk::None,
        hop_hist : Some((7,false))
      };
      assert!(dest.store_val(val.clone(), &queryconf, prio, StoragePriority::Local));
      let res = peers.get(0).unwrap().1.find_val(val.get_key().clone(), &queryconf, prio,StoragePriority::NoStore, 1).pop().unwrap_or(None);
      assert_eq!(res, Some(val.clone()));
    }
}

#[test]
fn testpeer2hopfindval_udp () {
    let nbpeer = 4;
    // addr dummy (used as keyval so no ping validation)
    let addr = utils::sa4(Ipv4Addr::new(127,0,0,1), 999);
    let val = Node {nodeid: "to_find".to_string(), address : SocketAddrExt(addr)};

    let map : &[&[usize]] = &[&[2],&[3],&[4],&[]];

    let mut startport = 74440;
    let prio = 1;

    let mut rules = DHTRULES_DEFAULT.clone();
    rules.clientmode = ClientMode::Local(false);
    rules.nbhopfact = 3;
    let peers = initpeers_udp(startport,nbpeer, map, TestingRules::new_no_delay(),rules,None);
    let ref dest = peers.get(nbpeer -1).unwrap().1;
    for conf in ALLTESTMODE.iter(){
      let queryconf = QueryConf {
        mode : conf.clone(),
        chunk : QueryChunk::None,
        hop_hist : Some((7,false))
      };
      assert!(dest.store_val(val.clone(), &queryconf, prio, StoragePriority::Local));
      let res = peers.get(0).unwrap().1.find_val(val.get_key().clone(), &queryconf, prio,StoragePriority::NoStore, 1).pop().unwrap_or(None);
      assert_eq!(res, Some(val.clone()));
    }
}


text:
<template class="template">
  Peak Detection:

    <input type="checkbox" class="peak-input" checked>

</template>


text:
const mongoose = require("mongoose");

const Schema = mongoose.Schema;

const PayPalAccount = new Schema(
    {
        email: String,
        name: String,
        payerId: String,
        countryCode: String,
    },
    { _id: false }
);

module.exports = PayPalAccount;


text:
extern "C" {
#endif  // __cplusplus

struct iree_task_executor_t {
  iree_atomic_ref_count_t ref_count;
  iree_allocator_t allocator;

  // Defines how work is selected across queues.
  // TODO(benvanik): make mutable; currently always the same reserved value.
  iree_task_scheduling_mode_t scheduling_mode;

  // Time each worker should spin before parking itself to wait for more work.
  // IREE_DURATION_ZERO is used to disable spinning.
  iree_duration_t worker_spin_ns;

  // State used by the work-stealing operations performed by donated threads.
  // This is **NOT SYNCHRONIZED** and relies on the fact that we actually don't
  // much care about the precise selection of workers enough to mind any tears
  // we get in the PRNG state that lives inside. Cache write-back order and
  // incidental cache line availability/visibility update frequency is like an
  // extra layer of PRNG anyway ;)
  iree_prng_minilcg128_state_t donation_theft_prng;

  // Pools of transient dispatch tasks shared across all workers.
  // Depending on configuration the task pool may allocate after creation using
  // the allocator provided upon executor creation.
  //
  // Sized to be able to fit at least:
  //   iree_task_fence_t
  //   iree_task_dispatch_shard_t
  // Increasing the size larger than these will waste memory.
  iree_task_pool_t transient_task_pool;

  // A list of incoming tasks that are ready to execute immediately.
  // The list is LIFO and we require that task lists are reversed by the
  // submitter so we can use iree_atomic_slist_concat to quickly prepend the
  // LIFO list to the atomic slist. By doing this we can construct the task
  // lists in LIFO order prior to submission, concat with a pointer swap into
  // this list, flush from the list in LIFO order during coordination, and do a
  // single LIFO->FIFO conversion while distributing work. What could have been
  // half a dozen task list pointer walks and inverted sequential memory access
  // becomes one.
  //
  // Example:
  //   existing tasks: C B A
  //        new tasks: 1 2 3
  //    updated tasks: 3 2 1 C B A
  iree_atomic_task_slist_t incoming_ready_slist;

  // iree_event_t pool used to acquire system wait handles.
  // Many subsystems interacting with the executor will need events to park
  // their work in the wait set and sharing the pool across all of them ensures
  // we limit the number we have outstanding and avoid syscalls to allocate
  // them.
  iree_event_pool_t* event_pool;

  // Guards coordination logic; only one thread at a time may be acting as the
  // coordinator.
  iree_slim_mutex_t coordinator_mutex;

  // Wait task polling and wait thread manager.
  // This handles all system waits so that we can keep the syscalls off the
  // worker threads and lower wake latencies (the wait thread can enqueue
  // completed waits immediately after they resolve instead of waiting for
  // existing computation on the workers to finish).
  iree_task_poller_t poller;

  // A bitset indicating which workers are likely to be live and usable; all
  // attempts to push work onto a particular worker should check first with this
  // mask. This may change over time either automatically or by user request
  // ("don't use these cores for awhile I'm going to be using them" etc).
  //
  // This mask is just a hint, accessed with memory_order_relaxed. Readers must
  // be OK with getting slightly out-of-date information. The only way to get
  // an authoritative answer to the question "is this worker live" is to
  // atomically query worker->state. This mask is for usage patterns where one
  // needs a cheap (single relaxed atomic op) approximation of all N workers'
  // live state without having to perform N expensive atomic ops.
  iree_atomic_task_affinity_set_t worker_live_mask;

  // A bitset indicating which workers are currently idle. Used to bias incoming
  // tasks to workers that aren't doing much else. This is a balance of latency
  // to wake the idle workers vs. latency to wait for existing work to complete
  // on already woken workers.
  //
  // This mask is just a hint, accessed with memory_order_relaxed. See the
  // comment on worker_live_mask.
  iree_atomic_task_affinity_set_t worker_idle_mask;

  // Base value added to each executor-local worker index.
  // This allows workers to uniquely identify themselves in multi-executor
  // configurations.
  iree_host_size_t worker_base_index;

  // Specifies how many workers threads there are.
  // For now this number is fixed per executor however if we wanted to enable
  // live join/leave behavior we could change this to a registration mechanism.
  iree_host_size_t worker_count;
  iree_task_worker_t* workers;  // [worker_count]
};

// Merges a submission into the primary FIFO queues.
// Coordinators will fetch items from here as workers demand them but otherwise
// not be notified of the changes (waiting until coordination runs again).
//
// May be called from any thread.
void iree_task_executor_merge_submission(iree_task_executor_t* executor,
                                         iree_task_submission_t* submission);

// Schedules all ready tasks in the |pending_submission| list.
// Only called during coordination and expects the coordinator lock to be held.
void iree_task_executor_schedule_ready_tasks(
    iree_task_executor_t* executor, iree_task_submission_t* pending_submission,
    iree_task_post_batch_t* post_batch);

// Dispatches tasks in the global submission queue to workers.
// |current_worker| will be NULL if called from a non-worker thread and
// otherwise be the current worker; used to avoid round-tripping through the
// whole system to post to oneself.
//
// If the |current_worker| has no more work remaining then the calling thread
// may wait on any pending wait tasks until one resolves or more work is
// scheduled for the worker. If no worker is provided the call will return
// without waiting.
void iree_task_executor_coordinate(iree_task_executor_t* executor,
                                   iree_task_worker_t* current_worker);

// Tries to steal an entire task from a sibling worker (based on topology).
// Returns a task that is available (has not yet begun processing at all).
// May steal multiple tasks and add them to the |local_task_queue|.
iree_task_t* iree_task_executor_try_steal_task(
    iree_task_executor_t* executor,
    iree_task_affinity_set_t constructive_sharing_mask,
    uint32_t max_theft_attempts, iree_prng_minilcg128_state_t* theft_prng,
    iree_task_queue_t* local_task_queue);

#ifdef __cplusplus
}  // extern "C"
#endif  // __cplusplus

#endif  // IREE_TASK_EXECUTOR_IMPL_H_


text:
namespace Microsoft.Azure.EventGrid.Models
{
    using Newtonsoft.Json;
    using System.Linq;

    /// <summary>
    /// The thumbprint is a unique value for the x509 certificate, commonly
    /// used to find a particular certificate in a certificate store. The
    /// thumbprint is dynamically generated using the SHA1 algorithm, and does
    /// not physically exist in the certificate.
    /// </summary>
    public partial class DeviceTwinInfoX509Thumbprint
    {
        /// <summary>
        /// Initializes a new instance of the DeviceTwinInfoX509Thumbprint
        /// class.
        /// </summary>
        public DeviceTwinInfoX509Thumbprint()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the DeviceTwinInfoX509Thumbprint
        /// class.
        /// </summary>
        /// <param name="primaryThumbprint">Primary thumbprint for the x509
        /// certificate.</param>
        /// <param name="secondaryThumbprint">Secondary thumbprint for the x509
        /// certificate.</param>
        public DeviceTwinInfoX509Thumbprint(string primaryThumbprint = default(string), string secondaryThumbprint = default(string))
        {
            PrimaryThumbprint = primaryThumbprint;
            SecondaryThumbprint = secondaryThumbprint;
            CustomInit();
        }

        /// <summary>
        /// An initialization method that performs custom operations like setting defaults
        /// </summary>
        partial void CustomInit();

        /// <summary>
        /// Gets or sets primary thumbprint for the x509 certificate.
        /// </summary>
        [JsonProperty(PropertyName = "primaryThumbprint")]
        public string PrimaryThumbprint { get; set; }

        /// <summary>
        /// Gets or sets secondary thumbprint for the x509 certificate.
        /// </summary>
        [JsonProperty(PropertyName = "secondaryThumbprint")]
        public string SecondaryThumbprint { get; set; }

    }
}


text:
package org.odata4j.core;

/**
 * An ORelatedEntityLink represents a relationship to a single OData entity.
 *
 *
The {@link OLinks} static factory class can be used to create ORelatedEntityLink instances.

 *
 * @see OLinks
 */
public interface ORelatedEntityLink extends OLink {

}


text:
package org.projecte.egradus.repository;

import java.util.List;

import org.projecte.egradus.domain.Pregunta;
import org.projecte.egradus.domain.PreguntaQuestionari;
import org.projecte.egradus.domain.Questionari;

public interface PreguntaQuestionariDao {

	/**
	 * Insereix una relació pregunta-questionari
	 *
	 * @param preguntaQuestionari
	 */
	public void persistPreguntaQuestionari(PreguntaQuestionari preguntaQuestionari);

	/**
	 * Agafa totes les relacions pregunta-questionari
	 *
	 * @return
	 */
	public List<PreguntaQuestionari> getRelacionsPreguntaQuestionari();

	/**
	 * Agafa la relació pregunta-questionari identificada
	 * per la pregunta i questionari passats per paràmetre
	 *
	 * @param pregunta
	 * @param questionari
	 * @return
	 */
	public List<PreguntaQuestionari> getPreguntaQuestionari(Pregunta pregunta, Questionari questionari);

	/**
	 * Agafa totes les relacions pregunta-questionari de la
	 * pregunta passada per paràmetre
	 *
	 * @param pregunta
	 * @return
	 */
	public List<PreguntaQuestionari> getRelacionsPreguntaQuestionari(Pregunta pregunta);

	/**
	 * Agafa totes les relacions pregunta-questionari del
	 * questionari passat per paràmetre
	 *
	 * @param questionari
	 * @return
	 */
	public List<PreguntaQuestionari> getRelacionsPreguntaQuestionari(Questionari questionari);

	/**
	 * Agafa la relació pregunta-questionari identificada
	 * pel codi passat per paràmetre
	 *
	 * @param codi
	 * @return
	 */
	public PreguntaQuestionari getPreguntaQuestionariByCodi(int codi);

	/**
	 * Actualitza la relació pregunta-questionari passada
	 * per paràmetre
	 *
	 * @param preguntaQuestionari
	 * @return
	 */
	public PreguntaQuestionari updatePreguntaQuestionari(PreguntaQuestionari preguntaQuestionari);

	/**
	 * Elimina la relació pregunta-questionari passada
	 * per paràmetre
	 *
	 * @param preguntaQuestionari
	 */
	public void removePreguntaQuestionari(PreguntaQuestionari preguntaQuestionari);

}


text:
#ifndef __FRAMEWORK_H__
#define __FRAMEWORK_H__

#include "stdafx.h"

#endif


text:
#include "Command.h"
#include "Line.h"
#include "LineTelnet.h"
#include "Interface.h"
#include "CommandTree.h"
#include "InterfaceMgr.h"
#include "Frame.h"
#include "Core.h"
#include "DTPProcess.h"
#include "PortSecurity.h"

extern CommandTree g_commands;
extern InterfaceMgr g_interfaces;
extern Core g_switch;

Interface::Interface(const char *sName, MAC addr)
{
	char *sPos;

	memset(m_sDescription, 0, sizeof(m_sDescription));

	strncpy(m_sName, sName, MAX_NAME_LEN-1);

	memset(m_sNameShort, 0, MAX_NAME_LEN);
	memcpy(m_sNameShort, sName, 2);
	sPos = strpbrk(m_sName, "1234567890/");
	if (sPos)
		memcpy(m_sNameShort+2, sPos, strlen(sPos));

	// administratively down / down
	m_bShutdown = true;
	m_bLineState = false;
	m_bProtoState = false;

	m_hwAddr = addr;

	m_bIsTrunk = false;
	m_swAccessVlan = 1;
	m_swNativeVlan = 1;

	m_pDTPProc = new DTPProcess(this);
	m_pPortSecurityProc = new PortSecurity(this);

	//TODO: zapnut dtp
}

Interface::~Interface(void)
{
	if (!m_bShutdown)
		shutdown();
}

void Interface::start() {
	if (m_pDTPProc)
		m_pDTPProc->start();
}

bool Interface::open()
{
	if (!m_bShutdown)
		return false;

	m_bShutdown = false;

	return true;
}

bool Interface::shutdown()
{
	if (m_bShutdown)
		return false;

	m_bShutdown = true;
	m_bLineState = false;
	m_bProtoState = false;

	onDown();

	return true;
}

void Interface::setDescription(char *sDescription)
{
	strncpy(m_sDescription, sDescription, MAX_DESC_LEN-1);
}

BYTE * Interface::encapsulateDot1q(Frame *pFrame) {
	static BYTE pClone[Frame::MAX_LEN + 4];
	BYTE *pData = pFrame->getData();

	// da + sa
	memcpy(pClone, pData, 12);

	// VLAN tag
	pClone[12] = 0x81;
	pClone[13] = 0x00;
	*((WORD*)&(pClone[14])) = htons(pFrame->vlan);

	// ethertype a zvysok
	memcpy(pClone+16, pData+12, pFrame->getLen() - 12);

	return pClone;
}

void Interface::registerProcess(Process *pProc, int nPrio)
{
	m_processes.push(pProc, nPrio);
}

void Interface::unregisterProcess(Process *pProc)
{
	m_processes.remove(pProc);
}

Frame *Interface::onRecv(Frame *pFrame) {
	bool bPass = true;
	ProcessList::iterator it;

	for (it=m_processes.begin(); it!=m_processes.end(); ++it)
		bPass &= (*it)->m_pProc->onRecv(pFrame);

	if (!bPass) {
		delete pFrame;
		pFrame = 0;
	}

	return pFrame;
}

void Interface::onUp() {
	ProcessList::iterator it;

	g_switch.updateEventList();
	g_pCon0->syslog("%%LINEPROTO-5-UPDOWN: Line protocol on Interface %s, changed state to up", m_sName);

	for (it=m_processes.begin(); it!=m_processes.end(); ++it)
		(*it)->m_pProc->onUp(this);
}

void Interface::onDown() {
	ProcessList::iterator it;

	g_switch.updateEventList();
	g_pCon0->syslog("%%LINEPROTO-5-UPDOWN: Line protocol on Interface %s, changed state to down", m_sName);

	for (it=m_processes.begin(); it!=m_processes.end(); ++it)
		(*it)->m_pProc->onDown(this);
}

bool Interface::onSend(Frame *pFrame) {
	bool bPass = true;
	ProcessList::iterator it;

	for (it=m_processes.begin(); it!=m_processes.end(); ++it)
		bPass &= (*it)->m_pProc->onSend(pFrame);

	return bPass;
}

void Interface::registerCommands() {
	g_commands.registerCommand(MODE_CONF_IF, 15, "switchport", "Set switching mode characteristics");

	g_commands.registerCommand(MODE_CONF_IF, 15, "switchport access vlan <1-4094>", ";Set access mode characteristics of the interface;Set VLAN when interface is in access mode;VLAN ID of the VLAN when this port is in access mode", Interface::cmdInterfaceSwAccessVlan);
	g_commands.registerCommand(MODE_CONF_IF, 15,
		"switchport trunk native vlan <1-4094>",
		";"\
		"Set trunking characteristics of the interface;"\
		"Set trunking native characteristics when interface is in trunking mode;"\
		"Set native VLAN when interface is in trunking mode;VLAN ID of the native VLAN when this port is in trunking mode",
		Interface::cmdInterfaceSwNativeVlan);

	g_commands.registerCommand(MODE_CONF_IF, 15, "shutdown", "Shutdown the selected interface", Interface::cmdInterfaceShutdown);
	g_commands.registerCommand(MODE_CONF_IF, 15, "no shutdown", ";Shutdown the selected interface", Interface::cmdInterfaceNoShutdown);
	g_commands.registerCommand(MODE_CONF_IF, 15, "description LINE", "Interface specific description;<cr>", Interface::cmdInterfaceDescription);
	g_commands.registerCommand(MODE_CONF_IF, 15, "no description", ";Interface specific description", Interface::cmdInterfaceNoDescription);
	g_commands.registerCommand(MODE_CONF_IF, 1, "exit", "Exit from interface configuration mode", Interface::cmdInterfaceExit);
}


text:
package net.blockarray.flag;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;

public class Util {
	public static void sendStaff(String message) {
		for (Player p : Bukkit.getServer().getOnlinePlayers()) {
			if (p.hasPermission("flag.admin")) {
				p.sendMessage(ChatColor.translateAlternateColorCodes('&',
						message));
			}
		}
	}
}


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.
 */

package org.flowable.idm.engine.impl.cmd;

import java.io.Serializable;

import org.flowable.engine.common.api.FlowableIllegalArgumentException;
import org.flowable.idm.api.User;
import org.flowable.idm.engine.impl.interceptor.Command;
import org.flowable.idm.engine.impl.interceptor.CommandContext;

/**
 * @author Tom Baeyens
 */
public class CreateUserCmd implements Command<User>, Serializable {

  private static final long serialVersionUID = 1L;

  protected String userId;

  public CreateUserCmd(String userId) {
    if (userId == null) {
      throw new FlowableIllegalArgumentException("userId is null");
    }
    this.userId = userId;
  }

  public User execute(CommandContext commandContext) {
    return commandContext.getUserEntityManager().createNewUser(userId);
  }
}


text:
export interface AftershipOption {
  /**
   * AfterShip endpoint, default 'https://api.aftership.com/v4'
   */
  endpoint: string;

  /**
   *  Prefix of User-Agent in headers, default 'aftership-sdk-nodejs'
   */
  user_agent_prefix: string;
}


text:
'use strict';

var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };

var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; })();

var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.Field = exports.MultiField = exports.FieldGroup = exports.Formo = undefined;

var _lodash = require('lodash');

var _lodash2 = _interopRequireDefault(_lodash);

var _kefir = require('kefir');

var _kefir2 = _interopRequireDefault(_kefir);

var _immutable = require('immutable');

var _immutable2 = _interopRequireDefault(_immutable);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

var AbstractFieldGroup = (function () {
  function AbstractFieldGroup(fields, name) {
    _classCallCheck(this, AbstractFieldGroup);

    this.key = name;
    if (fields) {
      this.fields = {};
      this.initFields(fields);
    }
  }

  _createClass(AbstractFieldGroup, [{
    key: 'reset',
    value: function reset() {
      _lodash2.default.each(this.fields, function (field) {
        return field.reset();
      });
    }
  }, {
    key: 'disabled',
    value: function disabled(value) {
      _lodash2.default.each(this.fields, function (field) {
        return field.disabled(value);
      });
    }
  }, {
    key: 'hasBeenModified',
    value: function hasBeenModified(state) {
      var _this = this;

      return _lodash2.default.any(state, function (subState, name) {
        var field = _this.field(name);
        if (field && field.hasBeenModified) return field.hasBeenModified(subState);else return false;
      });
    }
  }, {
    key: 'field',
    value: function field(path) {
      return _lodash2.default.inject(path.split('/').filter(function (x) {
        return x != '';
      }), function (o, p) {
        return o && o.fields[p];
      }, this);
    }
  }, {
    key: 'propagateParent',
    value: function propagateParent(parent) {
      function propagate(parent) {
        if (!parent.fields) return;
        _lodash2.default.each(parent.fields, function (field) {
          field.parent = parent;
          propagate(field);
        });
      }
      propagate(parent);
    }
  }, {
    key: 'setValue',
    value: function setValue(key, value) {
      var path = this.path;
      var root = this.root;
      var fieldPath = [path, key].join('/');
      var field = root.field(fieldPath);
      if (!field) throw new Error('Cannot find any field with path: "' + fieldPath + '"');
      field.setValue(value);
      return this;
    }
  }, {
    key: 'initFields',
    value: function initFields(fields) {
      var _iteratorNormalCompletion = true;
      var _didIteratorError = false;
      var _iteratorError = undefined;

      try {
        for (var _iterator = fields[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
          var field = _step.value;

          this.fields[field.key] = field;
        }
      } catch (err) {
        _didIteratorError = true;
        _iteratorError = err;
      } finally {
        try {
          if (!_iteratorNormalCompletion && _iterator.return) {
            _iterator.return();
          }
        } finally {
          if (_didIteratorError) {
            throw _iteratorError;
          }
        }
      }
    }
  }, {
    key: 'mergeChildrenState',
    value: function mergeChildrenState(field, state) {
      return function (parentState) {
        var newParentState = parentState.set(field.key, state);
        var subStates = newParentState.filter(function (subState) {
          return _immutable2.default.Map.isMap(subState) && subState.has('canSubmit');
        }).toList();
        var canSubmit = _lodash2.default.all(subStates.map(function (x) {
          return x.get('canSubmit');
        }).toJS());
        var isLoading = _lodash2.default.some(subStates.map(function (x) {
          return x.get('isLoading');
        }).toJS());
        var hasBeenModified = _lodash2.default.some(subStates.map(function (x) {
          return x.get('hasBeenModified');
        }).toJS());
        return newParentState.merge({
          canSubmit: canSubmit,
          hasBeenModified: hasBeenModified,
          isLoading: isLoading
        });
      };
    }
  }, {
    key: 'combineStates',
    value: function combineStates() {
      var _this2 = this;

      this.commands = _kefir2.default.pool();
      var fields = this.fields;
      var defaultState = _immutable2.default.Map({
        canSubmit: true,
        hasBeenModified: false,
        isLoading: false,
        path: this.path
      });

      _lodash2.default.each(fields, function (field) {
        var stream = field.state.map(function (state) {
          return _this2.mergeChildrenState(field, state);
        });
        field.unplugFromCommandPool = function () {
          return _this2.commands.unplug(stream);
        };
        _this2.commands.plug(stream);
      });

      return this.commands.scan(function (state, command) {
        return command(state);
      }, defaultState);
    }
  }, {
    key: 'initState',
    value: function initState() {
      _lodash2.default.each(this.fields, function (field) {
        return field.initState();
      });
      this.state = this.combineStates();
    }
  }, {
    key: 'onValue',
    value: function onValue(cb) {
      var _this3 = this;

      var fct = undefined;
      this.state.onValue(fct = function (state) {
        return cb(state.toJS());
      });
      return function () {
        return _this3.state.offValue(fct);
      };
    }
  }, {
    key: 'toDocument',
    value: function toDocument(state) {
      var res = {};
      var _iteratorNormalCompletion2 = true;
      var _didIteratorError2 = false;
      var _iteratorError2 = undefined;

      try {
        for (var _iterator2 = state.entries()[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
          var _step2$value = _slicedToArray(_step2.value, 2);

          var name = _step2$value[0];
          var subState = _step2$value[1];

          if (_immutable2.default.Map.isMap(subState)) {
            var path = subState.get('path');
            var field = this.root.field(path);
            if (subState.has('value')) res[name] = castedValue(subState, subState.get('value'));else res[name] = field.toDocument(subState);
          }
        }
      } catch (err) {
        _didIteratorError2 = true;
        _iteratorError2 = err;
      } finally {
        try {
          if (!_iteratorNormalCompletion2 && _iterator2.return) {
            _iterator2.return();
          }
        } finally {
          if (_didIteratorError2) {
            throw _iteratorError2;
          }
        }
      }

      return res;
    }
  }, {
    key: 'path',
    get: function get() {
      if (!this.parent) return '';
      return this.parent.path + '/' + this.key;
    }
  }, {
    key: 'root',
    get: function get() {
      if (!this.parent) return this;
      return this.parent.root;
    }
  }]);

  return AbstractFieldGroup;
})();

var Formo = exports.Formo = (function (_AbstractFieldGroup) {
  _inherits(Formo, _AbstractFieldGroup);

  function Formo() {
    var fields = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0];
    var document = arguments[1];

    _classCallCheck(this, Formo);

    var _this4 = _possibleConstructorReturn(this, Object.getPrototypeOf(Formo).call(this, fields));

    _this4.propagateParent(_this4);
    _this4.document = document;

    _this4.initState();

    _this4.submitStream = _kefir2.default.pool();
    _this4.submitted = _this4.state.sampledBy(_this4.submitStream, function (state, options) {
      return state.set('submitOptions', options);
    });

    _this4.cancelStream = _kefir2.default.pool();
    _this4.cancelled = _this4.state.sampledBy(_this4.cancelStream, function (state, options) {
      return state.set('cancelOptions', options);
    });
    return _this4;
  }

  _createClass(Formo, [{
    key: 'onSubmit',
    value: function onSubmit(cb) {
      var _this5 = this;

      var fct = undefined;
      this.submitted.onValue(fct = function (state) {
        return cb(state.toJS(), _this5.toDocument(state));
      });
      return function () {
        return _this5.submitted.offValue(fct);
      };
    }
  }, {
    key: 'onCancel',
    value: function onCancel(cb) {
      var _this6 = this;

      var fct = undefined;
      this.cancelled.onValue(fct = function (state) {
        return cb(state.toJS());
      });
      return function () {
        return _this6.cancelled.offValue(fct);
      };
    }
  }, {
    key: 'submit',
    value: function submit(options) {
      this.submitStream.plug(_kefir2.default.constant(_immutable2.default.fromJS(options)));
    }
  }, {
    key: 'cancel',
    value: function cancel(options) {
      this.cancelStream.plug(_kefir2.default.constant(_immutable2.default.fromJS(options)));
    }
  }, {
    key: 'getDocumentValue',
    value: function getDocumentValue(path) {
      if (!this.document) return;
      return _lodash2.default.inject(path.split('/').filter(function (x) {
        return x !== '';
      }), function (d, p) {
        return d && d[p];
      }, this.document);
    }
  }]);

  return Formo;
})(AbstractFieldGroup);

var FieldGroup = exports.FieldGroup = (function (_AbstractFieldGroup2) {
  _inherits(FieldGroup, _AbstractFieldGroup2);

  function FieldGroup(name, fields) {
    _classCallCheck(this, FieldGroup);

    return _possibleConstructorReturn(this, Object.getPrototypeOf(FieldGroup).call(this, fields, name));
  }

  _createClass(FieldGroup, [{
    key: 'clone',
    value: function clone() {
      return new FieldGroup(this.key, _lodash2.default.map(this.fields, function (field) {
        return field.clone();
      }));
    }
  }]);

  return FieldGroup;
})(AbstractFieldGroup);

var MultiField = exports.MultiField = (function (_AbstractFieldGroup3) {
  _inherits(MultiField, _AbstractFieldGroup3);

  function MultiField(name) {
    var fields = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1];

    _classCallCheck(this, MultiField);

    var _this8 = _possibleConstructorReturn(this, Object.getPrototypeOf(MultiField).call(this, null, name));

    _this8.keyCounter = 0;
    _this8.schema = fields;
    _this8.fields = {};
    //this.fields =  _.object(_.times(count, () => [this.keyCounter , new FieldGroup(String(this.keyCounter++), _.map(fields, field => field.clone()))]));
    return _this8;
  }

  _createClass(MultiField, [{
    key: 'initState',
    value: function initState() {
      var _this9 = this;

      _get(Object.getPrototypeOf(MultiField.prototype), 'initState', this).call(this);
      this.removeFieldStream = _kefir2.default.pool();
      var removeFieldCommand = function removeFieldCommand(key) {
        return function (state) {
          return state.delete(key).set('hasBeenModified', true);
        };
      };
      this.commands.plug(this.removeFieldStream.map(function (key) {
        return removeFieldCommand(key);
      }));

      var root = this.root;
      var defaultValue = root && root.getDocumentValue(this.path);
      if (defaultValue) {
        var size = defaultValue.length;
        _lodash2.default.times(size, function () {
          return _this9.addField();
        });
      }
    }
  }, {
    key: 'getFields',
    value: function getFields() {
      return _lodash2.default.values(this.fields);
    }
  }, {
    key: 'addField',
    value: function addField() {
      var _this10 = this;

      var newKey = this.keyCounter++;
      var newField = new FieldGroup(String(newKey), _lodash2.default.map(this.schema, function (field) {
        return field.clone();
      }));
      newField.parent = this;
      this.propagateParent(newField);
      newField.initState();
      this.fields[newKey] = newField;
      var stream = newField.state.map(function (state) {
        return _this10.mergeChildrenState(newField, state);
      });
      newField.unplugFromCommandPool = function () {
        return _this10.commands.unplug(stream);
      };
      this.commands.plug(stream);
      return newField;
    }
  }, {
    key: 'deleteField',
    value: function deleteField(field) {
      if (!field) return this;
      if (!this.fields[field.key]) throw new Error('Cannot find any field for: "' + field.path + '"');
      this.removeFieldStream.plug(_kefir2.default.constant(field.key));
      field.unplugFromCommandPool();
      delete this.fields[field.key];
      return this;
    }
  }, {
    key: 'toDocument',
    value: function toDocument(state) {
      var res = [];
      var _iteratorNormalCompletion3 = true;
      var _didIteratorError3 = false;
      var _iteratorError3 = undefined;

      try {
        for (var _iterator3 = state.entries()[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
          var _step3$value = _slicedToArray(_step3.value, 2);

          var name = _step3$value[0];
          var subState = _step3$value[1];

          if (_immutable2.default.Map.isMap(subState)) {
            var path = subState.get('path');
            var field = this.root.field(path);
            if (subState.has('value')) res.push(castedValue(subState, subState.get('value')));else res.push(field.toDocument(subState));
          }
        }
      } catch (err) {
        _didIteratorError3 = true;
        _iteratorError3 = err;
      } finally {
        try {
          if (!_iteratorNormalCompletion3 && _iterator3.return) {
            _iterator3.return();
          }
        } finally {
          if (_didIteratorError3) {
            throw _iteratorError3;
          }
        }
      }

      return res;
    }
  }, {
    key: 'length',
    get: function get() {
      return _lodash2.default.keys(this.fields).length;
    }
  }]);

  return MultiField;
})(AbstractFieldGroup);

var Field = exports.Field = (function () {
  function Field(name) {
    var schema = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];

    _classCallCheck(this, Field);

    this.schema = schema;
    this.key = name;
  }

  _createClass(Field, [{
    key: 'clone',
    value: function clone() {
      return new Field(this.key, this.schema);
    }
  }, {
    key: 'initState',
    value: function initState() {
      var _this11 = this;

      var defaultValue = _immutable2.default.fromJS(this.defaultValue);

      var defaultState = _immutable2.default.fromJS({
        value: defaultValue,
        path: this.path,
        isLoading: 0,
        disabled: false,
        hasBeenModified: false,
        type: this.schema.type,
        required: !!this.schema.required,
        pattern: this.schema.pattern,
        domainValue: getDomainValue(this.schema.domainValue),
        multiValue: !!this.schema.multiValue,
        checkDomainValue: this.checkDomainValue
      });

      defaultState = defaultState.set('error', checkError(defaultState, defaultValue));
      defaultState = defaultState.set('canSubmit', !defaultState.get('error'));

      this.newValueStream = _kefir2.default.pool();
      this.refreshStream = _kefir2.default.pool();
      this.newSchemaValueStream = _kefir2.default.pool();
      this.disabledStream = _kefir2.default.pool();
      this.resetStream = _kefir2.default.pool();

      var commands = _kefir2.default.pool();

      var checkedValueCommand = function checkedValueCommand(data) {
        return function (state) {
          var isLoading = state.get('isLoading') - 1;
          if (state.get('value') !== data.value) {
            // value has changed before valueChecker end
            return state.merge({
              isLoading: isLoading,
              canSubmit: !(isLoading || data.error),
              hasBeenModified: _this11.hasBeenModified(state, state.get('value'))
            });
          }
          return state.merge({
            error: data.error,
            isLoading: isLoading,
            canSubmit: !(isLoading || data.error),
            hasBeenModified: _this11.hasBeenModified(state, state.get('value'))
          });
        };
      };

      var newSchemaValueCommand = function newSchemaValueCommand(_ref) {
        var key = _ref.key;
        var value = _ref.value;

        return function (state) {
          var newValue = undefined;
          switch (key) {
            case 'domainValue':
              newValue = getDomainValue(value);
              break;
            case 'type':
            case 'required':
            case 'pattern':
            case 'checkDomainValue':
            case 'multiValue':
              newValue = value;
              break;
            default:
              return state;
          }
          var data = state.set(key, _immutable2.default.fromJS(newValue));
          var error = checkError(data, data.get('value'));

          return data.merge({
            error: error,
            canSubmit: !(data.get('isLoading') || error)
          });
        };
      };

      var newValueCommand = function newValueCommand(value) {
        return function (state) {
          if (_this11.schema.valueChecker && !(isNull(value) && isRequired(state))) {
            return state.merge({
              value: value,
              canSubmit: false,
              error: undefined,
              hasBeenModified: _this11.hasBeenModified(state, value)
            });
          }
          if (!checkValue(state, value)) {
            return state.merge({
              value: value,
              error: getError(state, value),
              hasBeenModified: _this11.hasBeenModified(state, value),
              canSubmit: false
            });
          }
          return state.merge({
            value: value,
            error: undefined,
            hasBeenModified: _this11.hasBeenModified(state, value),
            canSubmit: !state.get('isLoading')
          });
        };
      };

      var resetCommand = function resetCommand() {
        return function () {
          return defaultState;
        };
      };

      var isLoadingCommand = function isLoadingCommand() {
        return function (state) {
          return state.update('isLoading', function (x) {
            return x + 1;
          }).set('canSubmit', false);
        };
      };

      var disabledCommand = function disabledCommand(value) {
        return function (state) {
          return state.update('disabled', function (x) {
            return value;
          });
        };
      };

      commands.plug(this.newValueStream.map(function (value) {
        return newValueCommand(value);
      }));
      commands.plug(this.newSchemaValueStream.map(function (obj) {
        return newSchemaValueCommand(obj);
      }));
      commands.plug(this.disabledStream.map(function (value) {
        return disabledCommand(value);
      }));
      commands.plug(this.resetStream.map(function (value) {
        return resetCommand();
      }));

      this.state = commands.scan(function (state, command) {
        return command(state);
      }, defaultState);

      if (this.schema.valueChecker) {
        var stream = this.state.sampledBy(this.newValueStream, function (state, value) {
          return [state, value];
        }).filter(function (_ref2) {
          var _ref3 = _slicedToArray(_ref2, 2);

          var state = _ref3[0];
          var value = _ref3[1];
          return !(isRequired(state) && isNull(value));
        }).debounce(this.schema.valueChecker.debounce || 10).flatMap(function (_ref4) {
          var _ref5 = _slicedToArray(_ref4, 2);

          var state = _ref5[0];
          var value = _ref5[1];

          commands.plug(_kefir2.default.constant(isLoadingCommand()));
          var ajaxRequest = _kefir2.default.fromPromise(_this11.schema.valueChecker.checker(value, _this11.root.document, state));
          return _kefir2.default.constant(value).combine(ajaxRequest, function (value, res) {
            if (!res.checked) return { error: res.error || 'Wrong Input!', value: value };
            return { value: value, error: undefined };
          });
        });
        commands.plug(stream.map(function (value) {
          return checkedValueCommand(value);
        }));
      }

      this.newValueStream.plug(this.state.sampledBy(this.refreshStream, function (state) {
        return state.get('value');
      }));
    }
  }, {
    key: 'onValue',
    value: function onValue(cb) {
      var _this12 = this;

      var fct = undefined;
      this.state.onValue(fct = function (state) {
        return cb(state.toJS());
      });
      return function () {
        return _this12.state.offValue(fct);
      };
    }
  }, {
    key: 'hasBeenModified',
    value: function hasBeenModified(state, value) {
      return castedValue(state, value) !== this.defaultValue;
    }
  }, {
    key: 'htmlType',
    value: function htmlType() {
      switch (this.type) {
        case 'number':
        case 'integer':
          return 'text';
        case 'color':
          return 'color';
        case 'url':
          return 'url';
        case 'file':
          return 'file';
        default:
          return 'text';
      }
    }
  }, {
    key: 'setValue',
    value: function setValue(value) {
      this.newValueStream.plug(_kefir2.default.constant(_immutable2.default.fromJS(value)));
    }
  }, {
    key: 'setSchemaValue',
    value: function setSchemaValue(key, value) {
      this.newSchemaValueStream.plug(_kefir2.default.constant({ key: key, value: value }));
    }
  }, {
    key: 'refresh',
    value: function refresh() {
      this.refreshStream.plug(_kefir2.default.constant(true));
    }
  }, {
    key: 'reset',
    value: function reset() {
      this.resetStream.plug(_kefir2.default.constant(true));
    }
  }, {
    key: 'disabled',
    value: function disabled(value) {
      this.disabledStream.plug(_kefir2.default.constant(!!value));
    }
  }, {
    key: 'checkDomainValue',
    get: function get() {
      return 'checkDomainValue' in this.schema ? this.schema.checkDomainValue : true;
    }
  }, {
    key: 'defaultValue',
    get: function get() {
      var root = this.root;
      return root && root.getDocumentValue(this.path) || this.schema.defaultValue;
    }
  }, {
    key: 'label',
    get: function get() {
      return this.schema.label;
    }
  }, {
    key: 'type',
    get: function get() {
      return this.schema.type;
    }
  }, {
    key: 'path',
    get: function get() {
      return this.parent.path + '/' + this.key;
    }
  }, {
    key: 'root',
    get: function get() {
      return this.parent && this.parent.root;
    }
  }, {
    key: 'pattern',
    get: function get() {
      return this.schema.pattern;
    }
  }]);

  return Field;
})();

function getPattern(state) {
  return state.get('pattern') || ({
    number: /^[0-9]*(\.[0-9]+)?$/,
    integer: /^[0-9]+$/,
    boolean: /true|false/,
    text: /.*/
  })[state.get('type')];
}

function checkPattern(state, value) {
  return !!String(value).match(getPattern(state));
}

function checkValue(state, value) {
  var _checkValue = function _checkValue(v) {
    if (isNull(v)) return !isRequired(state);
    if (hasDomainValue(state) && mustCheckDomainValue(state)) return checkDomain(state, v);
    return checkPattern(state, v);
  };

  if (isMultiValued(state)) {
    if (!value) return _checkValue();
    if (!value.toJS) return false;
    var v = value.toJS();
    if (!_lodash2.default.isArray(v)) return false;
    if (!v.length) return _checkValue();
    return _lodash2.default.all(v, function (x) {
      return _checkValue(x);
    });
  } else {
    return _checkValue(value);
  }
}

function getDomainValue(domainValue) {
  if (!domainValue) return;
  var first = domainValue[0];
  return _lodash2.default.isObject(first) && 'key' in first ? domainValue : _lodash2.default.map(domainValue, function (v) {
    return { key: v, value: v };
  });
}

function checkDomain(state, value) {
  return _lodash2.default.contains(_lodash2.default.map(state.get('domainValue').toJS(), function (_ref6) {
    var key = _ref6.key;
    var value = _ref6.value;
    return key;
  }), value);
}

function hasDomainValue(state) {
  return state.get('domainValue');
}

function mustCheckDomainValue(state) {
  return state.get('checkDomainValue');
}

function isMultiValued(state) {
  return state.get('multiValue');
}

function isRequired(state) {
  return state.get('required');
}

function isNull(value) {
  return _lodash2.default.isUndefined(value) || value === "";
}

function castedValue(state, value) {
  if (isMultiValued(state)) return value && value.toJS ? value.toJS() : [];
  switch (state.get('type')) {
    case 'number':
    case 'integer':
      return Number(value);
    case 'boolean':
      return Boolean(value);
    case 'text':
      if (value === '' || !value) return;
      return value.trim ? value.trim() : value;
    default:
      return value;
  }
}

function getError(state, value) {
  if (isNull(value) && isRequired(state)) return "Input required";
  if (state.get('pattern')) return "Value doesn't match pattern!";
  if (hasDomainValue(state)) return "Value doesn't match domain value!";
  switch (state.get('type')) {
    case 'number':
      return "Value is not a number!";
    case 'integer':
      return "Value is not an integer!";
    case 'boolean':
      return "Value is not an boolean!";
  }
  return "Wrong value!";
}

function checkError(state, value) {
  if (!checkValue(state, value)) return getError(state, value);
}


text:
{% load apps_player %}
{% load apps_enemy %}
{% load apps_game %}
{% load staticfiles i18n %}

{{ player_adventure.adventure.title }}

  {% if player_adventure.adventure.image_path %}

  {% endif %}
  {{ player_adventure.adventure.adventure_text }}

  {% for choice in player_adventure.adventure.choices.all %}
    {{ choice.option_text }}
  {% endfor %}


text:
package store

import (
	"time"

	"github.com/apex/log"
	"github.com/go-chat/gochat/apperror"
	"github.com/go-chat/gochat/config"
	"github.com/go-chat/gochat/model"
	"github.com/jinzhu/gorm"
)

type Store struct {
	SQLStore *gorm.DB
	IUser    IUser
	IGroup   IGroup
	IMessage IMessage
}

type IUser interface {
	Save(user *model.User) *apperror.AppError
	Login(email, password string) (*model.User, *apperror.AppError)
	GetUserFromToken(token string) (*model.User, *apperror.AppError)
	GetUserFromEmail(email string) (*model.User, *apperror.AppError)
}

type IGroup interface {
	GetGroupsByUserID(userID int64) ([]model.Group, *apperror.AppError)
	Save(group *model.Group) *apperror.AppError
	AddMembersToGroupChat(userIDs []int64, groupID int64) *apperror.AppError
	RemoveMembersToGroupChat(userIDs []int64, groupID int64) *apperror.AppError
	DeleteGroup(userID, groupID int64) *apperror.AppError
	ListMessagesOfGroup(groupID int64, limit, offset int) ([]model.Message, *apperror.AppError)
}

type IMessage interface {
	Save(msg *model.Message) *apperror.AppError
}

func NewStore(config *config.Config) *Store {
	store := &Store{}
	store.SQLStore = getSQLStore(config.SQL.DriverName, config.SQL.DataSource)
	store.SQLStore.LogMode(true)
	migrate(store.SQLStore)

	store.IUser = NewUserStore(store)
	store.IGroup = NewGroupStore(store)
	store.IMessage = NewMessageStore(store)

	return store
}

func getSQLStore(driver, dataSource string) *gorm.DB {
	db, err := gorm.Open(driver, dataSource)
	if err != nil {
		log.Errorf("Failed to open sql connection to err: %v", err)
		time.Sleep(time.Second)
		panic("Failed to open sql connection" + err.Error())
	}

	return db
}

func (store *Store) Close() {
	store.SQLStore.Close()
}

func migrate(db *gorm.DB) {
	db.AutoMigrate(&model.User{})
	db.AutoMigrate(&model.Message{})
	db.AutoMigrate(&model.Group{})
	db.AutoMigrate(&model.GroupUser{})
}


text:
import math
import statistics
import challenge21 as mt
from util import xor, chunk

def mtcipherop(data, key):
    assert key < 2**16

    mt.seed(key)

    out = bytearray()

    for chk in chunk(data, 4):
        keystream = mt.extract().to_bytes(4, 'little')
        out += xor(chk, keystream[:len(chk)])

    return out

def breakmtcipher(ciphertext):
    lowestdev = 10000
    guessed_plaintext = b''

    for i in range(2**16):
        print(i)
        ptext = mtcipherop(ciphertext, i)
        sdev = statistics.pstdev(ptext)

        if sdev < lowestdev:
            lowestdev = sdev
            guessed_plaintext = ptext

    print(lowestdev)
    print(guessed_plaintext)

def main():
    ciphertext = mtcipherop(b'Brown fox jumped over a log or something', 10)
    breakmtcipher(ciphertext)

if __name__ == '__main__':
    main()


text:
package com.google.android.gms.internal;

import android.view.View;
import android.webkit.WebChromeClient.CustomViewCallback;

public final class da extends cy
{
  public da(cw paramcw)
  {
    super(paramcw);
  }

  public final void onShowCustomView(View paramView, int paramInt, WebChromeClient.CustomViewCallback paramCustomViewCallback)
  {
    a(paramView, paramInt, paramCustomViewCallback);
  }
}

/* Location:           /Users/vikas/Documents/Mhacks_Real_app/classes-dex2jar.jar
 * Qualified Name:     com.google.android.gms.internal.da
 * JD-Core Version:    0.6.2
 */


text:
#include <grpc/support/port_platform.h>

#include "src/core/lib/resolver/resolver.h"

grpc_core::DebugOnlyTraceFlag grpc_trace_resolver_refcount(false,
                                                           "resolver_refcount");

namespace grpc_core {

//
// Resolver
//

Resolver::Resolver()
    : InternallyRefCounted(GRPC_TRACE_FLAG_ENABLED(grpc_trace_resolver_refcount)
                               ? "Resolver"
                               : nullptr) {}

//
// Resolver::Result
//

Resolver::Result::~Result() { grpc_channel_args_destroy(args); }

Resolver::Result::Result(const Result& other)
    : addresses(other.addresses),
      service_config(other.service_config),
      resolution_note(other.resolution_note),
      args(grpc_channel_args_copy(other.args)) {}

Resolver::Result::Result(Result&& other) noexcept
    : addresses(std::move(other.addresses)),
      service_config(std::move(other.service_config)),
      resolution_note(std::move(other.resolution_note)),
      // TODO(roth): Use std::move() once channel args is converted to C++.
      args(other.args) {
  other.args = nullptr;
}

Resolver::Result& Resolver::Result::operator=(const Result& other) {
  if (&other == this) return *this;
  addresses = other.addresses;
  service_config = other.service_config;
  resolution_note = other.resolution_note;
  grpc_channel_args_destroy(args);
  args = grpc_channel_args_copy(other.args);
  return *this;
}

Resolver::Result& Resolver::Result::operator=(Result&& other) noexcept {
  addresses = std::move(other.addresses);
  service_config = std::move(other.service_config);
  resolution_note = std::move(other.resolution_note);
  // TODO(roth): Use std::move() once channel args is converted to C++.
  grpc_channel_args_destroy(args);
  args = other.args;
  other.args = nullptr;
  return *this;
}

}  // namespace grpc_core


text:
Release date: October 1st 2019

[Compare this release with the previous one](https://github.com/orchardcms/orchardcore/compare/1.0.0-beta3...1.0.0-rc1)

## Breaking Changes

- .NET Core 3.0

## Milestone

[RC](https://github.com/OrchardCMS/OrchardCore/milestone/2)

## Enhancements

- Update Orchard Core to rc1 [#4370](https://github.com/OrchardCMS/OrchardCore/pull/4370)
- Allows shared views across tenants. [#4382](https://github.com/OrchardCMS/OrchardCore/pull/4382)
- Useless registration [#4366](https://github.com/OrchardCMS/OrchardCore/pull/4366)
- Using widgetlist.edit.css for Flow and Layers [#4378](https://github.com/OrchardCMS/OrchardCore/pull/4378)
- OrchardCore.Translations.All-beta -> OrchardCore.Translations.All-rc1 [#4371](https://github.com/OrchardCMS/OrchardCore/pull/4371)
- Fix razor options when no 'refs' folder exists. [#4379](https://github.com/OrchardCMS/OrchardCore/pull/4379)
- Fallback to Detail display type for bag parts [#4376](https://github.com/OrchardCMS/OrchardCore/pull/4376)
- Loading all po files from localization folders [#4375](https://github.com/OrchardCMS/OrchardCore/pull/4375)
- Update to .NET Core 3.0 [#4373](https://github.com/OrchardCMS/OrchardCore/pull/4373)
- Msbuild target to copy translation files. [#4346](https://github.com/OrchardCMS/OrchardCore/pull/4346)
- ModifiedUtc & PublishedUtc should take into account when recipe runs [#4279](https://github.com/OrchardCMS/OrchardCore/pull/4279)
- Add contentitem tag helper and liquid tag [#4360](https://github.com/OrchardCMS/OrchardCore/pull/4360)
- Fixes MiniProfiler [#4357](https://github.com/OrchardCMS/OrchardCore/pull/4357)
- Support for validation error class [#4355](https://github.com/OrchardCMS/OrchardCore/pull/4355)
- Handle standard Startup class [#4348](https://github.com/OrchardCMS/OrchardCore/pull/4348)
- Adding links to videos for decouple and headless [#4362](https://github.com/OrchardCMS/OrchardCore/pull/4362)
- Fixes [#4342](https://github.com/OrchardCMS/OrchardCore/pull/4342) [#4363](https://github.com/OrchardCMS/OrchardCore/pull/4363)
- Fix List Items route [#4350](https://github.com/OrchardCMS/OrchardCore/pull/4350)
- Import model state IPageFilter implementation for Forms module. [#4337](https://github.com/OrchardCMS/OrchardCore/pull/4337)
- Upgrade Fluid [#4344](https://github.com/OrchardCMS/OrchardCore/pull/4344)
- Register Content Parts and Fields in ContentOptions [#4335](https://github.com/OrchardCMS/OrchardCore/pull/4335)
- Security Critical Permissions [#4267](https://github.com/OrchardCMS/OrchardCore/pull/4267)
- Introducing FullTextAspect [#4012](https://github.com/OrchardCMS/OrchardCore/pull/4012)
- Format dependent features in disable feature dialog [#4278](https://github.com/OrchardCMS/OrchardCore/pull/4278)
- Regression fix: bootstrap confirm modal [#4336](https://github.com/OrchardCMS/OrchardCore/pull/4336)
- Fixing OrchardCore.Localization dependencies [#4320](https://github.com/OrchardCMS/OrchardCore/pull/4320)
- Removing dependencies on NETStandard.Library [#4328](https://github.com/OrchardCMS/OrchardCore/pull/4328)
- Remove workflow-menu.css and  remove dup'd images. [#4325](https://github.com/OrchardCMS/OrchardCore/pull/4325)
- Add translation metapackage to Cms.Targets [#4323](https://github.com/OrchardCMS/OrchardCore/pull/4323)
- StringBuilder best practices [#4318](https://github.com/OrchardCMS/OrchardCore/pull/4318)
- Fixes ConfiguredFeaturesShellDescriptorManager registration. [#4322](https://github.com/OrchardCMS/OrchardCore/pull/4322)
- Prettify Admin Menus page [#4307](https://github.com/OrchardCMS/OrchardCore/pull/4307)
- Prettify Queries page [#4305](https://github.com/OrchardCMS/OrchardCore/pull/4305)
- Add alert if no tenants found on search result [#4302](https://github.com/OrchardCMS/OrchardCore/pull/4302)
- result -> results [#4314](https://github.com/OrchardCMS/OrchardCore/pull/4314)
- Add alert if no features found on search result [#4301](https://github.com/OrchardCMS/OrchardCore/pull/4301)
- Add alert if no recipes found on search result [#4300](https://github.com/OrchardCMS/OrchardCore/pull/4300)
- Regression fix : ContentPickerField [#4282](https://github.com/OrchardCMS/OrchardCore/pull/4282)
- Page endpoint priority. [#4299](https://github.com/OrchardCMS/OrchardCore/pull/4299)
- LangVersion property is no more necessary [#4295](https://github.com/OrchardCMS/OrchardCore/pull/4295)
- Update ASP.NET dependencies to 3.0 RC1 [#4294](https://github.com/OrchardCMS/OrchardCore/pull/4294)
- Add default paging to GraphQL queries [#4291](https://github.com/OrchardCMS/OrchardCore/pull/4291)
- Updating default logging settings [#4296](https://github.com/OrchardCMS/OrchardCore/pull/4296)
- Fix ResourceManager dependency resolution [#4293](https://github.com/OrchardCMS/OrchardCore/pull/4293)
- WIP Optimize ResourceManager [#4292](https://github.com/OrchardCMS/OrchardCore/pull/4292)
- Migrate all Content Type / Part / Field Settings to Settings<T> [#4166](https://github.com/OrchardCMS/OrchardCore/pull/4166)
- Update vscode launch.json for core 3.0 [#4290](https://github.com/OrchardCMS/OrchardCore/pull/4290)
- Fix permission issue with PublishContent [#4286](https://github.com/OrchardCMS/OrchardCore/pull/4286)
- Fixes HomeRoute if no home route. [#4284](https://github.com/OrchardCMS/OrchardCore/pull/4284)
- CultureAspect must work for localization & content localization modules [#4258](https://github.com/OrchardCMS/OrchardCore/pull/4258)
- Diagnostics ISartupFilter to add a middleware before the routing one [#4264](https://github.com/OrchardCMS/OrchardCore/pull/4264)
- Update ImageProvider to work better with new ImageSharp version [#4254](https://github.com/OrchardCMS/OrchardCore/pull/4254)
- Use AddInitialRequestCultureProvider [#4266](https://github.com/OrchardCMS/OrchardCore/pull/4266)
- Update MediaField-Attached.Edit.cshtml [#4269](https://github.com/OrchardCMS/OrchardCore/pull/4269)
- Fixes razor pages and autoroutes conflicts. [#4272](https://github.com/OrchardCMS/OrchardCore/pull/4272)
- Update dependencies [#4274](https://github.com/OrchardCMS/OrchardCore/pull/4274)
- Fix media table valign [#4276](https://github.com/OrchardCMS/OrchardCore/pull/4276)
- Fixes NotFound page if not overridden in the current theme. [#4263](https://github.com/OrchardCMS/OrchardCore/pull/4263)
- Prettify Roles page [#4240](https://github.com/OrchardCMS/OrchardCore/pull/4240)
- Content Part creation : regression fix [#4262](https://github.com/OrchardCMS/OrchardCore/pull/4262)
- Migration to dotnet core 3.0 [#3398](https://github.com/OrchardCMS/OrchardCore/pull/3398)
- Some performance tweaks [#4251](https://github.com/OrchardCMS/OrchardCore/pull/4251)
- Prettify Users page [#4241](https://github.com/OrchardCMS/OrchardCore/pull/4241)
- Allows core shapes to be overridden [#4210](https://github.com/OrchardCMS/OrchardCore/pull/4210)
- Use proper BS4 classes for the login remember me checkbox. [#4245](https://github.com/OrchardCMS/OrchardCore/pull/4245)
- Upgrade ImageSharp.Web to v1.0.0-beta9 [#4167](https://github.com/OrchardCMS/OrchardCore/pull/4167)
- Liquid filter and tags to mutate shape properties [#4193](https://github.com/OrchardCMS/OrchardCore/pull/4193)
- Fix VueMultiselect issue with Widgets [#4225](https://github.com/OrchardCMS/OrchardCore/pull/4225)
- Azure Blob w/resizing [#4025](https://github.com/OrchardCMS/OrchardCore/pull/4025)
- Prettify content parts page [#4221](https://github.com/OrchardCMS/OrchardCore/pull/4221)
- Prettify content types page [#4220](https://github.com/OrchardCMS/OrchardCore/pull/4220)
- Using strongly typed content type setting [#4180](https://github.com/OrchardCMS/OrchardCore/pull/4180)
- Customize bootstrap confirm modal [#4181](https://github.com/OrchardCMS/OrchardCore/pull/4181)
- Add user arguments to Login events [#4182](https://github.com/OrchardCMS/OrchardCore/pull/4182)
- Update Https and Reverse Proxy setting sort orders [#4189](https://github.com/OrchardCMS/OrchardCore/pull/4189)
- Access to dynamic Reusable part. [#4192](https://github.com/OrchardCMS/OrchardCore/pull/4192)
- Add permission to ContentCulturePicker setting [#4194](https://github.com/OrchardCMS/OrchardCore/pull/4194)
- Use bootstrap confirm modal in assets page [#4207](https://github.com/OrchardCMS/OrchardCore/pull/4207)
- Fix TextAreaPart not using submitted form value [#4218](https://github.com/OrchardCMS/OrchardCore/pull/4218)
- Add CultureInfo to Liquid TemplateContext [#4219](https://github.com/OrchardCMS/OrchardCore/pull/4219)
- Import jquery-ui-override into TheAdmin.scss [#4196](https://github.com/OrchardCMS/OrchardCore/pull/4196)
- Update build dependencies + npm i + build [#4187](https://github.com/OrchardCMS/OrchardCore/pull/4187)
- Fix# 4168 : WidgetsListPart - Existing widgets are removed due to Null Zone [#4183](https://github.com/OrchardCMS/OrchardCore/pull/4183)
- Prettify recipes page [#4179](https://github.com/OrchardCMS/OrchardCore/pull/4179)
- Prettify Features page [#4176](https://github.com/OrchardCMS/OrchardCore/pull/4176)
- Change models namespace everywhere [#4173](https://github.com/OrchardCMS/OrchardCore/pull/4173)
- Fix typo on GitHub menus [#4066](https://github.com/OrchardCMS/OrchardCore/pull/4066)
- Remove rtl generation from front end theme related assets  [#4171](https://github.com/OrchardCMS/OrchardCore/pull/4171)
- Polish Tenants page [#4156](https://github.com/OrchardCMS/OrchardCore/pull/4156)
- Show/hide external logins in SaaS recipe [#4152](https://github.com/OrchardCMS/OrchardCore/pull/4152)
- Make OrchardCore.ContentFields.Indexing.SQL require OrchardCore.ContentFields [#4149](https://github.com/OrchardCMS/OrchardCore/pull/4149)
- Clean double encoding [#4150](https://github.com/OrchardCMS/OrchardCore/pull/4150)
- Taxonomy field required validation doesn't work with unique options [#4145](https://github.com/OrchardCMS/OrchardCore/pull/4145)
- Apply cache control headers to non-resized images or other assets served from the media file store with the Static File Middleware [#4135](https://github.com/OrchardCMS/OrchardCore/pull/4135)
- Some menu tweaks [#4132](https://github.com/OrchardCMS/OrchardCore/pull/4132)
- Add Properties Dictionary to IShape interface [#4131](https://github.com/OrchardCMS/OrchardCore/pull/4131)
- Editor direction should respect the localization part culture [#4039](https://github.com/OrchardCMS/OrchardCore/pull/4039)
- Content fields indexing [#3133](https://github.com/OrchardCMS/OrchardCore/pull/3133)
- Increased graphql default maxdepth to allow graphiql introspection query to run. [#4144](https://github.com/OrchardCMS/OrchardCore/pull/4144)
- Remove duplicate resource settings [#4137](https://github.com/OrchardCMS/OrchardCore/pull/4137)
- Make setting the page title format accessible to site administrators [#3401](https://github.com/OrchardCMS/OrchardCore/pull/3401)
- Add LocalizationSetContentPickerField [#3819](https://github.com/OrchardCMS/OrchardCore/pull/3819)
- List localization [#3891](https://github.com/OrchardCMS/OrchardCore/pull/3891)
- Remove unnecessary dependencies [#4072](https://github.com/OrchardCMS/OrchardCore/pull/4072)
- Sort groups alphabetically on Admin Features page [#4128](https://github.com/OrchardCMS/OrchardCore/pull/4128)
- Workflows Internationalization [#3634](https://github.com/OrchardCMS/OrchardCore/pull/3634)
- Handle UnauthorizedResult ([#3209](https://github.com/OrchardCMS/OrchardCore/pull/3209)) [#3215](https://github.com/OrchardCMS/OrchardCore/pull/3215)
- Add README.md to health check [#3010](https://github.com/OrchardCMS/OrchardCore/pull/3010)
- Add support for typed shape tag helper properties [#4114](https://github.com/OrchardCMS/OrchardCore/pull/4114)
- Remove IHttpContextAccessor from ResourceManager [#4120](https://github.com/OrchardCMS/OrchardCore/pull/4120)
- Add example for ContentPickerField [#4122](https://github.com/OrchardCMS/OrchardCore/pull/4122)
- GraphQL: Don't include ignored contenttype fields in where filters [#3832](https://github.com/OrchardCMS/OrchardCore/pull/3832)
- Rollback transaction during indexing [#3823](https://github.com/OrchardCMS/OrchardCore/pull/3823)
- GraphQL - allowed configuration for max depth/complexity and fieldimpact [#3879](https://github.com/OrchardCMS/OrchardCore/pull/3879)
- Fixes Pager in the home page [#4115](https://github.com/OrchardCMS/OrchardCore/pull/4115)
- Update run-code-on-startup example and formatting [#4117](https://github.com/OrchardCMS/OrchardCore/pull/4117)
- Add ORCHARD_APP_DATA Environment Variable section [#4116](https://github.com/OrchardCMS/OrchardCore/pull/4116)
- Refactor culture picker shape [#4111](https://github.com/OrchardCMS/OrchardCore/pull/4111)
- Localization files publishing [#4088](https://github.com/OrchardCMS/OrchardCore/pull/4088)
- Add Compare Attribute to PasswordConfirmation and validate ModelState in AdminController [#4099](https://github.com/OrchardCMS/OrchardCore/pull/4099)
- external links on README.md [#4103](https://github.com/OrchardCMS/OrchardCore/pull/4103)
- AliasPart index size [#4098](https://github.com/OrchardCMS/OrchardCore/pull/4098)
- Add liquid example for ContentCulturePicker [#4101](https://github.com/OrchardCMS/OrchardCore/pull/4101)
- README--add tutorial [#4108](https://github.com/OrchardCMS/OrchardCore/pull/4108)
- Documenttion of search query in new tab [#4102](https://github.com/OrchardCMS/OrchardCore/pull/4102)
- Implement IUserClaimStore to enable individual user claims. [#4070](https://github.com/OrchardCMS/OrchardCore/pull/4070)
- Localization Bugfix [#4078](https://github.com/OrchardCMS/OrchardCore/pull/4078)
- More async calls [#3930](https://github.com/OrchardCMS/OrchardCore/pull/3930)
- Move Localization folder out of App_Data [#4074](https://github.com/OrchardCMS/OrchardCore/pull/4074)
- Predefined List blank option fix [#4068](https://github.com/OrchardCMS/OrchardCore/pull/4068)
- Lucene indexation : convention on null field values [#4062](https://github.com/OrchardCMS/OrchardCore/pull/4062)
- add more detail step on README.md of OpenId [#4057](https://github.com/OrchardCMS/OrchardCore/pull/4057)
- Fix datepicker UI issue [#4050](https://github.com/OrchardCMS/OrchardCore/pull/4050)
- Fixes ToPascalCase [#4060](https://github.com/OrchardCMS/OrchardCore/pull/4060)
- Improve Kebab-casing performance [#4054](https://github.com/OrchardCMS/OrchardCore/pull/4054)
- Small refactors to Resources CDN and settings [#4044](https://github.com/OrchardCMS/OrchardCore/pull/4044)
- Using StringBuilder pooling from Fluid [#4047](https://github.com/OrchardCMS/OrchardCore/pull/4047)
- Updating Jint and Fluid [#4048](https://github.com/OrchardCMS/OrchardCore/pull/4048)
- Fix localization context issue in OrchardCore.Templates [#4042](https://github.com/OrchardCMS/OrchardCore/pull/4042)
- ContainedPart Index renaming [#4035](https://github.com/OrchardCMS/OrchardCore/pull/4035)
- Add a core CMS meta package [#4027](https://github.com/OrchardCMS/OrchardCore/pull/4027)
- Editing while reading: add a missing backtick and fix some typos [#4033](https://github.com/OrchardCMS/OrchardCore/pull/4033)
- Add sort on multiple fields for Lucene Queries [#4029](https://github.com/OrchardCMS/OrchardCore/pull/4029)
- Minor fixes [#3922](https://github.com/OrchardCMS/OrchardCore/pull/3922)
- BooleanField styling should match other fields [#4024](https://github.com/OrchardCMS/OrchardCore/pull/4024)
- Fix localized datepicker UI issue [#4002](https://github.com/OrchardCMS/OrchardCore/pull/4002)
- NullStringLocalizer shouldn't ignore formatted strings [#4019](https://github.com/OrchardCMS/OrchardCore/pull/4019)
- Indexes a Content.ContentItem.Parent field in Lucene for ContainedPart. [#4017](https://github.com/OrchardCMS/OrchardCore/pull/4017)
- Changing $zindex-sticky to 1000 instead of 1020 [#4023](https://github.com/OrchardCMS/OrchardCore/pull/4023)
- Display the workflow date with current timezone [#4003](https://github.com/OrchardCMS/OrchardCore/pull/4003)
- Adds Liquid Razor Extension Method & Markdown Helper parses liquid [#3992](https://github.com/OrchardCMS/OrchardCore/pull/3992)
- Added liquid support to markdown graphql query. [#4007](https://github.com/OrchardCMS/OrchardCore/pull/4007)
- Documentation to explain how to generate Po files [#3998](https://github.com/OrchardCMS/OrchardCore/pull/3998)
- Change Load Order of AntiforgeryToken [#3993](https://github.com/OrchardCMS/OrchardCore/pull/3993)
- Save hint text for link text [#3995](https://github.com/OrchardCMS/OrchardCore/pull/3995)
- Remove 'json' specified from GraphQL MD codeblocks [#3994](https://github.com/OrchardCMS/OrchardCore/pull/3994)
- Ability to extend/clear ContainedContentTypes. [#3978](https://github.com/OrchardCMS/OrchardCore/pull/3978)
- Updating yessql [#3988](https://github.com/OrchardCMS/OrchardCore/pull/3988)
- Make registered FB scripts virtual folder and tenant aware. [#3932](https://github.com/OrchardCMS/OrchardCore/pull/3932)
- Show connectionString hint for all data providers [#3484](https://github.com/OrchardCMS/OrchardCore/pull/3484)
- Plural extension should work with NullStringLocalizer [#3933](https://github.com/OrchardCMS/OrchardCore/pull/3933)
- Change label to "None" [#3965](https://github.com/OrchardCMS/OrchardCore/pull/3965)
- IShellConfiguration documentation [#3967](https://github.com/OrchardCMS/OrchardCore/pull/3967)
- Unpublish content should set modified datetime [#3972](https://github.com/OrchardCMS/OrchardCore/pull/3972)
- Admin scripts cache busting [#3960](https://github.com/OrchardCMS/OrchardCore/pull/3960)
- Bootstrap / Popper version  & cdn-integrity fixes [#3968](https://github.com/OrchardCMS/OrchardCore/pull/3968)
- Reload resource settings on update [#3971](https://github.com/OrchardCMS/OrchardCore/pull/3971)
- Graphql - make schema generation thread safe [#3935](https://github.com/OrchardCMS/OrchardCore/pull/3935)
- Bring back MediaSizeLimitAttribute [#3961](https://github.com/OrchardCMS/OrchardCore/pull/3961)
- Add permissions to localization & reverse proxy settings navigation [#3779](https://github.com/OrchardCMS/OrchardCore/pull/3779)
- Update style tag helper to use depends-on instead of dependencies [#3953](https://github.com/OrchardCMS/OrchardCore/pull/3953)
- ContentCulturePicker - Add ability to set Localization Cookie [#3894](https://github.com/OrchardCMS/OrchardCore/pull/3894)
- Add CustomSettings C# documentation [#3946](https://github.com/OrchardCMS/OrchardCore/pull/3946)
- Run AdminAttribute before any global filter with a default order of 0 [#3915](https://github.com/OrchardCMS/OrchardCore/pull/3915)
- Vue.js use proper CDN [#3920](https://github.com/OrchardCMS/OrchardCore/pull/3920)
- fix NRE on YoutubeFieldDisplayDriver when the field is not required [#3907](https://github.com/OrchardCMS/OrchardCore/pull/3907)
- NumericField (selectbox) not required fix [#3909](https://github.com/OrchardCMS/OrchardCore/pull/3909)
- Removing unnecessary styling on ReCaptcha [#3911](https://github.com/OrchardCMS/OrchardCore/pull/3911)
- Secure ContentPickerController with Admin filter [#3896](https://github.com/OrchardCMS/OrchardCore/pull/3896)
- ZoneOnDemand.AddAsync(). [#3864](https://github.com/OrchardCMS/OrchardCore/pull/3864)
- Add executeQuery GlobalMethod [#3903](https://github.com/OrchardCMS/OrchardCore/pull/3903)
- Role based permissions to display admin menus [#3875](https://github.com/OrchardCMS/OrchardCore/pull/3875)
- Prevents an antiforgery issue on setup. [#3622](https://github.com/OrchardCMS/OrchardCore/pull/3622)
- Fixes async call. [#3898](https://github.com/OrchardCMS/OrchardCore/pull/3898)
- Support single JTokenType.Object in BooleanQueryProvider [#3888](https://github.com/OrchardCMS/OrchardCore/pull/3888)
- Add permission for SearchController Api [#3883](https://github.com/OrchardCMS/OrchardCore/pull/3883)
- Prevent collisions with mvc scripttaghelper [#3886](https://github.com/OrchardCMS/OrchardCore/pull/3886)
- Update theme templates to use liquid filter on html fields [#3893](https://github.com/OrchardCMS/OrchardCore/pull/3893)
- LocalizationSettings recipe step documentation [#3895](https://github.com/OrchardCMS/OrchardCore/pull/3895)
- Adds asp-append-version support [#3581](https://github.com/OrchardCMS/OrchardCore/pull/3581)
- Content Culture Picker [#3813](https://github.com/OrchardCMS/OrchardCore/pull/3813)
- Localize setup screen [#3512](https://github.com/OrchardCMS/OrchardCore/pull/3512)
- Update Permissions [#3816](https://github.com/OrchardCMS/OrchardCore/pull/3816)
- Add pathbase. [#3857](https://github.com/OrchardCMS/OrchardCore/pull/3857)
- Add a .vsconfig file for easier provisioning when using VS 2019 [#3691](https://github.com/OrchardCMS/OrchardCore/pull/3691)
- Added grouping of widgets to their site layer. [#3873](https://github.com/OrchardCMS/OrchardCore/pull/3873)
- Always do a complete Liquid contextualization. [#3851](https://github.com/OrchardCMS/OrchardCore/pull/3851)
- Small improvement to ImageSharp pipeline [#3854](https://github.com/OrchardCMS/OrchardCore/pull/3854)
- Set content types during azure blob creation [#3856](https://github.com/OrchardCMS/OrchardCore/pull/3856)
- Fix misspelling (occured -> occurred) [#3858](https://github.com/OrchardCMS/OrchardCore/pull/3858)
- Implemented siteLayers graphql query. [#3861](https://github.com/OrchardCMS/OrchardCore/pull/3861)
- Implemented siteCultures graphql query. [#3863](https://github.com/OrchardCMS/OrchardCore/pull/3863)
- PluralRule is null for locale not recognized. [#3836](https://github.com/OrchardCMS/OrchardCore/pull/3836)
- Trumbowyg Semantic Defaults - div : div [#3843](https://github.com/OrchardCMS/OrchardCore/pull/3843)
- Rename Package.json -> package.json [#3822](https://github.com/OrchardCMS/OrchardCore/pull/3822)
- updated getting started guide, and remove missing file from OrchardCore.sln [#3830](https://github.com/OrchardCMS/OrchardCore/pull/3830)
- Create correct ContentZone for tab support when UpdateEditorAsync is called [#3845](https://github.com/OrchardCMS/OrchardCore/pull/3845)
- Clarify that Differentiator is the menu name (title). [#3424](https://github.com/OrchardCMS/OrchardCore/pull/3424)
-  Order ContentPicker items by DisplayText [#3808](https://github.com/OrchardCMS/OrchardCore/pull/3808)
- Fixes WidgetsList delete [#3814](https://github.com/OrchardCMS/OrchardCore/pull/3814)
- Localize date picker [#3707](https://github.com/OrchardCMS/OrchardCore/pull/3707)
- Log invalid SMTP certificate info [#3806](https://github.com/OrchardCMS/OrchardCore/pull/3806)
- Return HasPublished in ContentPickerResult when used with Lucene. [#3804](https://github.com/OrchardCMS/OrchardCore/pull/3804)
- Update Permissions.cs [#3786](https://github.com/OrchardCMS/OrchardCore/pull/3786)
- Added media assets graphql query support. [#3784](https://github.com/OrchardCMS/OrchardCore/pull/3784)
- Add 'view' button to media library items [#3787](https://github.com/OrchardCMS/OrchardCore/pull/3787)
- Remove dead code [#3783](https://github.com/OrchardCMS/OrchardCore/pull/3783)
- Fixes liquid controller views. [#3777](https://github.com/OrchardCMS/OrchardCore/pull/3777)
- Link to the rendered pages on readthedocs [#3785](https://github.com/OrchardCMS/OrchardCore/pull/3785)
- Fix broken link in ContentLocalization when no cultures are installed [#3782](https://github.com/OrchardCMS/OrchardCore/pull/3782)
- Add documentation for overriding Views [#3778](https://github.com/OrchardCMS/OrchardCore/pull/3778)
- Async tweaks [#3770](https://github.com/OrchardCMS/OrchardCore/pull/3770)
- Working on shell scopes. [#3178](https://github.com/OrchardCMS/OrchardCore/pull/3178)
- Update shell container creation. [#3467](https://github.com/OrchardCMS/OrchardCore/pull/3467)
- Clear content item element cache when updating a field [#3764](https://github.com/OrchardCMS/OrchardCore/pull/3764)
- Extend Facebook Documentation [#3774](https://github.com/OrchardCMS/OrchardCore/pull/3774)
- Non awaited async call [#3769](https://github.com/OrchardCMS/OrchardCore/pull/3769)
- Update SimpleMDE repo link [#3768](https://github.com/OrchardCMS/OrchardCore/pull/3768)


text:
class Logical : public Elem
{
public:
	bool elem;				// A boolean element is the internal representation.
	Logical() : Elem(LOGICAL)		// Default constructor.
	{
		elem = false;
	}

	Logical(bool t_val) : Elem(LOGICAL)	// Another constructor with argument.
	{
		elem = t_val;
	}

	Logical(string &t_val) : Elem(LOGICAL)  // Construct a logical object using its string representation.
	{
		elem = (t_val == "True") ? true : false;
	}

	bool operator==(Elem &e)
	{
		Logical * x = (Logical *)&e;
		return x->elem == this->elem;
	}

	shared_ptr<Elem> deep_copy()		// Deep_copy method, which of course returns just a logical instance since it's atomic.
	{
		return shared_ptr<Elem>{new Logical(elem)};	// Return the address to a new Logical object, initialized with the same value as this.
	}
	string to_string()			// Virtual to_string method for display.
	{
		return (elem) ? "True" : "False";
	}
};

#endif