notepad++ smali语法高亮模板分享

2024-05-04 11:08

本文主要是介绍notepad++ smali语法高亮模板分享,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

某论坛也有,但是太难看了,

前面介绍了一些工具可以反编译dex文件为smali文件,在Android程序逆向分析中,阅读smali代码已然是十分重要的,但各种代码编辑器都无法较好的支持smali文件的阅读、编辑,目前貌似至于Notepad++可以用增加一些配置文件的方法来高亮显示smali语法。

使用方法

将下面内容保存到C:\Users\用户名\AppData\Roaming\Notepad++下,文件名为userDefineLang.xml。
或者在此目录找到lang.xml

插入节点

<Language name="smali" ext="smali" commentLine="0#" commentStart="" commentEnd=""><KeywordLists><Keywords name="Delimiters"></Keywords><Keywords name="Folder+"></Keywords><Keywords name="Folder-"></Keywords><Keywords name="Operators">' ! " ( ) , ; : @ [ ] { }</Keywords><Keywords name="Comment">0#</Keywords><Keywords name="Words1">move move/from16 move/16 move-wide move-wide/from16 move-wide/16 move-object move-object/from16 move-object/16 move-result move-result-wide move-result-object move-exception return-void return return-wide return-object const/4 const/16 const const/high16 const-wide/16 const-wide/32 const-wide const-wide/high16 const-string const-string/jumbo const-class monitor-enter monitor-exit check-cast instance-of array-length new-instance new-array filled-new-array filled-new-array/range fill-array-data throw goto goto/16 goto/32 packed-switch sparse-switch cmpl-float cmpg-float cmpl-double cmpg-double cmp-long if-eq if-ne if-lt if-ge if-gt if-le if-eqz if-nez if-ltz if-gez if-gtz if-lez aget aget-wide aget-object  aget-boolean aget-byte aget-char aget-short aget-short aput aput-wide aput-object aput-boolean aput-byte aput-char aput-short iget iget-wide iget-object iget-boolean iget-char iget-short iput iput-wide iput-object iput-boolean iput-byte iput-char iput-short sget sget-wide sgetobject sget-boolean sget-byte sget-char sget-short sput sput-wide sput-object sput-boolean sput-byte sput-char sput-short invoke-virtual invoke-super invoke-direct invoke-static invoke-interface invoke-virtual/range invoke-super/range invoke-direct/range invoke-static/range invoke-interface/range neg-int not-int neg-long neg-float neg-double int-tolong int-tofloat int-to-double long-to-int long-to-float long-to-double float-to-int float-to-long double-to-double double-to-int double-to-long double-to-float int-to-byte int-to-char int-to-short add-int sub-int mul-int div-int rem-int and-int or-int xor-int shl-int shr-int ushr-int add-long sub-long mul-long div-long rem-long and-long or-long xor-long shl-long shr-long ushr-long add-float sub-float mul-float div-float rem-float add-double sub-double mul-double div-double rem-double add-int/2addr sub-int/2addr mul-int/2addr div-int/2addr rem-int/2addr and-int/2addr or-int/2addr xor-int/2addr shl-int/2addr shr-int/2addr usnhr-int/2addr add-long/2addr sub-long/2addr mul-long/2addr div-long/2addr rem-long/2addr and-long/2addr or-long/2addr xor-long/2addr shl-long/2addr shr-long/2addr ushr-long/2addr add-float/2addr sub-float/2addr mul-float/2addr div-float/2addr rem-float/2addr add-double/2addr mul-double/2addr div-double/2addr rem-double/2addr add-int/lit16 rsub-int mul-int/lit16 div-int/lit16 and-int.lit16 or-int/lit16 xor-int/lit16 and-int/lit8 mul-int/lit8 div-int/lit8</Keywords><Keywords name="Words2">.method .annotation .end  .line .prologue .implements .super .class .source  .locals .parameter .field .local .restart</Keywords><Keywords name="Words3">public annotation method protected static final field private synthetic local</Keywords><Keywords name="Words4">Z V I F</Keywords></KeywordLists></Language>

也可以直接新建模板导入xml文件。。

userDefinedLang.xml

