今天我们来解决一个问题,代码是如何驱动硬件的?我们都知道 cpu 只能识别二进制代码,他有其自己的语言系统,我们称之为机器语言, 他全部由零或一组成。那么我们编写的原代码如何能够被 cpu 识别呢?编意或解释就能把使用高级语言编写的原程序翻译成等效的二进制代码, 也就是 cpu 能够识别的机器语言变异或解释他们的操作方法不同, 运行的效果不一样,但是最终的结果都是二进制代码。所以我们的代码经编意之后,在 cpu 看来就是一组特定的高低电瓶的组合。具体到单片机的开发中, 我们的原程序如何被单片机识别呢?我们使用 q 软件编写圆程序,经过编辑之后生成 hex 文件,打开这个文件,我们发现该文件以行为单位,每行以冒号开头,内容全部为十六进制代码。 那么这个十六精致代码和机器语言中的二精致代码有什么区别呢?是不是把这种十六精致的代码转换成二精致代码就是我们的机器语言呢?答案是否定的。 仔细研究过的朋友都知道,这个十六精致代码,他的每一个字节都有其特定的含义,比如数据长度、起始地址、数据类型等信息,而并非机器语言。那么这里为什么不直接生成二精致代码呢?我们说 h 一 s 代码自带胶原位,在变异的时候能检验代码是否有错误,能够为代码的传输、存储带来便利,而二禁止代码却没有这个功能。 通过程序稍写,我们把十六进制的代码转换成二进制的代码,这样 cpu 就能识别了。那么 cpu 如何执行二进制的代码呢? 我们可以简单的把 cpu 看作是海量的开关组合,这个开关由三极管组成。我们追溯计算机的发展历史,人类的第一台万用型计算机马克一号,他拥有三千多支继电器, 这也是他的核心零部件,所以他也被称作为机电器。计算机,机电器在这台计算机中的作用就是开关,而现在我们使用三极管来代替他, 他们的原理也是一样的, cpu 是有工程师精心设计的且规模庞大的开关组,当给这个开关组输入一组特定的高低电瓶组合时,就会导致其内部出现复杂的开关动作, 最终产生另一种高低电瓶的组合。座椅输出,输出的电瓶经过放大电路、魔术转换电路等变换之后,就可以驱动相应的硬件动作。
粉丝4.7万获赞9.2万

三科特论继续学习编程,练习百例第二集第一个数据中如果存在缺失值,咱们怎么进行数据缺失值的填充?本次题目是这样的,右边呢是有 del frame, 它里面有一列是 wait, 我们看到 wait 两个缺失值 位于第三行以及第五行。咱们的题目是维特列的确实值,使用这一列的平均值进行填充,代码该怎么写呢?打开九点,首先咱们进入 para4 和南派,然后这是数据字典,使用潘纳斯进行加载。我们看一下这 df, 这就是咱们解决的问题的 df。 wait 有两个控制,要对这一列确实值进行填充。咱们可以使用三克特兰的 imputer 模块,咱们先来引入一下 form ice caram 点 may imput, 从它里面 input simple input 运行。然后呢,咱们创建一个策略对象, imputer 就等于 simple imputer 踏船两个参数,第一个 missing values 等于 np 点,嗯嗯,对应咱们上方的这个浪子。 然后第二个,咱们需要传一个策略,就以什么样的形式来进行填充呢? strategy 等于命,咱们使用君子来进行填充 对象,穿进好了以后,咱们就可以进行非得穿 s form, 英语 weight 这一列 df 两个中二,传入 wet 这一列 imputer, 他的 fit 穿 sphone 的对象呢,应该是一个二维的数字,随之类 df 呢是两个中国号,它就等于 imputer 点 fitter transform 参数,穿上这 df 运行。咱们看一下 df, 大家看到 wait 里面呢,写的没有空值了,而对应的第三个值和第五个值其实又来自于其他值的平均。通过这种方式,咱们就把一列的空值给进行了填充,我们下次见,拜拜。


