首页 文章 精选 留言 我的

精选列表

搜索[设置],共10000篇文章
优秀的个人博客,低调大师

怎样设置“预付费资源到期提醒”消息接收人?

经常有客户反馈自己的MaxCompute预付费资源组欠费了,Project不能访问了,但自己却没有接收到通知,因为资源组的owner是财务同学或者是运维同学,他们并不关注MaxCompute服务,因此忽略了。 其实您可以将MaxCompute大数据管理员加入到“产品欠费、停服、即将释放”的消息接收联系人中,之后需要及时关注您的短信、邮件或者站内信,就可以接收到MaxCompute的到期提醒、欠费等通知消息。 1、进入数据控制台,点击右上角小铃铛图标,在下拉菜单中选择“消息接收管理”,点击进入 2、在“基本接收管理”项目中,选择“产品欠费、停服、即将释放相关信息通知”,点击“修改”账号联系人 3、点击“新增消息接收人”,填写姓名、邮箱、手机号码等联系方式即可。 访问MaxCompute官网 https://www.aliyun.com/pro

优秀的个人博客,低调大师

环境搭建-CentOS服务器之间设置免密码登录

在做大数据项目分布式开发时会用到Hadoop组件,Hadoop集群由Namenode节点和Datanode节点组成,在运行启动集群操作时,需要从Namenode节点登录到Datanode节点,执行相关启动脚本,因此需要配置免密码登录。 1.使用root账户修改shhd_config配置文件 执行命令【vi /etc/ssh/sshd_config】 修改shhd_config配置文件.png 去掉RSAAuthention yes前面的# 去掉PubkeyAuthentication yes前面的# shhd_config.png 然后运行命令【service sshd restart】生效配置 2.使用rsa非对称加密生成密钥 进入用户目录,运行命令【ssh-keygen -t rsa】生成密钥 生成密钥.png 进入【.ssh】目录,会发现生成了如下几个文件: ssh目录.png authorized_keys:存放远程免密登录的公钥,主要通过这个文件记录多台机器的公钥 id_rsa:私钥文件 id_rsa.pub:公钥文件 3.将公钥添加到需要远程登录机器的authorized_keys文件中 在添加之前先做一个测试,现在通过【ssh localhost】命令试试本机有没有免密码登录 测试.png 出现需要输入密码界面,证明还没有免密,需要将公钥添加到authorized_keys中,运行文件追加命令【cat id_rsa.pub >> authorized_keys】。 再通过【ssh localhost】命令试试本机有没有免密码登录: image.png 测试通过,现在就可以将公钥添加到需要远程登录机器的authorized_keys文件中,然后就实现了Namenode节点到Datanode节点的免密码登录。

优秀的个人博客,低调大师

java加密工具类,可设置对应的加解密key

