首页 文章 精选 留言 我的

精选列表

搜索[小微模型],共10000篇文章
优秀的个人博客,低调大师

android DDMS 调试初级及小技巧

1,认识日志信息 PS:除了在开发阶段,VERBOSE从不被编译到一个应用程序中,调试日志被编译但在运行时会跳过,Error, warning 和 info 日志总是 存在。 2,自定义logcat 1,调试通用技巧之sysout 你可以使用sysout这个方法,在方法中测试是否正常运行 2,使用android自带的Log方法 Log类使用方法 在类中定义一个标签: private static final String TAG = "MyActivity"; 然后可以调用Log类的静态方法: Log.代号(标签,信息) 例如:Log.v(TAG, "信息" ); 然后把这个类,放到任何可能出错的地方调试就好了 补充DDMS常见错误及解决 #1:DDMS与模拟器断开怎么办? 可以在Devices 下选择reset adb 本文转自 liam2199 博客,原文链接: http://blog.51cto.com/youxilua/772999如需转载请自行联系原作者

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

Linux 小知识翻译 - 「架构 续」(arch)

上次,从「计算机的内部构造」的角度解释了架构这个术语。这次,介绍下架构中经常提到的「i386架构」及之后的「i486」,「i586」。 安装Linux的时候,很多人即使不了解但也会经常听到i386架构这个词。因此,会误认为「自己的PC的架构是i386架构的」。现在用i386的人是非常少的。 i386的 i 就是「Intel」的首字母。i386是1985年发布的架构,那么如今还在用i386电脑的人... ...将近20年没有换过电脑了。(这篇文章应该是作者2005年左右写的) 实际上i386的CPU正式名称是「80386」。80386之前是8086和80286,之后还有80486。80386其实就是「80x86」系列CPU中的一种。 这个「80x86」系列,作为「个人电脑」被世界上很多PC所采用。 注:8086之后也有 80186,只不过在PC上用的不多,所以不是那么普遍。 i386是「80x86系列」中第一个32位的CPU。而且,Linux也是在i386上诞生的。 之后,x86系列再次升级,出现了 80486,再之后... ... 实际上官方是不存在 80586 这种型号的CPU的。由于商标的问题,80486之后是「Pentium」(也就是曾经流行的奔腾机),再之后是「Pentium Pro/Pentium II/Pentium III」。 但是,当时比较流行称呼 80x86,所以Pentium被称为「i586」,「Pentium Pro/Pentium II/Pentium III」被称为「i686」。 后来基于Pentium III的Xeon也被包含在i686里面了。之后再发布的各种架构,关于谁是「i786」?有很多争论。(大部分情况下认为Pentium 4是「i786」) 其实,i786和i886这种名称之后几乎没有人使用了。 这里提到的架构都是继承于i386的,「面向i386的OS和应用程序」都能在这些架构上运行。 IA-64之类64位的架构上,面向i386的应用程序有很多是无法运行的,所以把架构「暂且都当成i386」来看的话有点危险, 不过,在面向普通用户的PC上,可以认为面向「i386」的应用程序都能运行。 本文转自wang_yb博客园博客,原文链接:http://www.cnblogs.com/wang_yb/p/3798162.html,如需转载请自行联系原作者

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

Linux 小知识翻译 - 「X Window系统」

X Window System是给Unix系的OS提供的一套窗口管理软件或者说是组件。X Window System已经成为了在Linux上使用GUI环境的不可或缺的东西了。 X Window System诞生于马萨诸塞州(美国州名)工科大学的研究组,现在主要由X.Org Foundation这个组织来负责开发。目前的版本是「X11」(version 11)。 上面所说的内容可能很多人都知道,但 X Window System 的架构「采用了服务端·客户端模式」这点就不那么广为人知了。正因此点,通过网络来使用X Window System称为可能。 比如,在一台电脑上运行的应用程序,可以通过网络在另一台电脑上远程显示它的画面。 请注意,接下来的内容可能容易混淆。对于 X Window System,用户所使用的电脑上运行的是「X服务器」,通过它再和其它各式各样的「客户端」通信。 也就是说,和大多数的服务端·客户端架构的系统是相反的,「用户操作的是服务端,远程运行的是客户端」。 为什么会这样呢?这是因为 X Window System 的功能是由服务端提供的,而且用户也需要操作这些功能。 对于 X Window System,看着似乎懂了,其实还有很多不懂的。其内容出乎意料的深奥。 本文转自wang_yb博客园博客,原文链接:http://www.cnblogs.com/wang_yb/p/3799235.html,如需转载请自行联系原作者

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