<NotepadPlus><UserLang name="smali" ext="smali"><Settings><Global caseIgnored="no" /></Settings><KeywordLists><Keywords name="Delimiters"></Keywords><Keywords name="Folder+"></Keywords><Keywords name="Folder-"></Keywords><Keywords name="Operators">' ! " ( ) , ; : @ [ ] { }</Keywords><Keywords name="Comment">0#</Keywords><Keywords name="Words1">move move/from16 move/16 move-wide move-wide/from16 move-wide/16 move-object move-object/from16 move-object/16 move-result move-result-wide move-result-object move-exception return-void return return-wide return-object const/4 const/16 const const/high16 const-wide/16 const-wide/32 const-wide const-wide/high16 const-string const-string/jumbo const-class monitor-enter monitor-exit check-cast instance-of array-length new-instance new-array filled-new-array filled-new-array/range fill-array-data throw goto goto/16 goto/32 packed-switch sparse-switch cmpl-float cmpg-float cmpl-double cmpg-double cmp-long if-eq if-ne if-lt if-ge if-gt if-le if-eqz if-nez if-ltz if-gez if-gtz if-lez aget aget-wide aget-object  aget-boolean aget-byte aget-char aget-short aget-short aput aput-wide aput-object aput-boolean aput-byte aput-char aput-short iget iget-wide iget-object iget-boolean iget-char iget-short iput iput-wide iput-object iput-boolean iput-byte iput-char iput-short sget sget-wide sgetobject sget-boolean sget-byte sget-char sget-short sput sput-wide sput-object sput-boolean sput-byte sput-char sput-short invoke-virtual invoke-super invoke-direct invoke-static invoke-interface invoke-virtual/range invoke-super/range invoke-direct/range invoke-static/range invoke-interface/range neg-int not-int neg-long neg-float neg-double int-tolong int-tofloat int-to-double long-to-int long-to-float long-to-double float-to-int float-to-long double-to-double double-to-int double-to-long double-to-float int-to-byte int-to-char int-to-short add-int sub-int mul-int div-int rem-int and-int or-int xor-int shl-int shr-int ushr-int add-long sub-long mul-long div-long rem-long and-long or-long xor-long shl-long shr-long ushr-long add-float sub-float mul-float div-float rem-float add-double sub-double mul-double div-double rem-double add-int/2addr sub-int/2addr mul-int/2addr div-int/2addr rem-int/2addr and-int/2addr or-int/2addr xor-int/2addr shl-int/2addr shr-int/2addr usnhr-int/2addr add-long/2addr sub-long/2addr mul-long/2addr div-long/2addr rem-long/2addr and-long/2addr or-long/2addr xor-long/2addr shl-long/2addr shr-long/2addr ushr-long/2addr add-float/2addr sub-float/2addr mul-float/2addr div-float/2addr rem-float/2addr add-double/2addr mul-double/2addr div-double/2addr rem-double/2addr add-int/lit16 rsub-int mul-int/lit16 div-int/lit16 and-int.lit16 or-int/lit16 xor-int/lit16 and-int/lit8 mul-int/lit8 div-int/lit8</Keywords><Keywords name="Words2">.method .annotation .end  .line .prologue .implements .super .class .source  .locals .parameter .field .local .restart</Keywords><Keywords name="Words3">public annotation method protected static final field private synthetic local</Keywords><Keywords name="Words4">Z V I F</Keywords></KeywordLists><Styles><WordsStyle name="DEFAULT" styleID="11" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" /><WordsStyle name="FOLDEROPEN" styleID="12" fgColor="FF0000" bgColor="FFFFFF" fontName="" fontStyle="0" /><WordsStyle name="FOLDERCLOSE" styleID="13" fgColor="FF0000" bgColor="FFFFFF" fontName="" fontStyle="0" /><WordsStyle name="KEYWORD1" styleID="5" fgColor="FF8040" bgColor="FFFFFF" fontName="Consolas" fontStyle="1" fontSize="10" /><WordsStyle name="KEYWORD2" styleID="6" fgColor="91A62D" bgColor="FFFFFF" fontName="Consolas" fontStyle="2" fontSize="10" /><WordsStyle name="KEYWORD3" styleID="7" fgColor="004080" bgColor="FFFFFF" fontName="Consolas" fontStyle="0" fontSize="10" /><WordsStyle name="KEYWORD4" styleID="8" fgColor="FF0000" bgColor="FFFFFF" fontName="Consolas" fontStyle="0" fontSize="10" /><WordsStyle name="COMMENT" styleID="1" fgColor="FF8080" bgColor="FFFFFF" fontName="Consolas" fontStyle="2" fontSize="10" /><WordsStyle name="COMMENT LINE" styleID="2" fgColor="008000" bgColor="FFFFFF" fontName="Consolas" fontStyle="2" fontSize="10" /><WordsStyle name="NUMBER" styleID="4" fgColor="D9006C" bgColor="FFFFFF" fontName="Consolas" fontStyle="0" fontSize="10" /><WordsStyle name="OPERATOR" styleID="10" fgColor="008040" bgColor="FFFFFF" fontName="" fontStyle="0" /><WordsStyle name="DELIMINER1" styleID="14" fgColor="AF2BFF" bgColor="FFFFFF" fontName="" fontStyle="0" /><WordsStyle name="DELIMINER2" styleID="15" fgColor="AF2BFF" bgColor="FFFFFF" fontName="" fontStyle="0" /><WordsStyle name="DELIMINER3" styleID="16" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" /></Styles></UserLang>
</NotepadPlus>