public class AesEncryptUtil { //使用AES-128-CBC加密模式,key需要为16位,key和iv可以相同! private static String KEY ="whshenke20180606"; private static String IV ="whshenke20180606"; /** * 加密方法 * @param data 要加密的数据 * @param key 加密key * @param iv 加密iv * @return 加密的结果 * @throws Exception */ public static String encrypt(String data, String key, String iv) throws Exception { try { Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding");//"算法/模式/补码方式" int blockSize = cipher.getBlockSize(); byte[] dataBytes = data.getBytes(); int plaintextLength = dataBytes.length; if (plaintextLength % blockSize != 0) { plaintextLength = plaintextLength + (blockSize - (plaintextLength % blockSize)); } byte[] plaintext = new byte[plaintextLength]; System.arraycopy(dataBytes, 0, plaintext, 0, dataBytes.length); SecretKeySpec keyspec = new SecretKeySpec(key.getBytes("UTF-8"), "AES"); IvParameterSpec ivspec = new IvParameterSpec(iv.getBytes()); cipher.init(Cipher.ENCRYPT_MODE, keyspec, ivspec); byte[] encrypted = cipher.doFinal(plaintext); return Base64Util.encode(encrypted); } catch (Exception e) { e.printStackTrace(); return null; } } /** * 解密方法 * @param data 要解密的数据 * @param key 解密key * @param iv 解密iv * @return 解密的结果 * @throws Exception whshenke20180606 */ public static String desEncrypt(String data, String key, String iv) { try { byte[] encrypted1 = Base64Util.decode(data); Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding"); SecretKeySpec keyspec = new SecretKeySpec(key.getBytes(), "AES"); IvParameterSpec ivspec = new IvParameterSpec(iv.getBytes()); cipher.init(Cipher.DECRYPT_MODE, keyspec, ivspec); byte[] original = cipher.doFinal(encrypted1); String originalString = new String(original, "UTF-8"); return originalString; } catch (Exception e) { //e.printStackTrace(); return null; } } /** * 使用默认的key和iv加密 * @param data * @return * @throws Exception */ public static String encrypt(String data) throws Exception { return encrypt(data, KEY, IV); } /** * 使用默认的key和iv解密 * @param data * @return * @throws Exception */ public static String desEncrypt(String data){ return desEncrypt(data, KEY, IV); } /** * 测试 */ public static void main(String args[]) throws Exception { //KNnAbiCvFxispeG+wS01jA== //KNnAbiCvFxispeG+wS01jA== //KNnAbiCvFxispeG+wS01jA== String test = "测试"; String data = null; String key = "dufy20170329java"; String iv = "dufy20170329java"; // data = encrypt(test, key, iv); //KNnAbiCvFxispeG+wS01jA== System.out.println(data); System.out.println(desEncrypt("8XguKV2aprVwg4UqEie7f9gkr7xDaSKrGZZD7x1J3uISWkvQAtpq8hpkskwi V+8bJmRcmQWIZ4sRom37GB7w7O4AH+HjH5ixViJ7k6bx+oEFVWSmIqKEj4e5 lMcyXgcXpTB8IGnt1WKS2p7Qnn+cjA==", key, iv)); } }

优秀的个人博客,低调大师

图片设置level-list,根据不同状态显示不同图片

前言:工作需求,wifi图标根据不同的强度,显示不同的状态.于是想到用图层的方法 bg.xml <?xml version="1.0" encoding="utf-8"?> <level-list xmlns:android="http://schemas.android.com/apk/res/android" > <item android:maxLevel="0" android:drawable="@drawable/icon_stop_n"></item> <item android:maxLevel="1" android:drawable="@drawable/icon_pause"></item> </level-list> note:android:maxLevel 必须从0递增,顺序错误后只会显示第一张图片 布局文件 <Button android:id="@+id/bt_pause_bt" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="115px" android:background="@drawable/bg" android:tag="play" /> 代码中使用 LevelListDrawable pauseDrawable = (LevelListDrawable) yourwiget .getBackground(); pauseDrawable.setLevel(1);//根据业务需要,对应图片等级

优秀的个人博客,低调大师

设置Centos7使用阿里云镜像的yum源

1. 备份原来的yum源 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 2.下载阿里云的CentOS-Base.repo 到/etc/yum.repos.d/ wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 或者 curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 执行结果如下图: 3. 清理缓存 sudo yum clean all 执行结果: 4. 生成新的缓存 sudo yum makecache 执行结果:

优秀的个人博客,低调大师

ES BM25 TF-IDF相似度算法设置——

Pluggable Similarity Algorithms Before we move on from relevance and scoring, we will finish this chapter with a more advanced subject: pluggable similarity algorithms.While Elasticsearch uses theLucene’s Practical Scoring Functionas its default similarity algorithm, it supports other algorithms out of the box, which are listed in theSimilarity Modulesdocumentation. Okapi BM25 The most interesting competitor to TF/IDF and the vector space model is calledOkapi BM25, which is considered to be astate-of-the-artranking function.BM25 originates from theprobabilistic relevance model, rather than the vector space model, yetthe algorithm has a lot in common with Lucene’s practical scoring function. Both use term frequency, inverse document frequency, and field-length normalization, but the definition of each of these factors is a little different. Rather than explaining the BM25 formula in detail, we will focus on the practical advantages that BM25 offers. Term-frequency saturation Both TF/IDF and BM25 useinverse document frequencyto distinguish between common (low value) words and uncommon (high value) words.Both also recognize (seeTerm frequency) that the more often a word appears in a document, the more likely is it that the document is relevant for that word. However, common words occur commonly.The fact that a common word appears many times in one document is offset by the fact that the word appears many times inalldocuments. However, TF/IDF was designed in an era when it was standard practice to remove themostcommon words (orstopwords, seeStopwords: Performance Versus Precision) from the index altogether.The algorithm didn’t need to worry about an upper limit for term frequency because the most frequent terms had already been removed. In Elasticsearch, thestandardanalyzer—the default forstringfields—doesn’t remove stopwordsbecause, even though they are words of little value, they do still have some value. The result is that, for very long documents, the sheer number of occurrences of words liketheandandcan artificially boost their weight. BM25, on the other hand, does have an upper limit. Terms that appear 5 to 10 times in a document have a significantly larger impact on relevance than terms that appear just once or twice. However, as can be seen inFigure34, “Term frequency saturation for TF/IDF and BM25”, terms that appear 20 times in a document have almost the same impact as terms that appear a thousand times or more. This is known asnonlinear term-frequency saturation. Figure34.Term frequency saturation for TF/IDF and BM25 Field-length normalization InField-length norm, we said that Lucene considers shorter fields to have more weight than longer fields: the frequency of a term in a field is offset by the length of the field. However, the practical scoring function treats all fields in the same way.It will treat alltitlefields (because they are short) as more important than allbodyfields (because they are long). BM25 also considers shorter fields to have more weight than longer fields, but it considers each field separately by taking the average length of the field into account. It can distinguish between a shorttitlefield and alongtitle field. InQuery-Time Boosting, we said that thetitlefield has anaturalboost over thebodyfield because of its length. This natural boost disappears with BM25 as differences in field length apply only within a single field. 摘自:https://www.elastic.co/guide/en/elasticsearch/guide/current/pluggable-similarites.html 本文转自张昺华-sky博客园博客,原文链接:http://www.cnblogs.com/bonelee/p/6472820.html ,如需转载请自行联系原作者

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册