坦然的龙
yunlong167167 · 共 187 篇文章
折半查找法
public static void main(String args) { int a = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, top, bot, mid=-1, m = 3; top = 0; bot = 9; while (top <= bot) { mid = (top + bot) / 2; if (a == m) { break; } else if (a < m) { top = mid + 1; } else { bot = mid - 1; } } if(top<=bot){ System.out.println(mid+""); }else …
2019-06-17 18:11 · java · 评论(0)
powerDesigner默认显示的列是Name及类型
powerDesigner默认显示的列是Name及类型,如下图示: 现在需要显示注释列,以便使得ER图更加清晰。但是PowerDesigner勾选Comment显示没有效果,所以通过以下几步来处理: 双击表,弹出表属性对话框,切到ColumnTab,默认是没显示Comment的,显示Comment列,这么做 设置显示Comment 有了Comment列,并补充Comment信息 确定保存,打开菜单 Tools>Display Perferences.. 调整显示的Attribute OK,保存,确定,退出设置页,应用到所有标识,可以看到表变化 接下来需要执行VBS脚本,借鉴网络上的脚本,并且…
2018-04-20 11:11 · mysql · 评论(0)
ssh_key授权
生成rsa_key , 并添加公钥到服务器 windows: 下载XSHELL,在登陆的时候可以选择用密钥登陆, 然后直接生成,保存可以得到rsa_key.pub。 linux or Mac: 1、生成SSH密钥对 ssh-keygen -t rsa 1 2、建议直接回车使用默认路径 Enter file in which to save the key (/root/.ssh/id_rsa): 1 3、输入密码短语(留空则直接回车) Enter passphrase (empty forno passphrase): 1 4、重复密码短语 Enter same passphrase aga…
2018-04-20 10:37 · linux · 评论(0)
用lua实现登陆超时拦截
local ngx = require("ngx") local resty_redis = require("resty.redis") local resty_cookie = require("resty.cookie") local cjson = require("cjson") local notFilterUrlMap={ ="login"--not check url } local redis=resty_redis:new() redis:set_timeout(1000) ok,err = redis:connect("192.168.23.21","6379") if…
2018-02-06 17:07 · linux · 评论(0)
jasypt-spring-boot使用说明
jasypt-spring-boot使用说明 加密密码 命令: java -cp F://.m2/repository/org/jasypt/jasypt/1.9.2/jasypt-1.9.2.jar org.jasypt.intf.cli.JasyptPBEStringEncryptionCLI input="test123" password=e9fbdb2d3b213c28575c095ae0029e05f40f77ee53ecd24af815bdff5479dd2a algorithm=PBEWithMD5AndDES 红色部分代表需要加密的密码。命令回显如下(红色部分是加密后的密文…
2017-12-05 10:37 · springboot · 评论(0)
verynginx
实现md5 前端加签,后端验签 参考 https://github.com/alexazhou/VeryNginx/wiki/%E7%9B%AE%E5%BD%95
2017-12-05 10:23 · linux · 评论(0)
简单网址缩短short
nginx 配置 location /_z/ { lua_socket_keepalive_timeout 30s; content_by_lua_file /usr/local/openresty/lualib/short/index.lua; } location /short { lua_socket_keepalive_timeout 30s; content_by_lua_file /usr/local/openresty/lualib/short/shorten.lua; } 修改config.lua redis 地址 转自 https://github.com/peanode/…
2017-12-05 10:23 · linux · 评论(0)
新版tulip实施方案
新版tulip实施方案 背景: 基于《新版推广运营方案》的内容设计出新版的运营推广系统,针对里面涉及到各种业务场景提出各种解决方案,而目前最大的问题在于系统的边界划分,主要存在两种情况: 业务数据在业务系统(mimosa)和运营推广系统(tulip)都存一份, 通过事件监听(也就是代码埋点),但是这样做出现: 1.这样tulip系统存在业务数据, 导致tulip系统的职责不够单一明确。 2.也正因为如此与其他系统耦合度太高,如将来对接借贷等其他系统还得修改代码埋点,不利于tulip系统的可扩展性。 3.另外人工干预的异常处理导致数据不同步,如对账定单处理、数据修复等。 基于以上问题,可以考虑…
2017-11-17 13:33 · 系统设计 · 评论(0)
linux使用rpm重装jdk
linux使用rpm重装jdk 1、卸载jdk #rpm -qa | grep gcj 如果输出没有内容,说明没有jdk,如果输出有内容,要把搜索到的文件卸载掉,命令为: #rpm -e --nodeps [上步操作输出的文件] 然后使用 #whereis java 直接删除java相关的文件或文件夹 2、下载你需要的jdk 到oracle官网 http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html 找下载链接 然后使用wget下载,由于oracle需要accept lincenc…
2017-05-17 16:57 · linux · 评论(0)
rinetd 实现端口映射/转发/重定向
rinetd,实现端口映射/转发/重定向 官网地址 http://www.boutell.com/rinetd 软件下载 wget http://www.boutell.com/rinetd/http/rinetd.tar.gz 解压安装 tar zxvf rinetd.tar.gz make make install 编辑配置 vi /etc/rinetd.conf 0.0.0.0 8080 172.19.94.3 8080 0.0.0.0 2222 192.168.0.103 3389 1.2.3.4 80 192.168.0.10 80 说明一下(0.0.0.0表示本机绑定所有可用地址…
2017-05-17 16:18 · linux · 评论(0)
Redis 3.2.1集群搭建
一、概述 Redis3.0版本之后支持Cluster. 1.1、redis cluster的现状 目前redis支持的cluster特性: 1):节点自动发现 2):slave->master 选举,集群容错 3):Hot resharding:在线分片 4):进群管理:cluster xxx 5):基于配置(nodes-port.conf)的集群管理 6):ASK 转向/MOVED 转向机制. 1.2、redis cluster 架构 1)redis-cluster架构图 架构细节: (1)所有的redis节点彼此互联(PING-PONG机制),内部使用二进制协议优化传输速度和带宽. (2…
2017-05-11 13:57 · redis · 评论(0)
Git命令速查表
Git 命令速查表 [html] view plain copy 一、 Git 常用命令速查 git branch 查看本地所有分支 git status 查看当前状态 git commit 提交 git branch -a 查看所有的分支 git branch -r 查看远程所有分支 git commit -am "init" 提交并且加注释 git remote add origin git@192.168.1.119:ndshow git push origin master 将文件给推到服务器上 git remote show origin 显示远程库origin里的资源 git p…
2017-05-09 11:58 · git · 评论(0)