或者

<NotepadPlus><UserLang name="smali" ext="smali" udlVersion="2.1"><Settings><Global caseIgnored="no" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" /><Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" Keywords5="yes" Keywords6="no" Keywords7="yes" Keywords8="no" /></Settings><KeywordLists><Keywords name="Comments">00# 00// 01 02 03/* 04*/</Keywords><Keywords name="Numbers, prefix1">-0x 0x</Keywords><Keywords name="Numbers, prefix2"></Keywords><Keywords name="Numbers, extras1"></Keywords><Keywords name="Numbers, extras2"></Keywords><Keywords name="Numbers, suffix1"></Keywords><Keywords name="Numbers, suffix2"></Keywords><Keywords name="Numbers, range"></Keywords><Keywords name="Operators1">&apos; ! &quot; ( ) , @ [ ] { } &lt; &gt; ;-&gt; -&gt;</Keywords><Keywords name="Operators2"></Keywords><Keywords name="Folders in code1, open">.method .packed-switch .sparse-switch /*</Keywords><Keywords name="Folders in code1, middle"></Keywords><Keywords name="Folders in code1, close">.end method .endpacked-switch .endsparse-switch */</Keywords><Keywords name="Folders in code2, open"></Keywords><Keywords name="Folders in code2, middle"></Keywords><Keywords name="Folders in code2, close"></Keywords><Keywords name="Folders in comment, open"></Keywords><Keywords name="Folders in comment, middle"></Keywords><Keywords name="Folders in comment, close"></Keywords><Keywords name="Keywords1">move move/from16 move/16 move-wide move-wide/from16 move-wide/16 move-object move-object/from16 move-object/16 move-result move-result-wide move-result-object move-exception return-void return return-wide return-object const/4 const/16 const const/high16 const-wide/16 const-wide/32 const-wide const-wide/high16 const-string const-string/jumbo const-class monitor-enter monitor-exit check-cast instance-of array-length new-instance new-array filled-new-array filled-new-array/range fill-array-data throw packed-switch sparse-switch cmpl-float cmpg-float cmpl-double cmpg-double cmp-long aget aget-wide aget-object aget-boolean aget-byte aget-char aget-short aget-short aput aput-wide aput-object aput-boolean aput-byte aput-char aput-short iget iget-wide iget-object iget-boolean iget-char iget-short iput iput-wide iput-object iput-boolean iput-byte iput-char iput-short sget sget-wide sgetobject sget-boolean sget-byte sget-char sget-short sput sput-wide sput-object sput-boolean sput-byte sput-char sput-short invoke-virtual invoke-super invoke-direct invoke-static invoke-interface invoke-virtual/range invoke-super/range invoke-direct/range invoke-static/range invoke-interface/range neg-int not-int neg-long neg-float neg-double int-tolong int-tofloat int-to-double long-to-int long-to-float long-to-double float-to-int float-to-long double-to-double double-to-int double-to-long double-to-float int-to-byte int-to-char int-to-short add-int sub-int mul-int div-int rem-int and-int or-int xor-int shl-int shr-int ushr-int add-long sub-long mul-long div-long rem-long and-long or-long xor-long shl-long shr-long ushr-long add-float sub-float mul-float div-float rem-float add-double sub-double mul-double div-double rem-double add-int/2addr sub-int/2addr mul-int/2addr div-int/2addr rem-int/2addr and-int/2addr or-int/2addr xor-int/2addr xor-int/lit8 shl-int/2addr shr-int/2addr usnhr-int/2addr add-long/2addr sub-long/2addr mul-long/2addr div-long/2addr rem-long/2addr and-long/2addr or-long/2addr xor-long/2addr shl-long/2addr shr-long/2addr ushr-long/2addr add-float/2addr sub-float/2addr mul-float/2addr div-float/2addr rem-float/2addr add-double/2addr mul-double/2addr div-double/2addr rem-double/2addr add-int/lit16 rsub-int mul-int/lit16 div-int/lit16 and-int.lit16 or-int/lit16 xor-int/lit16 and-int/lit8 mul-int/lit8 div-int/lit8 add-int/lit8 and-int/lit16 sget-object</Keywords><Keywords name="Keywords2">.line .prologue .implements .super .class .source .locals .parameter .field .local .restart</Keywords><Keywords name="Keywords3">public annotation method protected static final field private synthetic local Z V I F</Keywords><Keywords name="Keywords4">goto goto/16 goto/32 if-eq if-ne if-lt if-ge if-gt if-le if-eqz if-nez if-ltz if-gez if-gtz if-lez</Keywords><Keywords name="Keywords5">Ljava Lcom</Keywords><Keywords name="Keywords6">v0 v1 v2 v3 v4 v5 v6 v7 p0 p1 p2 p3 p4 p5 p6</Keywords><Keywords name="Keywords7">:cond_ :goto_ :catch</Keywords><Keywords name="Keywords8"></Keywords><Keywords name="Delimiters">00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23</Keywords></KeywordLists><Styles><WordsStyle name="DEFAULT" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /><WordsStyle name="COMMENTS" fgColor="00FF00" bgColor="FFFFFF" fontName="" fontStyle="2" fontSize="" nesting="0" /><WordsStyle name="LINE COMMENTS" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="2" fontSize="" nesting="0" /><WordsStyle name="NUMBERS" fgColor="D9006C" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" nesting="0" /><WordsStyle name="KEYWORDS1" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="1" fontSize="" nesting="0" /><WordsStyle name="KEYWORDS2" fgColor="00BB00" bgColor="FFFFFF" fontName="" fontStyle="2" fontSize="" nesting="0" /><WordsStyle name="KEYWORDS3" fgColor="8080FF" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" nesting="0" /><WordsStyle name="KEYWORDS4" fgColor="FF0000" bgColor="FFFF00" fontName="" fontStyle="0" fontSize="" nesting="0" /><WordsStyle name="KEYWORDS5" fgColor="400000" bgColor="C4FFFF" fontName="" fontStyle="0" nesting="0" /><WordsStyle name="KEYWORDS6" fgColor="808000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /><WordsStyle name="KEYWORDS7" fgColor="00FF00" bgColor="008040" fontName="" fontStyle="2" nesting="0" /><WordsStyle name="KEYWORDS8" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /><WordsStyle name="OPERATORS" fgColor="FF8080" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /><WordsStyle name="FOLDER IN CODE1" fgColor="FF0000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /><WordsStyle name="FOLDER IN CODE2" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /><WordsStyle name="FOLDER IN COMMENT" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /><WordsStyle name="DELIMITERS1" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /><WordsStyle name="DELIMITERS2" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /><WordsStyle name="DELIMITERS3" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /><WordsStyle name="DELIMITERS4" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /><WordsStyle name="DELIMITERS5" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /><WordsStyle name="DELIMITERS6" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /><WordsStyle name="DELIMITERS7" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /><WordsStyle name="DELIMITERS8" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /></Styles></UserLang>
</NotepadPlus>

