首页 文章 精选 留言 我的

精选列表

搜索[去水印],共10002篇文章
优秀的个人博客,低调大师

android edittext 去边框 去下划线

EditText的background属性设置为@null就搞定了: android :background="@null" style属性倒是可加可不加 附原文: @SlumberMachine, that's a great observation! But, it seems that there is more to making a TextView editable than just setting android :editable="true". It has to do with the "input method" - what ever that is - and that is where the real difference between TextView and EditText lies. TextView was designed with an EditText in mind, that's for sure. One would have to look at the EditText source code and probably EditText style to see what's really going on there. Documentation is simply not enough. I have asked the same question back at android -developers group, and got a satisfactory answer. This is what you have to do: XML: <EditText android :id="@+id/title" android :layout_width="fill_parent" style="? android :attr/textViewStyle" android :background="@null" android :textColor="@null"/> Instead of style="? android :attr/textViewStyle" you can also write style=" @android :style/Widget.TextView", don't ask me why and what it means. 本文转自94cool博客园博客,原文链接:http://www.cnblogs.com/94cool/p/5407704.html,如需转载请自行联系原作者

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

4.2 ZK去哪了?

Codis完全依赖ZooKeeper,进入到Redis Cluster后,ZooKeeper哪里去了?我们先回忆一下ZooKeeper在其中的角色,详情请参见《豆瓣Redis解决方案Codis源码剖析:Dashboard》: 保存Slot和Group映射 将Slot和Group的变化通知Proxy 迁移时与Proxy进行Pre-migrate确认 保存Migrate任务和进度信息 因为Redis Cluster的P2P架构,Slot与结点的映射关系都打散到集群中的各个结点上,所以第一个问题就解决了。又因为当客户端去旧结点请求数据时会收到MOVED或ASK消息进行重定向,就像是LAZY缓存过期策略一样,等访问时再更新或清除,所以第二和第三个问题也解决了。唯一要重点考虑的就是迁移任务这种Redis Cluster并不负责的全局信息的保存。 本文作者:geelou 本文来自云栖社区合作伙伴rediscn,了解相关信息可以关注redis.cn网站。

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

MapReduce实现数据去重

一、原理分析 Mapreduce的处理过程,由于Mapreduce会在Map~reduce中,将重复的Key合并在一起,所以Mapreduce很容易就去除重复的行。Map无须做任何处理,设置Map中写入context的东西为不作任何处理的行,也就是Map中最初处理的value即可,而Reduce同样无须做任何处理,写入输出文件的东西就是,最初得到的Key。 我原来以为是map阶段用了hashmap,根据hash值的唯一性。估计应该不是... Map是输入文件有几行,就运行几次。 二、代码 2.1 Mapper package algorithm; import java.io.IOException; import org.apache.hadoop.io.LongWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.Mapper; public class DuplicateRemoveMapper extends Mapper<LongWritable, Text, Text, Text> { //输入文件是数字 不过可能也有字符等 所以用Text,不用LongWritable public void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException { context.write(value, new Text());//后面不能是null,否则,空指针 } } 2.2 Reducer package algorithm; import java.io.IOException; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.Reducer; public class DuplicateRemoveReducer extends Reducer<Text, Text, Text, Text> { public void reduce(Text key, Iterable<Text> value, Context context) throws IOException, InterruptedException { // process values context.write(key, null); //可以出处null } } 2.3 Main package algorithm; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.IntWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; public class DuplicateMainMR { public static void main(String[] args) throws Exception{ // TODO Auto-generated method stub Configuration conf = new Configuration(); Job job = new Job(conf,"DuplicateRemove"); job.setJarByClass(DuplicateMainMR.class); job.setMapperClass(DuplicateRemoveMapper.class); job.setReducerClass(DuplicateRemoveReducer.class); job.setOutputKeyClass(Text.class); //输出是null,不过不能随意写 否则包类型不匹配 job.setOutputValueClass(Text.class); job.setNumReduceTasks(1); //hdfs上写错了文件名 DupblicateRemove 多了个b //hdfs不支持修改操作 FileInputFormat.addInputPath(job, new Path("hdfs://192.168.58.180:8020/ClassicalTest/DupblicateRemove/DuplicateRemove.txt")); FileOutputFormat.setOutputPath(job, new Path("hdfs://192.168.58.180:8020/ClassicalTest/DuplicateRemove/DuplicateRemoveOut")); System.exit(job.waitForCompletion(true) ? 0 : 1); } } 三、输出分析 3.1 输入与输出 没啥要对比的....不贴了 3.2 控制台 doop.mapreduce.Job.updateStatus(Job.java:323) INFO - Job job_local4032991_0001 completed successfully DEBUG - PrivilegedAction as:hxsyl (auth:SIMPLE) from:org.apache.hadoop.mapreduce.Job.getCounters(Job.java:765) INFO - Counters: 38 File System Counters FILE: Number of bytes read=560 FILE: Number of bytes written=501592 FILE: Number of read operations=0 FILE: Number of large read operations=0 FILE: Number of write operations=0 HDFS: Number of bytes read=48 HDFS: Number of bytes written=14 HDFS: Number of read operations=13 HDFS: Number of large read operations=0 HDFS: Number of write operations=4 Map-Reduce Framework Map input records=8 Map output records=8 Map output bytes=26 Map output materialized bytes=48 Input split bytes=142 Combine input records=0 Combine output records=0 Reduce input groups=6 Reduce shuffle bytes=48 Reduce input records=8 Reduce output records=6 Spilled Records=16 Shuffled Maps =1 Failed Shuffles=0 Merged Map outputs=1 GC time elapsed (ms)=4 CPU time spent (ms)=0 Physical memory (bytes) snapshot=0 Virtual memory (bytes) snapshot=0 Total committed heap usage (bytes)=457179136 Shuffle Errors BAD_ID=0 CONNECTION=0 IO_ERROR=0 WRONG_LENGTH=0 WRONG_MAP=0 WRONG_REDUCE=0 File Input Format Counters Bytes Read=24 File Output Format Counters Bytes Written=14 DEBUG - PrivilegedAction as:hxsyl (auth:SIMPLE) from:org.apache.hadoop.mapreduce.Job.updateStatus(Job.java:323) DEBUG - stopping client from cache: org.apache.hadoop.ipc.Client@37afeb11 DEBUG - removing client from cache: org.apache.hadoop.ipc.Client@37afeb11 DEBUG - stopping actual client because no more references remain: org.apache.hadoop.ipc.Client@37afeb11 DEBUG - Stopping client DEBUG - IPC Client (521081105) connection to /192.168.58.180:8020 from hxsyl: closed DEBUG - IPC Client (521081105) connection to /192.168.58.180:8020 from hxsyl: stopped, remaining connections 0

资源下载

更多资源
Mario

Mario

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

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

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部分的功能。

用户登录
用户注册