曾经有这么一个神奇的短信,能让你的微信瞬间崩溃卡死,在一四一五年就有人发现了这样的疤,如果在群里发一串这样的代码,那群里人的微信都得崩溃卡死, 就连杀进城重开都没有用。这种代码几乎隔一段时间就回来刷一次存在感。其实这种代码的原理并不复杂,手机里的文字是由不同的字符组合而成的,而这些字符都储存在字体库中,当生僻字符出现时,就会消耗较多的时间在字体库里查询。而当一大堆生僻字符扎堆出现的时候, 你的微信就处理不过来,就直接卡死,到后来甚至可以把字扶藏在图片里。虽然技术上难以根治,但如果你瞎玩的话,小心被封号。

i need to remove this answer because that's not what we're looking for and i also need to set the size of the sub tree so i'll just resent the size of the sub tree with sc, and i'll and i'll set that to and that's equal to the first element of the pair so after that um do you follow along so far yep yep so after that first, i can find n, which is the number of nodes and n will just be number of nodes in the roots subtry and then okay and i'll just write this first return answer and then we do the dfs2 and we maintain the sum of distances for each node and we also just set the answer to the sum of distances for the target node when you find it so dfs2 starts at the root and then some of the senses for the root is just heat on second it's just the sum of that that's because it's a root and then you want to find targets i'll pass that in as well okay so here i have the fs2 picks in the current node picks in the sum of businesses or node you and then also gives me target and then the first thing is if we if we find out, no use a target then our answer is just the sum of distances for the current node so i'll just check for that then i'll set the answer to some of distances and then and then given the information for given the sum of distances for node you we now want to find the sum of distances for its left child and its right child and we also want to dfs on all nodes in the left subtry and the right subtry so just do this for the left subtree first okay okay so in order to find new some this i used a formula back there so it's the sum of the distances of the parent minus, the subtry that the size of the subtry of the left of the left child plus yeah number of nose outside of the subtree, which is just n minus the size of the subtree then i feel i find the new sum of distances i can call efs2 on the left channel is this part good so far yep okay and then i just do the exact same thing for the right tab as well and yeah this should be it cool okay so can you walk me through? let's copy let's maybe copy the example um let's copy it down here you copied it at the bottom of the dock can you walk me through but like go let's go through the actual code and walk me through like i've been looking for you know the the distances to four can you repeat that sentence again yeah yeah! so can you walk me through all of your code and let's assume that the target node had been like four right should i go through dfs1 as well because we kind of went through that already not dfs yeah not dfs one just the main function here and then and then dfs2 okay so dfs one after i call dfs1 get n is equal to the first almond of the pair, which is just 9 then also find that some of businesses for one is second elm of a pair, which is it was 16 right? yes but so this is where for dfs one are you not using your are you using the solution to your to the first problem or to the second problem? a oh, i'm just i wrote the dfs one just it's similar to the one for the second problem where i return a pair and the first element of the pair is the number of notes and the second element of the pair is the sum of depths okay and but for the sum of depths are you doing? aren't you here doing the sum of all of the depths it's the sum of depths in the subtree of you okay and but you and the sum of so it wouldn't be sixteen it would be 26 with what you wrote here now? or am i am i not following correctly, it's not the sum of the decks of all subtrees it's just the subtree for node one okay and here you're doing so and here you're doing p uh p dot second plus or equal p child dot second plus p child dot first but why are you doing plus p child dot first? then here in order to update the i think it helps if we look back at the original code here, so in the original code in order to find the or to find the sum of depths for all subtrees i add the p i add the second value of the pair for all knows you but then yeah but then here i'm only considering here for p i'm only considering the pair returned by the root oh, i see okay you only return you don't you don't add them all up is what you're saying yeah? yeah okay okay so i received this information from dfs1 and that's when i start going to dfs1 so i do it on note 1 first and first some of this insist is just 16 and then and then and i pass in the target, which is note 4 and this will give me the new sum of that's new sum of distances it'll set it to so it goes to the left hound it processes the left hound。


