自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(87)
  • 收藏
  • 关注

原创 基于近似计算的同态加密方案CKKS17----Encoding和Decoding

本文主要是针对CKKS17以及OpenMined教程的学习心得。

2022-03-29 16:55:58 1110 2

原创 基于近似计算的同态加密方案CKKS17----Relinearization和Rescaling

Relinearization 重线性化主要是针对密文乘法后密文尺寸膨胀的问题。 先来看加解密过程。生成公私钥过程: 加解密过程: 同态加法及解密正确性:...

2022-04-01 11:04:59 1153

原创 基于近似计算的同态加密方案CKKS17----实现库介绍

基于近似计算的同态加密(CKKS17)库使用介绍。

2021-12-27 09:16:48 15108 1

原创 C++ STL 常用函数

partial_sum、adjacent_difference、copypartial_sum是累计求和,adjacent_difference是求相邻元素差。#include <vector>#include <vector>#include <iterator>vector<int> v {2, 3, 5, 7, 11, 13, 17, 19};cout << "Original data: ";copy(v.begin()

2021-08-30 10:01:07 171

原创 神奇笔试题

lambda表达式:#include <iostream>#include <algorithm>#include <vector>using namespace std;int main(){ int a=9; auto fun1=[=]{return a+1;}; auto fun2=[&]{return ++a;}; auto fun3=[&]{return a+1;}; ++a;

2021-08-30 09:11:09 98

原创 DES加密系统 C++实现

main.cpp:#include <iostream>#include <vector>#include <string>#include <algorithm>#include <iomanip>#include "constnum.h"using namespace std;//vector<vector<int>> v{{1,2},{3,4}};string fill64n(strin...

2021-04-20 09:10:32 366

原创 并查集