或者

<NotepadPlus><UserLang name="Smali" ext="smali" udlVersion="2.1"><Settings><Global caseIgnored="no" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" /><Prefix Keywords1="yes" Keywords2="yes" Keywords3="yes" Keywords4="yes" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" /></Settings><KeywordLists><Keywords name="Comments">00# 01 02</Keywords><Keywords name="Numbers, prefix1"></Keywords><Keywords name="Numbers, prefix2"></Keywords><Keywords name="Numbers, extras1"></Keywords><Keywords name="Numbers, extras2"></Keywords><Keywords name="Numbers, suffix1"></Keywords><Keywords name="Numbers, suffix2"></Keywords><Keywords name="Numbers, range"></Keywords><Keywords name="Operators1">&apos; ! &quot; ( ) , ; @ [ ] { }</Keywords><Keywords name="Operators2"></Keywords><Keywords name="Folders in code1, open">.method .param .annotation .packed-switch .sparse-switch</Keywords><Keywords name="Folders in code1, middle"></Keywords><Keywords name="Folders in code1, close">.end method .endpacked-switch .endsparse-switch</Keywords><Keywords name="Folders in code2, open"></Keywords><Keywords name="Folders in code2, middle"></Keywords><Keywords name="Folders in code2, close"></Keywords><Keywords name="Folders in comment, open"></Keywords><Keywords name="Folders in comment, middle"></Keywords><Keywords name="Folders in comment, close"></Keywords><Keywords name="Keywords1">.line .prologue .implements .super .class .source .locals .parameter .field .local .restart .catchall</Keywords><Keywords name="Keywords2">public final protected private static synthetic</Keywords><Keywords name="Keywords3">goto if :cond :goto :try :catch :pswitch :catchall</Keywords><Keywords name="Keywords4">return</Keywords><Keywords name="Keywords5">Z V I F J</Keywords><Keywords name="Keywords6"></Keywords><Keywords name="Keywords7"></Keywords><Keywords name="Keywords8"></Keywords><Keywords name="Delimiters"></Keywords></KeywordLists><Styles><WordsStyle name="DEFAULT" fgColor="400040" bgColor="D7D7AF" fontName="" fontStyle="0" nesting="0" /><WordsStyle name="COMMENTS" fgColor="00FF40" bgColor="58693D" fontName="" fontStyle="0" fontSize="" nesting="0" /><WordsStyle name="LINE COMMENTS" fgColor="8080C0" bgColor="D7D7AF" fontName="" fontStyle="0" fontSize="" nesting="0" /><WordsStyle name="NUMBERS" fgColor="004040" bgColor="D7D7AF" fontName="" fontStyle="0" fontSize="" nesting="0" /><WordsStyle name="KEYWORDS1" fgColor="004040" bgColor="D7D7AF" fontName="" fontStyle="0" fontSize="" nesting="0" /><WordsStyle name="KEYWORDS2" fgColor="0080FF" bgColor="D7D7AF" fontName="" fontStyle="0" fontSize="" nesting="0" /><WordsStyle name="KEYWORDS3" fgColor="FF00FF" bgColor="D7D7AF" fontName="" fontStyle="1" fontSize="" nesting="0" /><WordsStyle name="KEYWORDS4" fgColor="FF00FF" bgColor="FFFF00" fontName="" fontStyle="1" fontSize="" nesting="0" /><WordsStyle name="KEYWORDS5" fgColor="0080FF" bgColor="D7D7AF" fontName="" fontStyle="0" nesting="0" /><WordsStyle name="KEYWORDS6" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /><WordsStyle name="KEYWORDS7" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /><WordsStyle name="KEYWORDS8" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /><WordsStyle name="OPERATORS" fgColor="FFFFFF" bgColor="D7D7AF" fontName="" fontStyle="0" nesting="0" /><WordsStyle name="FOLDER IN CODE1" fgColor="0000E3" bgColor="D7D7AF" fontName="" fontStyle="0" nesting="0" /><WordsStyle name="FOLDER IN CODE2" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /><WordsStyle name="FOLDER IN COMMENT" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /><WordsStyle name="DELIMITERS1" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /><WordsStyle name="DELIMITERS2" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /><WordsStyle name="DELIMITERS3" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /><WordsStyle name="DELIMITERS4" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /><WordsStyle name="DELIMITERS5" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /><WordsStyle name="DELIMITERS6" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /><WordsStyle name="DELIMITERS7" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /><WordsStyle name="DELIMITERS8" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /></Styles></UserLang>
</NotepadPlus>