【iOS 开发】延迟执行方法小总结

当需要实现类似“轮询”这种操作的时候,我们可能会希望有一个“被放缓了的” for 循环 —— 即当某次操作执行后,稍等一下再去执行下一次操作。这时有几种方法可以供我们使用,来实现这种效果,下面对比总结一下。 perform(_ aSelector: Selector, with anArgument: Any?, afterDelay delay: TimeInterval) extension NSObject { open func perform(_ aSelector: Selector, with anArgument: Any?, afterDelay delay: TimeInterval, inModes modes: [RunLoopMode]) open func perform(_ aSelector: Selector, with anArgument: Any?, afterDelay delay: TimeInterval) open class func cancelPreviousPerformRequests(withTarget aTarget: Any, selector aSelector: Selector, object anArgument: Any?) open class func cancelPreviousPerformRequests(withTarget aTarget: Any) } extension RunLoop { open func perform(_ aSelector: Selector, target: Any, argument arg: Any?, order: Int, modes: [RunLoopMode]) open func cancelPerform(_ aSelector: Selector, target: Any, argument arg: Any?) open func cancelPerformSelectors(withTarget target: Any) } 这是系统提供的 API,其中最简单的第 2 个方法可以通过指定方法、参数、延迟时间来实现延迟调用。 优点:使用简单、自带根据 target 取消调用的机制 并且可以指定对象、方法来取消延迟调用 使得这个方法可以完成一些复杂的延迟调用机制缺点:系统帮你自动完成了很多操作,使得它不像定时器(NSTimer)那样高度可控。 scheduledTimer(timeInterval ti: TimeInterval, target aTarget: Any, selector aSelector: Selector, userInfo: Any?, repeats yesOrNo: Bool) -> Timer open class Timer : NSObject { public /*not inherited*/ init(timeInterval ti: TimeInterval, invocation: NSInvocation, repeats yesOrNo: Bool) open class func scheduledTimer(timeInterval ti: TimeInterval, invocation: NSInvocation, repeats yesOrNo: Bool) -> Timer public /*not inherited*/ init(timeInterval ti: TimeInterval, target aTarget: Any, selector aSelector: Selector, userInfo: Any?, repeats yesOrNo: Bool) open class func scheduledTimer(timeInterval ti: TimeInterval, target aTarget: Any, selector aSelector: Selector, userInfo: Any?, repeats yesOrNo: Bool) -> Timer } 通过常见的定时器也可以实现延迟调用,把 repeats 参数置为 false,可以实现类似上面的 perform 的效果。 优点:定时器状态可控,可以重新赋值,可以查看是否 valid 等缺点:对比上面的 perform 方法可以直接传参,这里想要传参的话只能曲线救国: 把参数放在 timer 的 userInfo 里面,再把 timer 本身当成参数传递(这里使得代码可读性稍稍变差,但是好在 userInfo 里面什么都能放,这使得我们可以同时传递多个参数了) 如果你的代码可以不兼容 iOS 10 以下的系统,新的 API 可以让你不通过 selector 而是通过 block (closure) 执行代码 asyncAfter(deadline: DispatchTime, qos: DispatchQoS = default, flags: DispatchWorkItemFlags = default, execute work: @escaping @convention(block) () -> Swift.Void) DispatchQueue.main.asyncAfter(wallDeadline: DispatchWallTime.now() + 1, execute: { print("1 second after") }) 上面这段代码,可以在 1 秒之后,通过主线程执行 print。值得注意的是,设定时间的时候,有两种类型,一种是 DispatchTime,这个时间本质上是相对时间,它会在系统休眠的时候暂停,另外一种是 DispatchWallTime,这个时间正如其名,是“墙上的挂钟时间”,是绝对时间,比如你可能希望某一个任务准确地在x小时、x分钟、x秒之后执行,这段时间可能发生任何事情,这时推荐使用 DispatchWallTime. 神奇而伟大的 GCD 这里就不多做介绍了,有太多文章讲解它了优点:执行的是闭包,可以随意传参缺点:一旦开启,无法取消,只能提前在闭包里面添加严谨的逻辑判断了

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