class DisjointSetUnion {private: vector<int> f, rank; int n;public: DisjointSetUnion(int _n) { n = _n; rank.resize(n, 1); f.resize(n); for (int i = 0; i < n; i++) { f[i] = i; } .

2021-01-11 16:26:39 104

原创 Dan Boneh Coursera Cryptography I Week 1 - Programming Assignment

Many Time PadLet us see what goes wrong when a stream cipher key is used more than once. Below are eleven hex-encoded ciphertexts that are the result of encrypting eleven plaintexts with a stream cipher, all with the same stream cipher key. Your goal is

2020-06-28 11:27:10 1216

原创 密码:杂学

Base64百度百科:Base64是网络上最常见的传输8Bit字节码的编码方式之一,Base64就是一种基于64个可打印字符来表示二进制数据的方法。Base64用4个6位表示3个8位。Base64加密后的密文均有大小写字母、数字、+、-、=组成。其中若最后四个6位凑不足,用=部位。...

2020-04-07 17:47:50 205

原创 数据库学习笔记

基本概念 数据独立性: 物理独立性:应用程序与数据库中数据的物理存储相对独立。逻辑独立性:应用程序与数据库的逻辑结构独立。 两类数据模型: 概念模型: 码:唯一标识实体的属性称为码。(学号之于学生) 实体型:用实习及其属性名集合来抽象刻画同类实体。 实体集:同一类型实体的集合。逻辑模型和物理模型: (数据模型):分为层次模型、网状...

2020-03-24 18:27:27 455

原创 C++11学习笔记

variadic templates 数量不定的模板参数 #include <iostream>using namespace std;void print(){}template<typename T,typename... Types>void print(const T& firstArg,const Types&... args...

2020-03-22 10:18:55 165

原创 《Python自然语言处理》问题汇总

针对Steven Bird等著《Python自然语言处理》书中问题总结:P3:nltk.download()不好用文件下载:百度网盘下载,提取码:7dbt下载完成后解压放在C:\下即可P7:xxx.generate()函数报错NLTK3.x.x等新版本无此函数了,旧版本才有这么高级的功能。...

2020-02-27 15:39:46 237

原创 Leetcode 832. Flipping an Image

You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent house...

2019-12-30 12:09:32 101

原创 算符优先分析过程 编译原理

算符优先分析过程只考虑算符(终结符)之间的优先关系,分析扫描每个规约式的算符间优先关系。根据龙书阐述,算符优先分析逐渐淘汰了。orz但仍然实现之。示例语法如下:D->#E#E->E+T|TT->T*F|FF->P$F|PP->(E)|imain.cpp#include <iostream>#include...

2019-12-27 10:37:32 1693

原创 模拟银行系统 java,mysql实现

模拟电子银行,开户,存钱,取钱,查询用户信息,修改用户信息,查询余额,查询明细,注销,退出,等等基本实现了相关功能。但是规定每次需要重新登录,还是很麻烦的。另外用户注销时候,没有规定删除operator表中信息,此处会有问题。但想了半天觉得现实中这部分信息需要保留一段时间,不应该删除。orz数据库设计:bank.java:package mybank;...

2019-07-10 16:45:49 4441 7

原创 兵乓球比赛 8255 C语言实现

1)基本要求用8个LED发光管(红黄绿)的来回滚动显示来模拟打乒乓球时乒乓球在两边球台上的来回运动。比赛双方用按钮/开关(双方各用1个按钮/开关)的方法来模拟发球与接球,即发球方按动其控制的按钮/开关/健,球从发球方一侧向对方运动(LED发光管从发球方到对方逐个点亮,滚动显示),当球运动至接球方时,接球方立即按动其控制的按钮/开关/键,“击球”使球“弹回”发球方一侧,如此周而复始,直至在...

2019-07-10 13:34:00 709

原创 汇编 子程序与操作系统功能调用

1.编写一个求n!的子程序,利用它求1!+2! +3! +4! +5! +6!的和并输出。 要求参数的传递分别采用:寄存器传递、全局变量传递,堆栈传递三种不同的方法实现。 1,2使用寄存器传递,3,4使用全局变量,5,6使用堆栈include vcIO.inc.data frmStr byte ' %5d',10,0 result dword ? par...

2019-05-18 09:28:59 2061

原创 汇编 学习总结

关于push和pop:mov eax,4mov ebx,5push eaxpush ebxpop eaxpop ebx;交换eax与ebx

2019-05-17 21:26:04 207

原创 汇编 循环程序设计

编程写一个完整的程序,将数组array中的元素按逆序存放,要求程序中附加的变量最少。数据段的定义如下: .data array dword 12,4, 168,122,-33,56,78,99,345, 66,-5include vcIO.inc.data array dword 12,4, 168,122,-33,56,78,99,345, 66,...

2019-04-30 21:48:56 3159 7

原创 Arduino温湿度监测与股票涨跌提醒

通过Arduino,实现如下两个功能:主要包含温湿度传感器及相关的加热、加湿、制冷、除湿设备,通过对环境温度及湿度的测量来控制具体设备的工作状态,根据相关指示灯颜色来区分工作状态。 对于指定股票实时监测,并且在股票价额有较大波动时提醒使用者关注股价变化。本设备通过两种途径提醒使用者,一是通过相关指示灯的闪烁变化,二是通过关联账号手机短信提醒。#include <ESP8266WiF...

2019-04-27 14:32:16 573

原创 基于twilio的短信天气提醒功能

Twilio是一个做成开放插件的电话跟踪服务,可以通过twilio相关功能接入物联网设备达到及时提醒的功能。本程序代码需要注册twilio账号,并部署在服务器,可实现每天定时短信天气提醒。服务器send.py程序:#coding=utf-8from twilio.rest import Clientimport json , requests , sys , time ,date...

2019-04-26 16:48:15 376

原创 判断闰年,循环求和及三数字排序 汇编实现

输入一个年份,判断其是否是闰年。include vcIO.inc.data frmStr1 byte '%d', 0 year dword ? hello2 byte 'runnian',0 hello3 byte 'feirunnian',0 a dword ?.code main proc invoke scanf, offs...

2019-04-21 09:07:59 632

原创 python3 AttributeError: module 'urllib' has no attribute 'urlopen'问题

import urlliburl='xxx'a=urllib.urlopen(url)print(a.read())如此写会报题目所示错误,改为如下代码即可。import urllib.requseturl='xxx'a=urllib.request.urlopen(url)print(a.read())...

2019-04-13 16:55:04 2371

原创 c++万能头文件头文件bits/stdc++.h

#include &lt;bits/stdc++.h&gt;包含了诸多头文件的头文件,用后不再担忧长长一串串头文件,c11已支持。

2019-03-11 21:55:32 568

原创 Leetcode 997. Find the Town Judge

In a town, there areNpeople labelled from1toN. There is a rumor that one of these people is secretly the town judge.If thetown judge exists, then:The town judge trusts nobody. Everybody (e...

2019-03-10 13:58:52 138

原创 改变图片分辨率

from PIL import Imagepath=r"*.JPG"im=Image.open(path)size=28,28name=r"*-1.JPG"im.thumbnail(size)im.save(name,"JPEG")将图片改成28*28分辨率的图片,可依次调整图片进行神经网络等训练学习。...

2019-03-06 19:06:40 2375

原创 python神经网络编程 手写数字识别

import numpyimport scipy.special#import matplotlib.pyplotclass neuralNetwork: def __init__(self,inputnodes,hiddennodes,outputnodes,learningrate): self.inodes=inputnodes self.h...

2019-03-05 17:24:48 729

原创 自动运行脚本

控制面板------管理工具------任务计划程序 中可编辑脚本自动运行。之前还傻傻地写while(true)一直运行脚本。orz

2019-02-28 11:59:08 3200

原创 mysql找不到my.ini及.err错误日志解决方法

隐藏文件可视 c盘目录下url目录输入%ProgramData% 进入隐藏的programdata文件夹 找到mysql文件夹 进入后即可看见my.ini 进入data文件夹即可看见.err错误日志

2019-02-27 15:51:01 2816 2

原创 Python数据分析基础第5章例

5.1:import sysimport csvimport globimport osfrom datetime import datefrom xlrd import open_workbook,xldate_as_tuplepath="C:\\Users\\wenmiao_\\Desktop\\pya\\11"outputfile=r"C:\Users\wenmiao...

2019-02-26 22:23:42 462

原创 python 多行注释 unicode error 问题

"""input_file=r'C:\Users\wenmiao_\Desktop\pya\data.csv'file_reader=csv.reader(open(input_file,'r'),delimiter=',')header=next(file_reader,None)for row in file_reader: data=[] for column_i...

2019-02-26 11:58:47 1488

原创 LeetCode 948. Bag of Tokens

You have an initial power P, an initial score of 0 points, and a bag of tokens.Each token can be used at most once, has a value token[i], and has potentially two ways to use it.If we have at least...

2018-11-25 20:48:10 287

原创 LeetCode 946. Validate Stack Sequences

Given two sequences pushed and popped with distinct values, return true if and only if this could have been the result of a sequence of push and pop operations on an initially empty stack. Example...

2018-11-25 20:45:14 256

原创 LeetCode 945. Minimum Increment to Make Array Unique

Given an array of integers A, a move consists of choosing any A[i], and incrementing it by 1.Return the least number of moves to make every value in A unique. Example 1:Input: [1,2,2]Output:...

2018-11-25 20:41:27 225

原创 Failed building wheel for xxx 解决办法

在下面链接下载相应whl下载whl链接 安装 pip install 刚刚下载whl文件绝对路径

2018-10-21 22:18:45 35404 4

原创 LeetCode 926. Flip String to Monotone Increasing

A string of '0's and '1's is monotone increasing if it consists of some number of '0's (possibly 0), followed by some number of '1's (also possibly 0.)We are given a string S of '0's and '1's, and w...

2018-10-21 11:00:36 212

原创 LeetCode 927. Three Equal Parts

Given an array A of 0s and 1s, divide the array into 3 non-empty parts such that all of these parts represent the same binary value.If it is possible, return any [i, j] with i+1 &lt; j, such that:...

2018-10-21 11:00:31 171

原创 《Python 密码学编程》总结

大致了解如下加密法:凯撒加密法 乘法加密法 仿射加密法 替代加密法 维吉尼亚加密法 一次一密加密法 RSA加密法读罢有三点掌握仍不足:模逆,拉宾米勒素数测试,卡西斯基试验获取间距的因数的原理。这三点都与数学相关,噢,不,数学,噢耶!模逆定义:两个数字a和m的模逆i满足(a*i)%m==1。 ...

2018-10-20 17:38:05 706

原创 pyzmail安装问题

pip install pyzmail不好用的,换为pip install pyzmail36即可。而使用时仍然用import pyzmail。    

2018-10-07 20:59:30 2547 7

原创 python API 查询天气

命令行输入"weather 城市名"即可查询天气相关信息。运用天气API读取相关JSON内天气信息。天气API及用到的_city.json可参见https://www.sojson.com/blog/305.htmlimport json , requests , sysjsonWeather=open(r"C:\shell\_city.json",'r',encoding=...

2018-10-05 17:41:30 1326 1

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除