精华内容
下载资源
问答
  • go make的用法 区别

    2019-04-17 15:30:00
    DoandMakeare two verbs which frequently ... Learn the Difference between DO vs MAKE in English with examples and pictures. DoMake是两个经常让英语学生感到困惑动词。通过例子图片学习英语中DO vs...

    Doand Make are two verbs which frequently confuse students of English. Learn the Difference between DO vs MAKE in English with examples and pictures. Do和Make是两个经常让英语学生感到困惑的动词。通过例子和图片学习英语中DO vs MAKE的区别。

    DIFFERENCES BETWEEN DO vs MAKE

     
    10:20

    We use “DO” when someone performs actions, repetitive tasks and obligations. 当有人执行行动,重复性任务和义务时,我们使用“DO”。

    In other words, “DO” is often used when referring to work of any kind and referring to the action itself. 换句话说,“DO”通常用于指任何类型的工作和行为本身。

    We use “MAKE” for creating, producing and constructing. 我们使用“MAKE”进行创作,生产和构建。

    In other words, “MAKE” is often used when referring to the result. 换句话说,“MAKE”通常用于表示结果。

    DO vs MAKE: IMPORTANT EXPRESSIONS WITH “DO” DO vs MAKE: DO的重要表达

    Do an activity, or action such as works, jobs and tasks做一项活动或行动,如工作、工作和任务

    Housework 家务

    Do the housework 做家务Do laundry 洗衣服Do your chores 你的家务Do the washing up (UK) 洗碗(英国)Do the shopping 购物Do the cleaning 进行清洁Do the cooking 做饭Do the dishes 洗碗Do the ironing 熨烫Do your duty 尽职尽责

    Work/Study 工作/学习

    Do homework 做作业Do an assignment 做一项任务Do a report 做一份报告Do a test (UK) 做一个测试(英国)Do a project 做一个项目Do a course (UK) 做一门课程(英国)Do a deal 做一笔交易Do some reading 做一些阅读Do some writing 做一些写作Do some studying 做一些学习Do the math 做数学Do sums 做总结Do research 做研究Do experiments 做实验Do business 做生意Do the paperwork 做文书工作Do crosswords 填字游戏

    Taking care of your body 照顾好你的身体

    Do exercise 做运动Do gymnastics 做体操Do your makeup 化妆Do your hair 做你的头发Do your nails 做你的指甲

    Do non-specific activities 非特异性活动

    Do a favour (UK) / Do a favor (US) 帮忙(英国)/帮忙(美国)Do badly 表现糟糕Do harm 伤害Do damage 造成伤害Do your best 尽你所能Do a good job 做一份好工作Do well 做得很好Do nothing 什么也不做Do anything 做任何事情Do something 做点什么Do everything 做每件事Do better 做得更好Do the right thing 做正确的事Do something right 做一些正确的事Do something wrong 做错了Do the maximum 做到最大Do the minimum 尽量减少

    DO vs MAKE: IMPORTANT EXPRESSIONS WITH “MAKE” DO vs MAKE: MAKE的重要表达

    Housework 家务

    Make the bed 铺床Make room 腾出空间

    Food, Drink and Meals 食物,饮料和膳食

    Make a cake 做个蛋糕Make breakfast 做早餐Make dinner 做晚餐Make a cup of tea 泡一杯茶Make a sandwich 做三明治Make a salad 做一份沙拉Make a tea 泡茶Make a snack 做点心

    Communications 通信

    Make a noise 发出噪音Make a comment 发表评论Make a joke 开个玩笑Make a point 说明一点Make arrangements 安排Make a speech 发表演讲Make a suggestion 提出建议Make a complaint 提出投诉Make a confession 招供Make a prediction 进行预测Make an excuse 找借口Make a promise 做出承诺Make a fuss 大惊小怪Make an observation 进行观察Make a mistake 犯错误Make a call 拨打电话Make a reservation 预约Make a rude gesture 做一个粗鲁的手势Make a statement 发表声明Make noise 发出噪音Make an impression 留下印象Make an enquiry 进行咨询Make an appearance 外观Make an agreement 达成协议Make a sound 发出声音Make a presentation 进行演示Make a recovery 恢复Make peace 和平

    Relationships/ Reaction 关系/反应

    Make your eyes water 让你的眼睛充满水分Make you happy 让你开心Make you sleep 让你入睡Make you smile 让你微笑Make friends 交朋友Make love 做爱Make up 化妆Make fun of someone 取笑某人Make a pass at 通过Make a break with sb/ sth (UK) 使打破某人/某事(英国)Make a fool of yourself 自欺欺人

    Plan/Decision 计划/决定

    Make a contract 签订合同Make progress 取得进步Make a choice 做出选择Make a plan 制定计划Make a decision 做出决定Make an attempt/ effort 尝试/努力Make up your mind 下定决心Make a discovery 进行发现Make a list 列出清单Make sure 确保Make a difference 做出改变Make an exception 例外Make an offer 报价Make a note (of) 做一个说明(的)Make a prediction 进行预测

    Money 钱

    Make money 赚钱Make a profit 盈利Make a fortune 大赚一笔

    Product Material 产品材料

    Made of gold/silver 由金/银制成Made from oranges/lemons 由橙子/柠檬制成Made in Japan/China 日本/中国制造Made by me 由我制造

    Others 其他

    Make believe 相信Make sense 有意义Make changes 进行更改Make sure 确保Make trouble 制造麻烦Make up your mind 下定决心Make war 打仗Make one’s bow (UK) 鞠躬(英国)Make an objection 提出异议Make an allusion 提出一个典故Make a threat 制造威胁Make a difference 做出改变Make a fire 生火Make a habit 养成习惯Make a living 谋生Make a mess 搞得一团糟Make a dress 做一件衣服Make a move 采取行动

     

    转载于:https://www.cnblogs.com/dxqNet/p/10723858.html

    展开全文
  • run 函数 定义: inline fun <R> run(block: () ->...Calls the specified function block and returns its result. inline fun <T, R> T.run(block: T.() -> R): R //2 Calls th...

    run 函数

    定义

    
    inline fun <R> run(block: () -> R): R         //1
    Calls the specified function block and returns its result.
    
    
    inline fun <T, R> T.run(block: T.() -> R): R  //2
    Calls the specified function block with this value as its receiver and returns its result.
    
    复制代码

    第一种使用:直接使用run函数返回其结果(最后一行的结果)

    
    fun runTest() {
        val a = run {
            "abc"
            1
        }
        val b = run {
            1
            2
            "abc"
        }
        println(a)
        println(b)
    }
    复制代码

    打印结果:

    1
    
    abc
    
    复制代码

    第二种使用:调用某个对象(该对象作为接收者)的run函数并返回结果

    
    fun runTestWithT() {
        val a = 1.run {
            "$this 和 abc"
        }
        println(a)
    }  
    复制代码

    打印结果:

    1 和 abc
    复制代码

    let 函数

    定义

    
    inline fun <T, R> T.let(block: (T) -> R): R
    Calls the specified function block with this value as its argument and returns its result.
    
    复制代码

    使用:调用某个对象(该对象作为函数的参数)的let的函数并返回结果

    
    fun letTest() {
        val let = "abc".let {
            println(it)
            1
        }
        println(let)
    }
    复制代码

    打印结果:

    abc
    
    1
    
    复制代码

    also 函数

    定义

    
    inline fun <T> T.also(block: (T) -> Unit): T
    Calls the specified function block with this value as its argument and returns this value.
    
    复制代码

    使用: 调用某一对象的also 函数(该对象作为函数参数)并返回改对象

    
    fun alsoTest() {
        val also = "abc".also {
            println(it)
        }
        println(also)
    }
    复制代码

    打印结果:

    abc
    abc
    复制代码

    apply 函数

    定义

    
    inline fun <T> T.apply(block: T.() -> Unit): T
    Calls the specified function block with this value as its receiver and returns this value.
    
    复制代码

    使用:调用对象(该对象作为接收者)的apply函数并返回该对象

    
    fun applyTest(){
        val apply ="abc".apply {
            println(this)
        }
        println(apply)
    }
    复制代码

    打印结果:

    abc
    
    abc
    
    复制代码

    with 函数

    定义

    
    inline fun <T, R> with(receiver: T, block: T.() -> R): R
    Calls the specified function block with the given receiver as its receiver and returns its result.
    
    复制代码

    使用:使用给定接收器作为接收器调用with函数并返回其结果

    
    fun withTest() {
        val with = with("abc") {
            println(this)
            1111
        }
        println(with)
    }
    复制代码

    打印结果:

    abc
    1111
    复制代码

    with 函数的使用形式与其他几个函数的类型不一样

    with 函数重要的一个作用是使用它实现构建者模式

    举个例子

    
    class Student(builder: Builder) {
    
        var name: String = ""
        var age = 1
    
        init {
            name = builder.name
            age = builder.age
        }
    
        class Builder {
            var name: String = ""
            var age: Int = 0
            fun builder(): Student = Student(this)
        }
    }
    复制代码

    使用with函数构建:

    
    fun withTest() {
    
        val student = with(Student.Builder()) {
            this.age = 18
            this.name = "marry"
            builder()
        }
        println("name: ${student.name},age:${student.age}")
    }
    复制代码

    打印结果:

    
    name: marry,age:18
    
    复制代码

    看了上面的几个简单的使用,我们可能就能从几个函数的定义可以看出他们区别:

    从返回结果不同来看

    • 返回其他结果runletwith

    • 返回自身结果alsoapply

    从对象调用的作用来看

    • 调用者作为参数letalso

    • 调用者作为接受者runwithapply

    参考:kotlinlang.org/api/latest/…

    转载于:https://juejin.im/post/5c3eb235f265da61587761c5

    展开全文
  • I want to aim at a good balance between the space the saved time in the database will occupy, but also the query-capabilties and the compatibility with UTC and easy timezone conversion that doesn't ...
  • 简单讲,一句话,delete不会触发[url=... 效率比较高 Deletes the row with a primary key matching the id argument, using a SQL DELETE statement, and returns the numbe...
    简单讲,一句话,delete不会触发[url=http://hlee.rubyeye.com/admin/blogs/407637]回调[/url]
    效率比较高


    Deletes the row with a primary key matching the id argument, using a SQL DELETE statement, and returns the number of rows deleted. Active Record objects are not instantiated, so the object‘s callbacks are not executed, including any :dependent association options or Observer methods.

    You can delete multiple rows at once by passing an Array of ids.

    Note: Although it is often much faster than the alternative, destroy, skipping callbacks might bypass business logic in your application that ensures referential integrity or performs other essential jobs.

      # Delete a single row
    Todo.delete(1)

    # Delete multiple rows
    Todo.delete([2,3,4])


    Deletes the records matching conditions without instantiating the records first, and hence not calling the destroy method nor invoking callbacks. This is a single SQL DELETE statement that goes straight to the database, much more efficient than destroy_all. Be careful with relations though, in particular :dependent rules defined on associations are not honored.
      Post.delete_all("person_id = 5 AND (category = 'Something' OR category = 'Else')")
    Post.delete_all(["person_id = ? AND (category = ? OR category = ?)", 5, 'Something', 'Else'])


    Destroy an object (or multiple objects) that has the given id, the object is instantiated first, therefore all callbacks and filters are fired off before the object is deleted. This method is less efficient than ActiveRecord#delete but allows cleanup methods and other actions to be run.

    This essentially finds the object (or multiple objects) with the given id, creates a new object from the attributes, and then calls destroy on it.
      # Destroy a single object
    Todo.destroy(1)

    # Destroy multiple objects
    todos = [1,2,3]
    Todo.destroy(todos)


    Destroys the records matching conditions by instantiating each record and calling its destroy method. Each object‘s callbacks are executed (including :dependent association options and before_destroy/after_destroy Observer methods). Returns the collection of objects that were destroyed; each will be frozen, to reflect that no changes should be made (since they can‘t be persisted).

    Note: Instantiation, callback execution, and deletion of each record can be time consuming when you‘re removing many records at once. It generates at least one SQL DELETE query per record (or possibly more, to enforce your callbacks). If you want to delete many rows quickly, without concern for their associations or callbacks, use delete_all instead.

    Person.destroy_all("last_login < '2004-04-04'")
    Person.destroy_all(:status => "inactive")



    [url]http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M002219[/url]
    展开全文
  • The apply() method calls a function with a given this value, and arguments provided as an array (or an array-like object). //该apply()方法调用具有给定this值函数,并arguments以数组(或

    一、先说说apply()

    在MDN上面是这么解释的:

    The apply() method calls a function with a given this value, and arguments provided as an array (or an array-like object).
    //该apply()方法调用具有给定this值的函数,并arguments以数组(或类似数组的对象)的形式提供。

    个人理解:
    对象a下面有一个方法fn,
    调用fn:a.fn()
    很明显这个fn里面的this指向是a;
    那如果想改变this的指向,想让它指向对象b;
    那么就是:
    a.fn.apply(b)

    具体方法:

    function.apply(thisObj, [argsArray])

    function:要调用的方法
    thisObj:方法里面的this指向的对象
    [argsArray]:调用方法传入的参数,接收的是一个数组

    话不多说,上个栗子

        //构造函数
        function creatFn (name){
            this.name = name;
            };
        var a = new creatFn('小a');
        var b = new creatFn('小b');
    //对象a下面的方法say
        a.say = function(a,b){
            console.log(this.name,a+b);
    
        }
        //正常调用
        a.say(1,2);//输出: 小a,3
        //this指向b对象
        a.say.apply(b,[3,4]);//输出 :小b,7 

    二、那么call()和apply()之间的区别呢

    他们在功能上说,还真的说出来区别

    在写法上面是有区别的

    如上例的最后一步

    a.say.apply(b,[3,4])

    换成apply就该这么写了

    a.say.call(b,3,4)

    有木有发现区别?
    就是apply总共是两个参数,第二个参数是个数组,是调用方法的参数集合
    但是call就有n个参数了,第一个是方法里面的this指向的对象,剩下的参数就全是给调用方法的参数们了。

    三、好处在哪呢?

    要说好处的话,就想说说apply的一个聪明的用法
    下面这个方法:

    Math.max(num1,num2,num3,num4,num5)

    这个方法就是返回的就是传入的那些参数中最大的数字;

    来一道常见的面试题:
    如何从下面数组中找出最大值

    var arr =[1,2,3,5,7,9.9,100,189]

    那么就可以用Math.max()方法了,无奈的是他不接受一个数组啊,这时候apply()就该闪亮登场了

    //利用apply可以让方法在调用的时候将所有的参数以数组的形式传入
    Math.max.apply(null,arr)

    注意:如果不想改变this的话,第一个参数传入null就可以了

    该方法同样适用于求最小值

    Math.min.apply(null,arr)

    同样的还有一个方法

    arr.push()

    追加到数组
    假如

    var arr1 = [1,2,3]
    var arr2 = [4,5,6]

    如果我想把arr1和arr2合并,也可以用push的方法,怎么用呢?

    //下面是错误示例
    arr1.push.apply(null,arr2)

    为什么不能这么写呢,因为push是Arrary的方法呀,

    //正确写法
    Array.prototype.push.apply(arr1,arr2)

    以上是参照MDN,个人的理解,有错误之处请予以指正

    展开全文
  • <p>I started kidding around with Go and am a little irritated by the <code>new</code> function. It seems to be quite limited, especially when considering structures with anonymous fields or inline ...
  • 最近用python处理文件时碰到一个错误,让我仔细对这种用法有了一些深入...File objects are implemented using C’s stdio package and can be created with the built-in open() function. File objects are also re
  • sgdisk基本用法

    万次阅读 2017-07-28 17:09:55
    sgdisk基本用法简介sgdisk是Linux下操作...关于GPTMBR的区别请参考: http://www.anchor.com.au/blog/2012/10/the-difference-between-booting-mbr-and-gpt-with-grub/使用新建分区root@ceph1:~$ sgdisk --help | g
  • 2017/01/06 09:51需要向博主学习地方还有很多,很多,很多……Thank you so much for giving everyone an extremely breathtaking chance... It's usually very lovely and as well , stuffed with fun for me and...
  • nullundefined的区别 --2020-09-10 a++++a的区别 --2019-09-27 字符串string创建,方法 --2010-10-14 js图片压缩推荐 -2019-10-15 Js去除字符串中的中括号 --2010-10-12 js判断文件名是否合法 -2020-...
  • 扩充了toast获取展示功能 这里要先说明下,因为经常有很多人问 openatx/uiautomator2 并不支持iOS测试,需要iOS自动化测试,可以转到这个库 openatx/facebook-wda。 PS: 这个库 ...
  • ★ 把STL容器经典数组封装成统一形式,在使用上不再区别对待。对于C数组,将会自动检测越界情况。 ★ 可以使用初始化列表对数组,STL容器进行(反复)初始化。例如:vector<int> a={1,2,3,45,2}; ☆ pack STL ...
  • rails删除数据

    2011-03-15 13:45:00
    2009-06-17 Rails 中deletedestroy的用法区别 简单讲,一句话,delete不会触发回调 效率比较高 Deletes the row with a primary key matching the id argument, using a SQL DELETE statement, and retu...
  • 因为学过Java,所以对线程进程并不陌生,在Android中线程是一样写法都是继承Tread或者Runable用start回调run方法,只是用法上有些许区别。 首先是Handler这个类,API中说A Handler allows you to send and ...
  • 2009-06-17Rails 中deletedestroy的用法区别简单讲,一句话,delete不会触发回调 效率比较高 Deletes the row with a primary key matching the id argument, using a SQL DELETE statement, and returns the ...
  • <div><h3>设置 安装git后我们需要配置一下,...<a href="https://github.com/Kunena/Kunena-Forum/wiki/Create-a-new-branch-with-git-and-manage-branches">Create a new branch with git and manage branches</...
  • opengl Manual

    2012-02-19 11:09:50
    多数命令的区别仅在于它们所带的自变量的数据类型。有些命令则在相关自变量的数目、这些自变量是否被指定为向量以及是否需在列表中单独指定等方面存在着区别。例如,你使用glVertex2f命令时必须以浮点数形式提供x...
  • like 的区别和使用注意 博文 Hive 性能优化 戳破 | hive on spark 调优点 实时离线融合在唯品会的进展 数据仓库系列篇——唯品会大数据架构 数据仓库系统|框架结构 Apache Pig: 是一个基于Hadoop的大规模...
  • 掌握单表查询中各个子句(Select、From、Where、Group、Having、Order)的用法,特别要掌握比较运算符逻辑运算符使用。 二、实验环境 Windows7操作系统,SQL Server软件。 三、实验课时 2课时。 四、实验内容...
  • asp.net知识库

    2015-06-18 08:45:45
    C#中 const readonly 的区别 利用自定义属性,定义枚举值的详细文本 Web标准ASP.NET - 第一部分 XHTML介绍 在ASP.NET页面中推荐使用覆写(Override)而不是事件处理(Event Handler) 常用编码工具类,支持base...
  • Toad 使用快速入门

    2008-11-27 15:22:14
    很容易得到SQL函数列表和用法描述(Show SQL help Window 按钮) 可以查看SQL语句执行情况:通过下方AutoTrace窗口 ,看到SQL语句实际执行结果和执行效率。 支持历史SQL(F8) :可以方便查询以前...
  • java bean 与 ejb的区别 Java Socket编程(一) Java Socket编程(二) Java Socket编程(三) Java Socket编程(四) Java Socket编程(五) Java Web Start 1.0 Architecture Java Web Start 1.0 Developer...
  • 后两者的区别在于,人脸校验是要给你两张脸问你是不是同一个人,人脸识别是给你一张脸一个库问你这张脸是库里的谁。 此次faceswap只用到前两个板块DetectionAlignment: Detection - 用于找到视频中被换脸人的...
  • 可以理解是,老练黑客一些热门软件作者正在接受过多错发信息。就像那根最后压垮骆驼背稻草一样,你加入也有可能使情况走向极端 —— 已经好几次了,一些热门软件作者从自己软件支持中抽身出来,...
  • 2009 达内Unix学习笔记

    2010-02-10 19:45:32
    ls /etc/ 显示某目录下所有文件目录,如etc目录下。 ls -l (list)列表显示文件(默认按文件名排序), 显示文件权限、硬链接数(即包含文件数,普通文件是1,目录1+)、用户、组名、大小、修改日期、文件名。 ...
  • 英特尔面试专项准备

    2020-12-09 13:46:46
    <p>pthread_join函数作用和用法是什么?我说根多进程waitpid类似,等待指定线程结束。 最新线程库是NPTL?有什么新特性?我说不太清楚,他说没关系。 <ul><li> 脚本打印根...

空空如也

空空如也

1 2 3
收藏数 50
精华内容 20
关键字:

with和and的区别和用法