[安卓] 3、EditText使用小程序

这里比较简单,看下面代码就能知道了:在按钮的点击事件时用String str = et.getText().toString();获取文本内容。 1 public class MainActivity extends Activity implements OnClickListener{ 2 private EditText et;//创建一个文本编辑的对象 3 private Button btn; 4 private TextView tv; 5 @Override 6 public void onCreate(Bundle savedInstanceState) { 7 super.onCreate(savedInstanceState); 8 setContentView(R.layout.main); 9 et= (EditText)findViewById(R.id.et);//实例化文本编辑 10 btn= (Button)findViewById(R.id.btn); 11 btn.setOnClickListener(this); 12 tv = (TextView)findViewById(R.id.tv); 13 } 14 @Override 15 public void onClick(View v) { 16 if(v==btn){ 17 //获取EditText中的文本内容 18 String str = et.getText().toString(); 19 //让TextView将获取到的EditText内容str显示出来 20 tv.setText(str); 21 } 22 } 23 } 注意:从上面的效果可以看出输入框是密码类型,看xml文件就知道了:18行password属性为true. 1 <?xml version="1.0" encoding="utf-8"?> 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 android:orientation="vertical" 4 android:layout_width="fill_parent" 5 android:layout_height="fill_parent" 6 > 7 <TextView 8 android:layout_width="fill_parent" 9 android:layout_height="wrap_content" 10 android:text="@string/hello" 11 android:id="@+id/tv" 12 /> 13 <EditText 14 android:layout_width="fill_parent" 15 android:layout_height="wrap_content" 16 android:hint="提示信息" 17 android:id="@+id/et" 18 android:password="true" 19 /> 20 <Button 21 android:layout_width="fill_parent" 22 android:layout_height="wrap_content" 23 android:text="获取EditText内容!" 24 android:id="@+id/btn" 25 /> 26 </LinearLayout> 本文链接:http://www.cnblogs.com/zjutlitao/p/4229742.html 更多精彩:http://www.cnblogs.com/zjutlitao 本文转自beautifulzzzz博客园博客,原文链接:http://www.cnblogs.com/zjutlitao/p/4229742.html,如需转载请自行联系原作者

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

模仿ICE的structured panorama小按钮

这个按钮的目的是用于手动排列图片序列,应该说写得比较精巧,我使用csharp进行模仿,主要采用的是自动控件创建技术。结果比较简陋,实现功能而已,放出来大家一起学习。 usingSystem; usingSystem.Collections.Generic; usingSystem.ComponentModel; usingSystem.Data; usingSystem.Drawing; usingSystem.Linq; usingSystem.Text; usingSystem.Threading.Tasks; usingSystem.Windows.Forms; namespace动态创建 { publicpartial classForm1 :Form { inticlick1 = - 1; inticlick2 = - 1; Button[]btns = newButton[ 16]; publicForm1() { InitializeComponent(); } private voidForm1_Load(objectsender,EventArgse) { //自动创建 for( inti = 0;i < 16;i ++) { btns[i] = newButton(); btns[i].Name =i.ToString(); //加个名字方便集中操作 btns[i].Size = newSize( 48, 48); intix = 20 + 60 *(i % 4); intiy = 20 + 60 *(i / 4); btns[i].Location = newPoint(ix,iy); this.Controls.Add(btns[i]); //绑定事件 btns[i].Click += newSystem.EventHandler( this.btns_Click); btns[i].MouseHover += newSystem.EventHandler( this.btns_MouseHover); btns[i].MouseLeave += newSystem.EventHandler( this.btns_MouseLeave); } } //集中事件处理 private voidbtns_Click(objectsender,EventArgse) { Buttonbtn =(Button)sender; intindex = int.Parse(btn.Name); if(index == 0 ||index == 3 ||index == 12 ||index == 15) { //将上一个选择的按钮状态变为空 if(iclick1 != - 1) btns[iclick1].Text = ""; if(iclick2 != - 1) btns[iclick2].Text = ""; iclick1 =index; btn.BackColor =Color.Empty; btn.ForeColor =Color.Black; btn.Text = "1"; } if(index == 1 ||index == 4) { if(iclick1 != 0) return; //将上一个选择的按钮状态变为空 if(iclick2 != - 1) btns[iclick2].Text = ""; iclick2 =index; btn.BackColor =Color.Empty; btn.ForeColor =Color.Black; btn.Text = "2"; } if(index == 2 ||index == 7) { if(iclick1 != 3) return; //将上一个选择的按钮状态变为空 if(iclick2 != - 1) btns[iclick2].Text = ""; iclick2 =index; btn.BackColor =Color.Empty; btn.ForeColor =Color.Black; btn.Text = "2"; } if(index == 8 ||index == 13) { if(iclick1 != 12) return; //将上一个选择的按钮状态变为空 if(iclick2 != - 1) btns[iclick2].Text = ""; iclick2 =index; btn.BackColor =Color.Empty; btn.ForeColor =Color.Black; btn.Text = "2"; } if(index == 11 ||index == 14) { if(iclick1 != 15) return; //将上一个选择的按钮状态变为空 if(iclick2 != - 1) btns[iclick2].Text = ""; iclick2 =index; btn.BackColor =Color.Empty; btn.ForeColor =Color.Black; btn.Text = "2"; } } private voidbtns_MouseHover(objectsender,EventArgse) { Buttonbtn =(Button)sender; intindex = int.Parse(btn.Name); if(index ==iclick1) return; //4个角可能按出1 if(index == 0 ||index == 3 ||index == 12 ||index == 15) { btn.BackColor =Color.Gray; btn.ForeColor =Color.White; btn.Text = "1"; } //4个角旁边可能按出2 if(index == 1 ||index == 4) { if(iclick1 != 0) return; btn.BackColor =Color.Gray; btn.ForeColor =Color.White; btn.Text = "2"; } if(index == 2 ||index == 7) { if(iclick1 != 3) return; btn.BackColor =Color.Gray; btn.ForeColor =Color.White; btn.Text = "2"; } if(index == 8 ||index == 13) { if(iclick1 != 12) return; btn.BackColor =Color.Gray; btn.ForeColor =Color.White; btn.Text = "2"; } if(index == 11 ||index == 14) { if(iclick1 != 15) return; btn.BackColor =Color.Gray; btn.ForeColor =Color.White; btn.Text = "2"; } } private voidbtns_MouseLeave(objectsender,EventArgse) { Buttonbtn =(Button)sender; intindex = int.Parse(btn.Name); if(index ==iclick1 ||index ==iclick2) return; btn.BackColor =Color.Empty; btn.ForeColor =Color.Black; btn.Text = ""; } } } 代码下载地址: http://files.cnblogs.com/files/jsxyhelu/%E5%8A%A8%E6%80%81%E5%88%9B%E5%BB%BA.zip 目前方向:图像拼接融合、图像识别 联系方式:jsxyhelu@foxmail.com

资源下载

更多资源
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文件系统,支持十年生命周期更新。

用户登录
用户注册