作者:じ☆ve宝贝
> 通过shell脚本发送钉钉群消息并@用户 ``` #/bin/bash function sendMessageToDingding(){ dingtalkUrl="https://oapi.dingtalk.com/robot/send?access_token=xxxxx" echo $1 $2 # 发送钉钉消息 curl "${dingtalkUrl}" -H 'Content-Type: application/json' -d " { \"text\": { \"content\": \"$3\" }, \"at\": { \"atMobiles\":[ $1 ], \"isAtAll\": false }, \"msgtype\": \"text\" }" } sendTo="$1" subject=`echo $2 | tr '\r\n' '\n'` message=`echo $3 | tr '\r\n' '\n'` sendMessageToDingding ${sendTo} "${subject}:\n${message}" ``` $1 @用户的手机号 $2 发送消息的内容 **测试脚本** ``` ./dingtalk.sh 177xxxxxxx "这里是标题" "测试shell发送钉钉消息" ```
作者:Happy生龙
### 1.同一个容器(tomcat、jboss等)Web app root system property already set to different value: 'webapp.root' ##### 解决:web.xml中直接添加: ``` <context-param> <param-name>webAppRootKey</param-name> <param-value>webapp.root</param-value> </context-param> //"webapp.root"这个字符串可以随便写任何字符串。如果不配置默认值是"webapp.root"。 ``` ### 2.如果你使用了阿里开源的druid,会出现: ``` javax.management.InstanceNotFoundException: com.alibaba.druid:type=DruidDataSourceStat ``` ##### 解决:这个应该可以,我这边直接在catalina.sh加入: ``` JAVA_OPTS="-server -Xms512M -Xmx512M -XX:PermSize=512M -XX:MaxPermSize=512M -Ddruid.registerToSysProperty=true" ``` **随时补充……**
作者:じ☆ve宝贝
让用户输入中文变成乱码,亲测MAC搜狗,Win10下chrome使用微软输入法,以及QQ拼音输入法,ie也会有问题,edge没有问题。 效果图: #### 我只输入了he显示成了hhehe  ``` <html> <body> 姓名<input type="text" placeholder="请输入中文查看效果" oninput="this.value=ignoreSpaces(this.value);" > <script> function ignoreSpaces(string) { var temp = ""; string = '' + string; splitstring = string.split(" "); for(i = 0; i < splitstring.length; i++) temp += splitstring[i]; return temp; } </script> </body> </html> ```
作者:じ☆ve宝贝
错误如下: ``` java.lang.IllegalArgumentException: Name for argument type [java.lang.String] not available, and parameter name information not found in class file either. at org.springframework.util.Assert.notNull(Assert.java:112) at org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.updateNamedValueInfo(AbstractNamedValueMethodArgumentResolver.java:134) at org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.getNamedValueInfo(AbstractNamedValueMethodArgumentResolver.java:112) at org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.resolveArgument(AbstractNamedValueMethodArgumentResolver.java:81) at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:75) at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:156) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:117) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778) at javax.servlet.http.HttpServlet.service(HttpServlet.java:114) at javax.servlet.http.HttpServlet.service(HttpServlet.java:91) at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:76) at com.caucho.server.cache.CacheFilterChain.doFilter(CacheFilterChain.java:158) at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:178) at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:241) at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:268) at com.caucho.server.port.TcpConnection.run(TcpConnection.java:586) at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:690) at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:612) at java.lang.Thread.run(Thread.java:662) ``` 因: 这个错误主要是因为action的参数标注默认是debug级别,比如 ``` @RequestMapping(value = "/login") public ModelAndView login(String userName, String password, HttpServletRequest request) { …… ``` 此时userName的级别时debug级别,而在linux、或者anbt下编译时是忽略了这些标注,导致请求时就会找不到userName的参数。 解决方法: 1. 修改参数的写法,比如修改为 ``` @RequestMapping(value = "/login") public ModelAndView login(@RequestParam("userName") String userName, @RequestParam("password") String password, HttpServletRequest request) { …… ``` 2.修改编译脚本(添加 debug="true") ``` <target name="compile" depends="clean"> <javac source="${javaVersion}" target="${javaVersion}" srcdir="${basedir}" destdir="${basedir}/build" debug="true" includeantruntime="false"> <compilerarg line="-encoding UTF-8" /> <classpath refid="project.lib"></classpath> </javac> </target> ```
作者:微信小助手
<blockquote class="js_blockquote_wrap" data-type="2" data-url="" data-author-name="" data-content-utf8-length="7" data-source-title=""> <section class="js_blockquote_digest"> <section> <span style="font-size: 15px;letter-spacing: 1px;">SM,第一篇</span> </section> </section> </blockquote> <p><span style="font-size: 15px;letter-spacing: 1px;"> </span></p> <p><span style="letter-spacing: 1px;"><strong><span style="font-size: 15px;letter-spacing: 1px;">服务网格</span></strong><span style="font-size: 15px;letter-spacing: 1px;">(ServiceMesh)这两年异常之火,号称是下一代微服务架构,接下来两个月,准备系统性的写写这个东西,希望能够让大家对最新的架构技术,有个初步的了解。</span></span></p> <p><span style="color: rgb(0, 82, 255);font-size: 15px;letter-spacing: 1px;"><em>画外音:</em><em></em><em>我的行文的风格了,“为什么”往往比“怎么样”更重要。</em><em></em></span></p> <p><span style="font-size: 15px;letter-spacing: 1px;"> </span></p> <p><span style="letter-spacing: 1px;"><span style="font-size: 15px;letter-spacing: 1px;">互联网公司,经常使用的是</span><span style="font-size: 15px;letter-spacing: 1px;color: rgb(255, 76, 0);">微服务分层架构</span><span style="font-size: 15px;letter-spacing: 1px;">。</span></span></p> <p><span style="color: rgb(0, 82, 255);font-size: 15px;letter-spacing: 1px;"><em>画外音:</em><em></em><em>为什么要服务化,详见《</em><em><a href="http://mp.weixin.qq.com/s?__biz=MjM5ODYxMDA5OQ==&mid=2651961720&idx=1&sn=94d1e2b253b715368e6424ec37cd3a1a&chksm=bd2d0ca48a5a85b21d9e7a7e54d69734d8d845ed085393246f2732f9154a145b8a71b6feecac&scene=21#wechat_redirect" target="_blank" data-itemshowtype="0" data-linktype="2">服务化到底解决什么问题?</a></em><em>》。</em><em></em></span></p> <p><span style="font-size: 15px;letter-spacing: 1px;"> </span></p> <p><span style="letter-spacing: 1px;"><span style="font-size: 15px;letter-spacing: 1px;">随着数据量不断增大,吞吐量不断增加,业务越来越复杂,服务的个数会越来越多,</span><span style="font-size: 15px;letter-spacing: 1px;color: rgb(255, 76, 0);">分层会越来越细</span><span style="font-size: 15px;letter-spacing: 1px;">,除了<strong>数据服务层</strong>,还会衍生出<strong>业务服务层</strong>,<strong>前后端分离</strong>等各种层次结构。</span></span></p> <p><span style="color: rgb(0, 82, 255);font-size: 15px;letter-spacing: 1px;"><em>画外音:</em><em></em><em>分层的细节,详见《</em><em><a href="http://mp.weixin.qq.com/s?__biz=MjM5ODYxMDA5OQ==&mid=2651960558&idx=1&sn=57189db18602b77bfcce1a258f66e329&chksm=bd2d01328a5a88245d4d91b90abf759c4a112562785c5641e7b8835097ab2e7bfce10efa1c32&scene=21#wechat_redirect" target="_blank" data-itemshowtype="0" data-linktype="2">互联网分层架构演进</a>》。</em></span></p> <p><span style="font-size: 15px;letter-spacing: 1px;"> </span></p> <p><span style="font-size: 15px;letter-spacing: 1px;">不断发现主要矛盾,抽离主要矛盾,解决主要矛盾,架构自然演进了,微服务架构,<strong>潜在的主要矛盾会是什么呢?</strong><strong></strong></span></p> <p><span style="font-size: 15px;letter-spacing: 1px;"> </span></p> <p><span style="font-size: 15px;letter-spacing: 1px;">引入微服务架构,一般会引入一个RPC框架,来完成整个RPC的调用过程。</span></p> <p style="text-align: left;"><img class="rich_pages" data-copyright="0" data-ratio="1.1666666666666667" data-s="300,640" src="/upload/1a6fa278426db90c4c8979c360e08f5c.png" data-type="png" data-w="120" style=""></p> <p><span style="font-size: 15px;letter-spacing: 1px;">如上图粉色部分所示,RPC分为:</span></p> <ul class=" list-paddingleft-2" style="list-style-type: disc;"> <li><p><span style="font-size: 15px;letter-spacing: 1px;">RPC-client,它嵌在调用方进程里</span></p></li> <li><p><span style="font-size: 15px;letter-spacing: 1px;">RPC-server,是服务进程的基础</span></p></li> </ul> <p><span style="color: rgb(0, 82, 255);font-size: 15px;letter-spacing: 1px;"><em>画外音:</em><em></em><em>《</em><em><a href="http://mp.weixin.qq.com/s?__biz=MjM5ODYxMDA5OQ==&mid=2651961985&idx=1&sn=6f757843f5c159eab00d847e9c2cc995&chksm=bd2d0f5d8a5a864b05fada6919204378134e174f1105a0716dd879845b0d365c913ef8e94a12&scene=21#wechat_redirect" target="_blank" data-itemshowtype="0" data-linktype="2">离不开的微服务架构,脱不开的RPC细节</a>》。</em></span></p> <p><span style="font-size: 15px;letter-spacing: 1px;"> </span></p> <p><span style="font-size: 15px;letter-spacing: 1px;">不只是微服务,MQ也是类似的架构:</span></p> <p style="text-align: left;"><img class="rich_pages" data-copyright="0" data-ratio="1.768" data-s="300,640" src="/upload/b59605336f221c5f978a82f50db0d81b.png" data-type="png" data-w="125" style=""></p> <p><span style="font-size: 15px;letter-spacing: 1px;">如上图粉色部分所示,MQ分为:</span></p> <ul class=" list-paddingleft-2" style="list-style-type: disc;"> <li><p><span style="font-size: 15px;letter-spacing: 1px;">MQ-send-client</span></p></li> <li><p><span style="font-size: 15px;letter-spacing: 1px;">MQ-server</span></p></li> <li><p><span style="font-size: 15px;letter-spacing: 1px;">MQ-recv-client</span></p></li> </ul> <p><span style="color: rgb(0, 82, 255);font-size: 15px;letter-spacing: 1px;"><em>画外音:</em><em></em><em>《</em><em><a href="http://mp.weixin.qq.com/s?__biz=MjM5ODYxMDA5OQ==&mid=2651960726&idx=1&sn=0fdaf0e7040318aabfeba553f815d691&chksm=bd2d004a8a5a895ca80180443cc0f18e66b3d15dbbbd120dabaf3e6d4ef00fbc1030bf41c24b&scene=21#wechat_redirect" target="_blank" data-itemshowtype="0" data-linktype="2">MQ,互联网架构解耦神器</a>》。</em></span></p> <p><span style="font-size: 15px;letter-spacing: 1px;"> </span></p> <p><span style="font-size: 15px;letter-spacing: 1px;">框架只是第一步,越来越多和RPC,和微服务相关的功能,会被加入进来。</span></p> <p><span style="font-size: 15px;letter-spacing: 1px;"> </span></p> <p><span style="font-size: 15px;letter-spacing: 1px;"><strong>例如:</strong><strong></strong><strong>负载均衡</strong><strong></strong></span></p> <p style="text-align: left;"><img class="rich_pages" data-copyright="0" data-ratio="0.4148471615720524" data-s="300,640" src="/upload/89bcf1019aea845a041290a5d25d1dbf.png" data-type="png" data-w="458" style=""></p> <p><span style="font-size: 15px;letter-spacing: 1px;">如果要扩展多种负载均衡方案,例如:</span></p> <ul class=" list-paddingleft-2" style="list-style-type: disc;"> <li><p><span style="font-size: 15px;letter-spacing: 1px;">轮询</span></p></li> <li><p><span style="font-size: 15px;letter-spacing: 1px;">随机</span></p></li> <li><p><span style="font-size: 15px;letter-spacing: 1px;">取模</span></p></li> <li><p><span style="font-size: 15px;letter-spacing: 1px;">一致性哈希</span></p></li> </ul> <p><span style="font-size: 15px;letter-spacing: 1px;">RPC-client需要进行升级。</span></p> <p><span style="font-size: 15px;letter-spacing: 1px;"> </span></p> <p><span style="font-size: 15px;letter-spacing: 1px;"><strong>例如:</strong><strong></strong><strong>数据收集</strong><strong></strong></span></p> <p style="text-align: left;"><img class="rich_pages" data-copyright="0" data-ratio="0.4519650655021834" data-s="300,640" src="/upload/e05317e865f2f5c7e56032def5abf638.png" data-type="png" data-w="458" style=""></p> <p><span style="font-size: 15px;letter-spacing: 1px;">如果要对RPC接口处理时间进行收集,来实施统一监控与告警,也需要对RPC-client进行升级。</span></p> <p><span style="color: rgb(0, 82, 255);font-size: 15px;letter-spacing: 1px;"><em>画外音,处理时间分为:</em><em></em></span></p> <ul class=" list-paddingleft-2" style="list-style-type: disc;"> <li><p><span style="color: rgb(0, 82, 255);font-size: 15px;letter-spacing: 1px;"><em>客户端视角处理时间</em><em></em></span></p></li> <li><p><span style="color: rgb(0, 82, 255);font-size: 15px;letter-spacing: 1px;"><em>服务端视角处理时间</em><em></em></span></p></li> </ul> <p><span style="color: rgb(0, 82, 255);font-size: 15px;letter-spacing: 1px;"><em>如果要收集后者,RPC-server也要修改与上报。</em><em></em></span></p> <p><span style="font-size: 15px;letter-spacing: 1px;"> </span></p> <p><span style="font-size: 15px;letter-spacing: 1px;"><strong>又例如:</strong><strong></strong><strong>服务发现</strong><strong></strong></span></p> <p style="text-align: left;"><img class="rich_pages" data-copyright="0" data-ratio="0.5" data-s="300,640" src="/upload/3d40c7a082e8a9d0f2c2eaaa3e44aa98.png" data-type="png" data-w="398" style=""></p> <p><span style="font-size: 15px;letter-spacing: 1px;">服务新增一个实例,通知配置中心,配置中心通知已注册的RPC-client,将流量打到新启动的服务实例上去,迅猛完成扩容。</span></p> <p><span style="font-size: 15px;letter-spacing: 1px;"> </span></p> <p><span style="font-size: 15px;letter-spacing: 1px;"><strong>再例如:</strong><strong></strong><strong>调用链跟踪</strong><strong></strong></span></p> <p style="text-align: left;"><img class="rich_pages" data-copyright="0" data-ratio="0.44933920704845814" data-s="300,640" src="/upload/d257db61daa586db8289ed526f7c72a.png" data-type="png" data-w="454" style=""></p> <p><span style="font-size: 15px;letter-spacing: 1px;">如果要做全链路调用链跟踪,RPC-client和RPC-server都需要进行升级。</span></p> <p><span style="font-size: 15px;letter-spacing: 1px;"> </span></p> <p><span style="font-size: 15px;letter-spacing: 1px;">下面这些功能:</span></p> <ul class=" list-paddingleft-2" style="list-style-type: disc;"> <li><p><span style="font-size: 15px;letter-spacing: 1px;">负载均衡</span></p></li> <li><p><span style="font-size: 15px;letter-spacing: 1px;">数据收集</span></p></li> <li><p><span style="font-size: 15px;letter-spacing: 1px;">服务发现</span></p></li> <li><p><span style="font-size: 15px;letter-spacing: 1px;">调用链跟踪</span></p></li> <li><p><span style="font-size: 15px;letter-spacing: 1px;">…</span></p></li> </ul> <p><span style="font-size: 15px;letter-spacing: 1px;">其实都不是业务功能,所以<span style="font-size: 15px;letter-spacing: 1px;color: rgb(255, 76, 0);">互联网公司一般会有一个类似于“架构部”的技术部门去研发和升级相关功能</span>,而业务线的技术部门直接使用相关框架、工具与平台,享受各种“黑科技”带来的便利。</span></p> <p><span style="font-size: 15px;letter-spacing: 1px;"> </span></p> <p><span style="font-size: 18px;"><strong><span style="letter-spacing: 1px;">完美!!!</span></strong></span><strong><span style="font-size: 15px;letter-spacing: 1px;"></span></strong></p> <p><span style="font-size: 15px;letter-spacing: 1px;"> </span></p> <p><span style="font-size: 15px;letter-spacing: 1px;">理想很丰满,现实却很骨感,由于:</span></p> <ul class=" list-paddingleft-2" style="list-style-type: disc;"> <li><p><span style="font-size: 15px;letter-spacing: 1px;">RPC-client,它嵌在调用方进程里</span></p></li> <li><p><span style="font-size: 15px;letter-spacing: 1px;">RPC-server,是服务进程的基础</span></p></li> </ul> <p><span style="font-size: 15px;letter-spacing: 1px;"> </span></p> <p><span style="font-size: 15px;letter-spacing: 1px;">往往会面临以下一些问题:</span></p> <ul class=" list-paddingleft-2" style="list-style-type: disc;"> <li><p><span style="font-size: 15px;letter-spacing: 1px;">业务技术团队,仍需要花时间去学习、使用基础框架与各类工具,而不是全心全意将精力花在业务和产品上</span></p></li> <li><p><span style="font-size: 15px;letter-spacing: 1px;">client要维护m个版本, server要维护n个版本,兼容性要测试m*n个版本</span></p></li> <li><p><span style="font-size: 15px;letter-spacing: 1px;">如果要支持不同语言,往往要开发C-client,Python-client,go-client,Java-client多语言版本</span></p></li> <li><p><span style="font-size: 15px;letter-spacing: 1px;">每次“黑科技”的升级,都需要推动上下游进行升级,这个周期往往是以季度、半年、又甚至更久,整体效率极低</span></p></li> </ul> <p><span style="color: rgb(0, 82, 255);font-size: 15px;letter-spacing: 1px;"><em>画外音:</em><em></em><em>兄弟,贵司推广一个技术新产品,周期要多长?</em><em></em></span></p> <p><span style="font-size: 15px;letter-spacing: 1px;"> </span></p> <p><span style="font-size: 15px;letter-spacing: 1px;"><strong>这些耦合,这些通用的痛点,有没有办法解决呢?</strong><strong></strong></span></p> <p><span style="font-size: 15px;letter-spacing: 1px;">一个思路是,<span style="font-size: 15px;letter-spacing: 1px;color: rgb(255, 76, 0);">将服务拆分成两个进程</span>,解耦。</span></p> <p style="text-align: center;"><img class="rich_pages" data-copyright="0" data-ratio="0.2998204667863555" data-s="300,640" src="/upload/bc190a175e22e96b939a8f452e933879.png" data-type="png" data-w="557" style=""></p> <ul class=" list-paddingleft-2" style="list-style-type: disc;"> <li><p><span style="font-size: 15px;letter-spacing: 1px;">一个进程实现业务逻辑(不管是调用方,还是服务提供方),<strong>biz</strong>,即上图白色方块</span></p></li> <li><p><span style="font-size: 15px;letter-spacing: 1px;">一个进程实现底层技术体系,<strong>proxy</strong>,即上图蓝色方块</span></p></li> </ul> <p><span style="color: rgb(0, 82, 255);font-size: 15px;letter-spacing: 1px;"><em>画外音:</em><em></em><em>负载均衡、监控告警、服务发现与治理、调用链…等诸多基础设施,都放到这一层实现。</em><em></em></span></p> <ul class=" list-paddingleft-2" style="list-style-type: disc;"> <li><p><span style="font-size: 15px;letter-spacing: 1px;">biz和proxy共同诞生,共同消亡,互为<span style="font-size: 15px;letter-spacing: 1px;color: rgb(255, 76, 0);">本地部署</span>,即上图虚线方框</span></p></li> <li><p><span style="font-size: 15px;letter-spacing: 1px;">biz和proxy之间,为<span style="font-size: 15px;letter-spacing: 1px;color: rgb(255, 76, 0);">本地通讯</span>,即上图黑色箭头</span></p></li> <li><p><span style="font-size: 15px;letter-spacing: 1px;">所有biz之间的通讯,都通过proxy之间完成,proxy之间才存在<span style="font-size: 15px;letter-spacing: 1px;color: rgb(255, 76, 0);">远端连接</span>,即上图红色箭头</span></p></li> </ul> <p><span style="font-size: 15px;letter-spacing: 1px;"> </span></p> <p><span style="font-size: 15px;letter-spacing: 1px;">这样就实现了“<span style="font-size: 15px;letter-spacing: 1px;color: rgb(255, 76, 0);">业务的归业务,技术的归技术</span>”,实现了<span style="font-size: 15px;letter-spacing: 1px;color: rgb(255, 76, 0);">充分解耦</span>,如果所有节点都实现了解耦,整个架构会演变为:</span></p> <p style="text-align: left;"><img class="rich_pages" data-copyright="0" data-ratio="0.6431818181818182" data-s="300,640" src="/upload/e1a7cb9ff4a3cc894ffdf92e19f8e08f.jpg" data-type="jpeg" data-w="440" style=""></p> <ul class=" list-paddingleft-2" style="list-style-type: disc;"> <li><p><span style="font-size: 15px;letter-spacing: 1px;">绿色为biz</span></p></li> <li><p><span style="font-size: 15px;letter-spacing: 1px;">蓝色为proxy</span></p></li> </ul> <p><span style="font-size: 15px;letter-spacing: 1px;">整个服务集群变成了网格状,这就是Service Mesh服务网格的由来。</span></p> <p><span style="font-size: 15px;letter-spacing: 1px;"> </span></p> <p><span style="font-size: 15px;letter-spacing: 1px;">架构演进,永无穷尽,痛点多了,自然要分层解耦。希望大家有收获,后续再细聊SM的设计与架构细节。</span></p> <p><span style="font-size: 15px;letter-spacing: 1px;"> </span></p> <p><span style="font-size: 15px;letter-spacing: 1px;"><strong>思路</strong>比结论更重要。</span></p> <p><span style="font-size: 15px;letter-spacing: 1px;"><br></span></p> <p style="max-width: 100%;box-sizing: border-box;min-height: 1em;letter-spacing: 0.544px;white-space: normal;text-align: center;background-color: rgb(255, 255, 255);line-height: normal;word-wrap: break-word !important;"><span style="max-width: 100%;box-sizing: border-box;word-wrap: break-word;font-size: 15px;letter-spacing: 1px;"><strong style="max-width: 100%;box-sizing: border-box;word-wrap: break-word;"><img width="auto" data-ratio="1" data-type="jpeg" data-w="250" data-s="300,640" class="" src="/upload/7ddc9700032e2c5cee163f1f1a37b46c.jpg" style="max-width: 677px;box-sizing: border-box;word-wrap: break-word;visibility: visible !important;width: 130px !important;"></strong></span></p> <p style="max-width: 100%;box-sizing: border-box;min-height: 1em;letter-spacing: 0.544px;white-space: normal;text-align: center;background-color: rgb(255, 255, 255);line-height: normal;word-wrap: break-word !important;"><span style="letter-spacing: 1px;"><span style="max-width: 100%;box-sizing: border-box;word-wrap: break-word;letter-spacing: 1px;font-size: 12px;"><strong style="max-width: 100%;box-sizing: border-box;word-wrap: break-word;"><strong style="max-width: 100%;box-sizing: border-box;word-wrap: break-word;">架构师之路</strong>-分享技术思路</strong><strong style="max-width: 100%;box-sizing: border-box;word-wrap: break-word;"></strong></span><span style="max-width: 100%;box-sizing: border-box;word-wrap: break-word;letter-spacing: 1px;font-size: 15px;"><strong style="max-width: 100%;box-sizing: border-box;word-wrap: break-word;"></strong></span></span><br style="max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;"></p> <p style="max-width: 100%;box-sizing: border-box;min-height: 1em;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);text-align: left;word-wrap: break-word !important;"><span style="max-width: 100%;box-sizing: border-box;word-wrap: break-word;font-size: 15px;letter-spacing: 1px;">相关文章:</span></p> <p style="max-width: 100%;box-sizing: border-box;min-height: 1em;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);text-align: left;word-wrap: break-word !important;"><span style="max-width: 100%;box-sizing: border-box;word-wrap: break-word;color: rgb(0, 0, 0);font-size: 15px;letter-spacing: 1px;">《<a href="http://mp.weixin.qq.com/s?__biz=MjM5ODYxMDA5OQ==&mid=2651961720&idx=1&sn=94d1e2b253b715368e6424ec37cd3a1a&chksm=bd2d0ca48a5a85b21d9e7a7e54d69734d8d845ed085393246f2732f9154a145b8a71b6feecac&scene=21#wechat_redirect" target="_blank" data-itemshowtype="0" data-linktype="2">服务化到底解决什么问题?</a>》</span></p> <p style="max-width: 100%;box-sizing: border-box;min-height: 1em;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);text-align: left;word-wrap: break-word !important;"><span style="max-width: 100%;box-sizing: border-box;word-wrap: break-word;color: rgb(0, 0, 0);font-size: 15px;letter-spacing: 1px;">《<a href="http://mp.weixin.qq.com/s?__biz=MjM5ODYxMDA5OQ==&mid=2651960558&idx=1&sn=57189db18602b77bfcce1a258f66e329&chksm=bd2d01328a5a88245d4d91b90abf759c4a112562785c5641e7b8835097ab2e7bfce10efa1c32&scene=21#wechat_redirect" target="_blank" data-itemshowtype="0" data-linktype="2">互联网分层架构演进</a>》</span></p> <p style="max-width: 100%;box-sizing: border-box;min-height: 1em;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);text-align: left;word-wrap: break-word !important;"><span style="max-width: 100%;box-sizing: border-box;word-wrap: break-word;color: rgb(0, 0, 0);font-size: 15px;letter-spacing: 1px;">《<a href="http://mp.weixin.qq.com/s?__biz=MjM5ODYxMDA5OQ==&mid=2651961985&idx=1&sn=6f757843f5c159eab00d847e9c2cc995&chksm=bd2d0f5d8a5a864b05fada6919204378134e174f1105a0716dd879845b0d365c913ef8e94a12&scene=21#wechat_redirect" target="_blank" data-itemshowtype="0" data-linktype="2">离不开的微服务架构,脱不开的RPC细节</a>》</span></p> <p style="max-width: 100%;box-sizing: border-box;min-height: 1em;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);text-align: left;word-wrap: break-word !important;"><span style="max-width: 100%;box-sizing: border-box;word-wrap: break-word;color: rgb(0, 0, 0);font-size: 15px;letter-spacing: 1px;">《<a href="http://mp.weixin.qq.com/s?__biz=MjM5ODYxMDA5OQ==&mid=2651960726&idx=1&sn=0fdaf0e7040318aabfeba553f815d691&chksm=bd2d004a8a5a895ca80180443cc0f18e66b3d15dbbbd120dabaf3e6d4ef00fbc1030bf41c24b&scene=21#wechat_redirect" target="_blank" data-itemshowtype="0" data-linktype="2">MQ,互联网架构解耦神器</a>》</span></p> <p style="max-width: 100%;box-sizing: border-box;min-height: 1em;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);text-align: left;word-wrap: break-word !important;"><span style="max-width: 100%;box-sizing: border-box;word-wrap: break-word;color: rgb(0, 0, 0);font-size: 15px;letter-spacing: 1px;"><br></span></p> <p style="max-width: 100%;box-sizing: border-box;min-height: 1em;white-space: normal;background-color: rgb(255, 255, 255);text-align: left;word-wrap: break-word !important;"><span style="font-size: 15px;letter-spacing: 1px;"><strong><span style="color: rgb(0, 0, 0);font-size: 15px;letter-spacing: 1px;">调研</span></strong><span style="color: rgb(0, 0, 0);font-size: 15px;letter-spacing: 1px;">:</span></span><span style="color: rgb(0, 0, 0);font-size: 15px;letter-spacing: 1px;"></span></p> <p style="max-width: 100%;box-sizing: border-box;min-height: 1em;white-space: normal;background-color: rgb(255, 255, 255);text-align: left;word-wrap: break-word !important;"><span style="font-size: 15px;color: rgb(0, 0, 0);letter-spacing: 1px;">贵司推广一个“底层技术”,周期大概多长,业务侧要配合升级么?<span style="color: rgb(0, 0, 0);font-size: 14px;letter-spacing: 1px;"></span></span></p>
作者:微信小助手
<p style="white-space: normal;max-width: 100%;min-height: 1em;color: rgb(51, 51, 51);font-family: -apple-system-font, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;font-size: 17px;letter-spacing: 0.544px;background-color: rgb(255, 255, 255);text-align: center;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="max-width: 100%;white-space: pre-wrap;font-size: 14px;color: rgb(255, 41, 65);line-height: 22.4px;box-sizing: border-box !important;overflow-wrap: break-word !important;">(点击</span><span style="max-width: 100%;white-space: pre-wrap;font-size: 14px;line-height: 22.4px;color: rgb(0, 128, 255);box-sizing: border-box !important;overflow-wrap: break-word !important;">上方公众号</span><span style="max-width: 100%;white-space: pre-wrap;font-size: 14px;color: rgb(255, 41, 65);line-height: 22.4px;box-sizing: border-box !important;overflow-wrap: break-word !important;">,可快速关注)</span></p> <p style="white-space: normal;max-width: 100%;min-height: 1em;color: rgb(51, 51, 51);font-family: -apple-system-font, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;font-size: 17px;letter-spacing: 0.544px;text-align: justify;background-color: rgb(255, 255, 255);box-sizing: border-box !important;overflow-wrap: break-word !important;"><br style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"></p> <blockquote style="white-space: normal;max-width: 100%;color: rgb(51, 51, 51);font-family: -apple-system-font, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;font-size: 17px;letter-spacing: 0.544px;text-align: justify;background-color: rgb(255, 255, 255);box-sizing: border-box !important;overflow-wrap: break-word !important;"> <p style="max-width: 100%;min-height: 1em;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="max-width: 100%;font-size: 14px;box-sizing: border-box !important;overflow-wrap: break-word !important;">转自:开源中国社区</span></p> </blockquote> <p><br style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"></p> <p><span style="font-size: 15px;">微软为推广自家 Edge 所做的努力,大家有目共睹。近日,微软又被发现使用了新的方法来挽留用户。</span><span style="font-size: 15px;">据外媒 ghacks.net 报道</span><span style="font-size: 15px;">,Windows 10 最新内部测试版系统会“拦截”Chrome 和 Firefox 的安装,提醒用户已经安装了更安全、更快速的 Edge。当然如果用户坚持的话,还是可以继续安装。</span></p> <p><span style="font-size: 15px;"><br></span></p> <p style="text-align: center;"><img class="" data-ratio="0.8730407523510971" src="/upload/4cdfdcfd9c85d00ba820e28423cb6986.jpg" data-type="jpeg" data-w="638" style="box-sizing: inherit;border-style: none;margin: auto;max-width: 80%;"><br style="box-sizing: inherit;"></p> <p style="text-align: center;"><br></p> <p><span style="font-size: 15px;text-decoration: none;">科技媒体 Techcrunch 了解后亦亲自验证了这一情况</span><span style="font-size: 15px;">,他们和资深 Windows 系统爱好人士进行了后续的测试,发现在将系统版本号升级到“内部预览版 17758.1 (rs5_release)”后,用户只要使用 Edge 浏览器下载如 Firefox 或者 Chrome 浏览器,均会在安装时收到如下图所示的“拦截”提示。</span></p> <p><span style="font-size: 15px;"><br></span></p> <p style="text-align: center;"><img class="" data-ratio="0.7724609375" src="/upload/bd423d25ef1045d0da70b33b8490bda7.png" data-type="png" data-w="1024" style="box-sizing: inherit;border-style: none;margin: auto;max-width: 80%;"><br style="box-sizing: inherit;"></p> <p><span style="font-size: 15px;"><br></span></p> <p><span style="font-size: 15px;">而在用户点击被突出强调的“打开 Microsoft Edge”按钮后,下载网页将会跳转到“Edge 的自我展示”页面。不难发现,Edge 似乎想要通过这种略带委婉的劝说打消用户放弃 Edge 浏览器的念头。<br style="box-sizing: inherit;"></span></p> <p><span style="font-size: 15px;"><br></span></p> <p style="text-align: center;"><img class="" data-ratio="0.5419921875" src="/upload/fd635f054047f983fbe58dc83b98fc20.png" data-type="png" data-w="1024" style="box-sizing: inherit;border-style: none;margin: auto;max-width: 80%;"><br style="box-sizing: inherit;"></p> <p><span style="font-size: 15px;"><br></span></p> <p><span style="font-size: 15px;">当然,用户可以在浏览器的设置界面总的“应用和功能”一栏中,将“应用安装”设置为“关闭应用建议”来关掉该提示。</span></p> <p><span style="font-size: 15px;"><br></span></p> <p><span style="font-size: 15px;">目前我们尚不清楚微软是否会在后续发行的公开版本中继续默认开启这一提示功能,但从 Edge 的前身 —— IE 的捆绑安装起家史以及 Win 10 所采取的系统更新策略来看,微软很可能会坚持这种影响用户体验的行为,从而实现推广 Edge 的目的。</span></p> <p><span style="font-size: 15px;"><br></span></p> <p><span style="font-size: 15px;">据 StatCounter 在今年 6 月份发表的全球桌面浏览器数据报告</span><span style="font-size: 15px;">显示</span><span style="font-size: 15px;"> ,截止至 2018 年 5 月份,Chrome 和 Firefox 共占据了总市场 78.48%的份额,二者分别为 66.93%和 11.55%。而 IE 和 Edge 则只占据了 11.12%的比例,其中 IE 为 6.97%,Edge4.15%。而根据 NET MARKETSHARE 的全球桌面操作系统相关数据</span><span style="font-size: 15px;">显示</span><span style="font-size: 15px;"> ,同期(截止至 18 年 5 月份),Windows 和 Chrome OS 系统的全球占有率分别为 88.33%和 0.31%。</span></p> <p><span style="font-size: 15px;"><br></span></p> <p><span style="font-size: 15px;">早前,微软曾靠“</span><span style="font-size: 15px;">wintel</span><span style="font-size: 15px;">”组合为其打下了大片江山,然而在浏览器领域却没能守住相应的地位。这种引导用户放弃其它浏览器的行为会再度遭到欧盟的“</span><span style="font-size: 15px;">不正当商业竞争</span><span style="font-size: 15px;">”的起诉么?或许,是时候让我们去告诉微软我们自己的答案了。</span></p> <p><br></p> <p style="text-align: center;"><img class="" data-ratio="1.0975056689342404" src="/upload/90e48f581cce3355129d1ea997e98849.jpg" data-type="jpeg" data-w="441"></p> <p><br></p> <p><br></p>
作者:じ☆ve宝贝
> 闲来无聊,昨晚看到一可爱的小妹妹,想下载无水印版本做屏保,作为程序猿小(bu)哥(yao)哥(lian)自然不满意,动手解析了一波无水印高清视频 ## pom.xml ``` <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.5.2</version> </dependency> ``` ## HttpClientUtil ``` package cn.studyjava.douyin.util; import java.io.IOException; import java.net.URI; import java.util.Map; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.utils.URIBuilder; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; public class HttpClientUtil { public static String doGet(String url, Map<String, String> param) { // 创建Httpclient对象 CloseableHttpClient httpclient = HttpClients.createDefault(); String resultString = ""; CloseableHttpResponse response = null; try { // 创建uri URIBuilder builder = new URIBuilder(url); if (param != null) { for (String key : param.keySet()) { builder.addParameter(key, param.get(key)); } } URI uri = builder.build(); // 创建http GET请求 HttpGet httpGet = new HttpGet(uri); // 設置httpGet的头部參數信息 此处必不可少,伪装成浏览器访问 httpGet.setHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"); httpGet.setHeader("Accept-Charset", "GB2312,utf-8;q=0.7,*;q=0.7"); httpGet.setHeader("Accept-Encoding", "gzip, deflate, sdch, br"); httpGet.setHeader("Accept-Language", "zh-cn,zh;q=0.8"); httpGet.setHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36"); // 执行请求 response = httpclient.execute(httpGet); // 判断返回状态是否为200 if (response.getStatusLine().getStatusCode() == 200) { resultString = EntityUtils.toString(response.getEntity(), "UTF-8"); } } catch (Exception e) { e.printStackTrace(); } finally { try { if (response != null) { response.close(); } httpclient.close(); } catch (IOException e) { e.printStackTrace(); } } return resultString; } public static String doGet(String url) { return doGet(url, null); } } ``` ## 解析url ``` package cn.studyjava.douyin; import cn.studyjava.douyin.util.HttpClientUtil; /** * Hello world! * */ public class App { private static final String BASE_URL = "https://aweme.snssdk.com/aweme/v1/play/?video_id=%s"; public static void main(String[] args) { String shareUrl = "https://www.iesdouyin.com/share/video/6557991042631601422/?region=CN&mid=6557991125620099853&titleType=title×tamp=1526913323&utm_campaign=client_share&app=aweme&utm_medium=ios&iid=29367218325&utm_source=copy"; String douyin = douyin(shareUrl); System.out.println(douyin); } private static String douyin(String url){ try { String html = HttpClientUtil.doGet(url); int len = html.indexOf("video_id"); String end = html.substring(len); int indexOf = end.indexOf("\","); String videoId = end.substring(9, indexOf); videoId = videoId.replace("\\u0026", "&"); return String.format(BASE_URL, videoId); } catch (Exception e) { e.printStackTrace(); return null; } } } ``` **大功告成了,这样就能下载 高清无码的美女视频了。**
作者:じ☆ve宝贝
 安装全后,在chrome应用列表中可以看到。(在chrome中新建页面-》左上角应用)
作者:じ☆ve宝贝
> 数据库明明已经设置了utf8mb4编码为什么不生效,今天记录一下。 ## 1、表原来是utf-8修改成utf8mb4的  **修改表全局是不生效的,需要修改到字段级别**  ## 2、程序链接的时候提示 Incorrect string value: ''\xF0\x9F\x91\x80\xE5\xBC...'' for column ''third_name'' at row 1  **将红框中的字符串删除掉即可**
作者:不要哭啦