风格1

image.png

风格2

image.png

风格3最丑,我都不好意思秀 各位也可以自己编辑模板,

这篇关于notepad++ smali语法高亮模板分享的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/959056

相关文章

C#读取本地网络配置信息全攻略分享

《C#读取本地网络配置信息全攻略分享》在当今数字化时代,网络已深度融入我们生活与工作的方方面面,对于软件开发而言,掌握本地计算机的网络配置信息显得尤为关键,而在C#编程的世界里,我们又该如何巧妙地读取... 目录一、引言二、C# 读取本地网络配置信息的基础准备2.1 引入关键命名空间2.2 理解核心类与方法

Golang使用etcd构建分布式锁的示例分享

《Golang使用etcd构建分布式锁的示例分享》在本教程中,我们将学习如何使用Go和etcd构建分布式锁系统,分布式锁系统对于管理对分布式系统中共享资源的并发访问至关重要,它有助于维护一致性,防止竞... 目录引言环境准备新建Go项目实现加锁和解锁功能测试分布式锁重构实现失败重试总结引言我们将使用Go作

Python中列表的高级索引技巧分享

《Python中列表的高级索引技巧分享》列表是Python中最常用的数据结构之一,它允许你存储多个元素,并且可以通过索引来访问这些元素,本文将带你深入了解Python列表的高级索引技巧,希望对... 目录1.基本索引2.切片3.负数索引切片4.步长5.多维列表6.列表解析7.切片赋值8.删除元素9.反转列表

