import itertools

class Set(list):
    def __init__(self, params):
        super(Set, self).__init__()
        self.extend(reduce(lambda x, y: x if y in x else x + [y], [[], ] + params))

def __eq__(self, others):
    if len(self) != len(others):
        return False
    for param in self:
        if param not in others:
            return False
    return True

def union(*args):
    return Set(list(itertools.chain(*args)))

def intersection(*args):
    return reduce(lambda x, y: [z for z in union(x, y) if z in x and z in y], list(args))

def difference(*args):
    return [z for z in union(*args) if list(itertools.chain(*args)).count(z) == 1]

def all_difference(*args):
    return [z for z in union(*args) if z not in intersection(*args)]

no hash tools的更多相关文章

  1. win10 右键菜单添加Git Hash Here

    1.通过在"运行"中输入'regedit',打开注册表. 2.找到[HKEY_CLASSES_ROOT\Directory\Background]. 3.在[Background] ...

  2. Unity打包同一文件Hash不一样

    问题起因 游戏开发基本都会涉及到资源版本管理及更新,本文记录我在打包过程中遇到的一小问题: 开过中常用于标记资源版本的方法有计算文件Hash.VCS的版本等. 在Unity中对同一个资源文件进行多次打 ...

  3. IMS Global Learning Tools Interoperability™ Implementation Guide

    Final Version 1.1 Date Issued:            13 March 2012 Latest version:         http://www.imsglobal ...

  4. The OAuth 2.0 Authorization Framework-摘自https://tools.ietf.org/html/rfc6749

                                                                                  Internet Engineering T ...

  5. General Purpose Hash Function Algorithms

    General Purpose Hash Function Algorithms post@: http://www.partow.net/programming/hashfunctions/inde ...

  6. 总结:man, info, hwclock, cal, type, which, dirname, basename, who, which, whatis, makewhatis, hash, tty

    man, info, help, date, hwclock, cal, shutdown, reboot, halt, poweroff, type, cd, which, dirname, bas ...

  7. 基于USB网卡适配器劫持DHCP Server嗅探Windows NTLM Hash密码

    catalogue . DHCP.WPAD工作过程 . python Responder . USB host/client adapter(USB Armory): 包含DHCP Server . ...

  8. 解决android studio项目中Failded to sync Gradle project 'XXXX' Cause:failed to find target with hash string 'android-16'问题

    之前在github上通过import module导入一个项目,结果报错,提示找不到sdk相应的版本xx,而我的compileSdkVersion明明写的是23不是xx,查了半天也没解决.最后只好下载 ...

  9. The Best Hacking Tools

    The Best Hacking Tools Hacking Tools : List of security tools specifically aimed toward security pro ...

随机推荐

  1. C#判断网络链接状态

    using System.Net.NetworkInformation; bool isLocalAreaConnected = NetworkInterface.GetIsNetworkAvaila ...

  2. android 开发,视频群聊引发短信异常

    说到 NDK 开发,其实是为了有些时候为了项目需求需要调用底层的一些 C/C++ 的一些东西:另外就是为了效率更加高些. 但是很多时候能不用就不用:这个是啥原因?个人感觉有些时候是觉得麻烦,首先要配置 ...

  3. 阿里云CentOS 7.3安装Redis详细步骤

    ############  准备  ############### 从Redis官网下载Linux redis3.2.6版本,我下载的redis-3.2.6.tar.gz(目前最新稳定版),下载到/u ...

  4. iOS开发自定义字体之静态字体

    最后更新 2017-04-25 在iOS开发中经常会用到字体, 一般字体文件比较小的,单一的,几十k, 可以通过内置进去;如果字体文件比较多或者字体文件比较大,通常通过动态加载方式. 静态加载方式 将 ...

  5. JPA Hibernate 等面向对象持久化框架难以解决的问题

    1+N查询性能问题 单个更新实体对象,而不是使用单调语句 在Java端做了很重的数据处理,数据库端反而很少 多层次 fetch inner join 难以实现 关联映射难以自定义条件 级联操作难以掌控 ...

  6. MySQL Schedule Event

    建立事件历史日志表-- 用于查看事件执行时间等信息create table t_event_history  (     dbname  varchar(128) not null default ' ...

  7. Oracle redo与undo浅析

    http://liwenshui322.iteye.com/blog/1488949 一. 什么是redo(用于前滚数据) redo也就是重做日志文件(redo log file),Oracle维护着 ...

  8. c# access oledb helper class

    连接Access数据库 using System; using System.Collections.Generic; using System.Linq; using System.Text; us ...

  9. 在自定义组件中获取spring底层组件

    要想在自定义组件中获取spring底层的各种组件,只需让自定义组件实现一系列接口即可,这些接口都是Aware的子接口.常见的有: 1. ApplicationContextAware——用于获取IOC ...

  10. 【ABAP系列】SAP ABAP 宏的简单使用

    公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[ABAP系列]SAP ABAP 宏的简单使用 ...