大家好,我是老盖,今天接着讲到此命令,今天和大家介绍一下,就是钓用啊程序的一个小啊皮处理一个程序 啊,批处理程序,然后啊就是他能调用系统的一些执行文件。我先写个代码啊,也不算代码吧?写个命令,然后新建一个啊文本文档,然后我首先在这里边写, 比如我想调用这个计算器,然后我把计算器的这个路径这样写出来,然后这样就 可以了,我再加一个命令, p a u s e, 这个是暂停,这样的话他会呃,我把一会我把这个这个新建文本文档改成后缀名,就是说他的文件类型要改成 b at 啊,自己的 电脑要显示出扩展类型啊,改成 b a t 之后,然后会首先运行第一个,运行完成之后会运行第二个命令,改改这个电脑,呃,显示文文件的扩展名是在这里 啊,双击我的电脑,然后组织点文件加和搜索选项,然后点查看,这里有一个隐藏已知文件类型的扩展名,这个本默认是有个对勾要取消,取消了点确定就可以了。好,我这里 改一下,这里改成 b at, b at, 就是啊批处理一个程序,这个双击运行的话,呃,这个计算机就会运行,然后我们双击运行测试 一下。好,这个计算器就运行了,他会就是说在当前路径调用了这个啊这个路径的一个 程序,我们打开文本文档再看一下,前面是环境变亮,这个是环境变亮,我们也可以直接就是说用这个直接的路径也可以进入这个文件夹,然后调用这个路径都可以,我把代码改一下,重新 啊结,结合一下上节上节课的视频,我们用一下 cd 命令,他默认话我这个皮处理是在当前文件夹,然后默认情况下 cd, 我要跳入到这个文件夹,我直接跳入到这个文件夹,然后在这个文件夹调用 c a lc 命令。 好,我再测试一下保存,修改完成之后保存,然后双击运行好,他会首首先 cd 这个命令,直接跳入 windows windose 文件夹,然后 sus 三二啊 tm 三二文件夹, 然后再次调用啊计算机这个计算器,这个程序,这样就成功了啊,这个今天介绍的就是一个比较简单一个皮处理,然后啊可以在这里边进行一些操作,调用一些程序,然后这个 pvuse, 就是 啊调音完成之后,这这里有一个按任意键继续,正常情况下他这个界面会一一闪消失,然后我我是加了个暂停,让他暂停到这里,为了显示效果,为了显示一下,然后我问一下空格或者其他的按键,好,他就消失了 啊。今天就是一个比较简单一个皮处理程序,大家可以测试一下自己的呃执行文件,比如记事本或者一个小游戏都可以啊。好,今天这个小皮处理就介绍到这里。好,再见。

如何编写第一个 vba 程序?首先在工作表标签名称,单机右键选择查看代码,打开 vb 编辑器,输入代码,运行代码。

强烈给大家推荐这个 gptple 昨天更新的代码解释器 cording tablet, 有了它你就可以上传本地数据表,让你的数据分析和作图轻松百倍。说实话就可以分析数据并作图了,还可以自动帮你解读统计分析的结果。另一个强大的功能就是支持上传整段代码, 作为代码解释器当然可以帮你解读代码并给出优化或者提升的建议。更关键的是,它非常的简单易应,直接说出你的需求它就能满足你,大家快去试试吧!


ok 的程序员能用吗?对我们外包公司来说,不能用。程序员的工作,他还是非常讲究工地的事。对一个初级的程序员,说实话啊,大多数的应用他没有那么些,但是代码表面上看来他们也能达到甲方的要求,实际他们会为候选运营以及服务带来很大的坑。 第一个,他的代码口味有和性差。他的代码就是这去复制,这去复制,规范性非常差。虽然你看起来他吃的东西只有差不多,但是后期一旦出了问题,你不要说是其他人去问就走了,他自己看起来都恼火啊。第二点,延伸性差。所谓的延伸性,其实就是 代码的更新地带。一个好的产品,他绝对是不断的去迭代升级优化出来的。级别高的程序,他写的代码他喜欢流,他在数据库结构上他就会流,甚至 一些基础的指端性的东西,他其实就是为了满足你项目后期迭代,后期新增需求。新手他不懂,他也不晓得咋的。第三点,他逻辑性不强。一个有经验的程序员,他去写代码的时候,他的逻辑性 是非常强的,他的代码是经得起推敲的。一个初级程序员,他写的东西逻辑性就是比较差。比如一个功能按照一二三四运行没得问题,但是如果你换一种方式进去,按照三二一四这种方式,他就会报错。 这就是新手他常犯的错误。所以说在开发软件这个事情上,还是要去找专业的有实力的靠谱的开发团队。