Python中处理NaN值的技巧分享

《Python中处理NaN值的技巧分享》在数据科学和数据分析领域,NaN(NotaNumber)是一个常见的概念,它表示一个缺失或未定义的数值,在Python中,尤其是在使用pandas库处理数据时,... 目录NaN 值的来源和影响使用 pandas 的 isna()和 isnull()函数直接比较 Na

Ilya-AI分享的他在OpenAI学习到的15个提示工程技巧

Ilya(不是本人,claude AI)在社交媒体上分享了他在OpenAI学习到的15个Prompt撰写技巧。 以下是详细的内容: 提示精确化:在编写提示时,力求表达清晰准确。清楚地阐述任务需求和概念定义至关重要。例:不用"分析文本",而用"判断这段话的情感倾向:积极、消极还是中性"。 快速迭代:善于快速连续调整提示。熟练的提示工程师能够灵活地进行多轮优化。例:从"总结文章"到"用

poj3468(线段树成段更新模板题)

题意:包括两个操作:1、将[a.b]上的数字加上v;2、查询区间[a,b]上的和 下面的介绍是下解题思路: 首先介绍  lazy-tag思想:用一个变量记录每一个线段树节点的变化值,当这部分线段的一致性被破坏我们就将这个变化值传递给子区间,大大增加了线段树的效率。 比如现在需要对[a,b]区间值进行加c操作,那么就从根节点[1,n]开始调用update函数进行操作,如果刚好执行到一个子节点,

C++11第三弹:lambda表达式 | 新的类功能 | 模板的可变参数

🌈个人主页: 南桥几晴秋 🌈C++专栏: 南桥谈C++ 🌈C语言专栏: C语言学习系列 🌈Linux学习专栏: 南桥谈Linux 🌈数据结构学习专栏: 数据结构杂谈 🌈数据库学习专栏: 南桥谈MySQL 🌈Qt学习专栏: 南桥谈Qt 🌈菜鸡代码练习: 练习随想记录 🌈git学习: 南桥谈Git 🌈🌈🌈🌈🌈🌈🌈🌈🌈🌈🌈🌈🌈�

【专题】2024飞行汽车技术全景报告合集PDF分享(附原数据表)

原文链接: https://tecdat.cn/?p=37628 6月16日,小鹏汇天旅航者X2在北京大兴国际机场临空经济区完成首飞,这也是小鹏汇天的产品在京津冀地区进行的首次飞行。小鹏汇天方面还表示,公司准备量产,并计划今年四季度开启预售小鹏汇天分体式飞行汽车,探索分体式飞行汽车城际通勤。阅读原文,获取专题报告合集全文,解锁文末271份飞行汽车相关行业研究报告。 据悉,业内人士对飞行汽车行业

poj 1258 Agri-Net(最小生成树模板代码)

感觉用这题来当模板更适合。 题意就是给你邻接矩阵求最小生成树啦。~ prim代码:效率很高。172k...0ms。 #include<stdio.h>#include<algorithm>using namespace std;const int MaxN = 101;const int INF = 0x3f3f3f3f;int g[MaxN][MaxN];int n

uva 1342 欧拉定理(计算几何模板)

题意: 给几个点,把这几个点用直线连起来,求这些直线把平面分成了几个。 解析: 欧拉定理: 顶点数 + 面数 - 边数= 2。 代码: #include <iostream>#include <cstdio>#include <cstdlib>#include <algorithm>#include <cstring>#include <cmath>#inc