scala函数式编程

意见 (Opinion)

If you haven’t used Scala yet, you’re not the only one: Not even four percent of all programmers were using the language as of last year, according to

如果您还没有使用Scala,那么您不是唯一的一个:截至去年,甚至没有百分之四的程序员都在使用该语言。

StackOverflow. That puts it at rank 22 of the most-used languages, JavaScript and HTML being the top two.StackOverflow 。 这使它在最常用的语言中排名第22位,JavaScript和HTML排名前两位。

The programmers that use Scala, however, seem to profit from it. Not only does it rank at place 14 in StackOverflow’s most loved languages. This is significantly higher than the rank 22 of usage.

但是,使用Scala的程序员似乎从中受益。 它不仅在StackOverflow最受欢迎的语言中排名第14位。 这大大高于使用排名22。

And financially, knowing the language seems to pay off: Globally, only Perl programmers get a higher salary than Scala programmers, both landing at around $76 thousand per year. In the US, Scala takes the top spot in terms of salary, and programmers can expect to make about $150 thousand each year. Sounds okay to me!

从财务上讲,了解这种语言似乎会有所收获:在全球范围内,只有Perl程序员的薪水高于Scala程序员,两者的年薪都在7.6万美元左右。 在美国,Scala在薪水方面名列第一,程序员可以期望每年赚取约15万美元。 听起来对我还行!

There are different reasons why some programming languages are more loved or more lucrative than others. In the case of Scala, the main reason is that it makes it quite easy for programmers to learn functional programming, without giving up on known-and-loved paradigms like object-oriented programming.

有些编程语言比其他编程语言更受青睐或赚钱的原因有很多。 就Scala而言,主要原因是它使程序员很容易学习函数式编程 ,而又不放弃诸如面向对象编程之类广为人知的广受欢迎的范例 。

Functional programming has been gaining traction in the past few years because it’s very apt for processing big data volumes, implementing machine learning algorithms, and more. As such technologies scale very well, investing in them has been bringing revenue in companies of uncountable sectors. That’s why high salaries for Scala-programmers are justified.

在过去的几年中,函数式编程非常受关注,因为它非常适合处理大数据量,实现机器学习算法等。 由于此类技术的扩展性非常好,因此对这些技术的投资已为无数行业的公司带来了收入。 这就是为什么Scala程序员的高薪是合理的。

统一面向对象和功能编程 (Unifying object-oriented and functional programming)

Scala certainly isn’t the only multi-paradigm language on the market. Python, for example, supports both object-oriented and functional programming. In Java, functional programming is possible in principle, even though it’s originally designed as an object-oriented programming language.

当然,Scala不是市场上唯一的多范式语言 。 例如,Python同时支持面向对象和功能编程。 在Java中,即使原本是设计为面向对象的编程语言,但从原理上讲,函数式编程也是可行的 。

What makes Scala special, however, is its quest to seamlessly integrate object-oriented and functional programming. Usually, the two paradigms are presented as the opposite of one another: in functional code, you’ll only find pure functions. In object-oriented code, you’ll come across impure functions, too.

然而,使Scala与众不同的是它对无缝集成面向对象和函数式编程的追求。 通常,这两种范例彼此相反:在功能代码中,您只会找到纯函数。 在面向对象的代码中,您还会遇到不纯函数。

In functional code, all variables are immutable, i.e., their values are fixed once and never changed again. In object-oriented code, you can change the values of variables as you go. In functional code, you won’t find any side effects; in object-oriented code, you could encounter them from time to time.

在功能代码中,所有变量都是不可变的,即,它们的值一次固定,以后不再更改。 在面向对象的代码中,您可以随时更改变量的值。 在功能代码中,您不会发现任何副作用 ; 在面向对象的代码中,您可能会不时遇到它们。

That doesn’t mean that there aren’t many ways to include more functional programming in code that is primarily object-oriented. In many languages, you can use basic concepts that are stolen from functional programming in your regular code. For example, in Python, it’s quite easy to build iterators, generators, and anonymous functions.

这并不意味着没有太多方法可以在主要面向对象的代码中包含更多的功能性编程。 在许多语言中,您可以使用从常规代码中的函数式编程中窃取的基本概念。 例如,在Python中 ,构建迭代器,生成器和匿名函数非常容易。

But Scala does this the other way around, too: it makes it very easy for developers to write primarily functional code which can then be patched up with object-oriented pieces where functional would be a bit too tedious. This is a nice compromise to purely functional programming, where things like user-defined I/O, for example, aren’t straightforward to implement.

但是Scala的做法也相反:开发人员可以很轻松地编写主要为功能的代码,然后可以用面向对象的代码修补这些代码,而功能会有些乏味。 这是对纯函数式编程的一个不错的折衷,在纯函数式编程中,诸如用户定义的I / O之类的东西并不容易实现。

Getting started in Scala isn’t as hard as it sounds. Photo by Priscilla Du Preez on Unsplash
Scala入门并不像听起来那么难。 Priscilla Du Preez 摄于Unsplash

Scala快速入门 (Quickstart in Scala)

Like in many other languages, there are two ways of working with Scala: using an IDE, or on the command line. Personally, I’m a command line-aficionado, but at the end of the day that comes down to taste.

与许多其他语言一样,使用Scala有两种方法 :使用IDE或在命令行上。 就个人而言,我是一个命令行狂热者,但归根结底,这真是令人难以置信。

In both cases, however, you’d have to download and install Scala. But sometimes you just want to dabble a bit first without installing anything or follow along with what I’ll be presenting in the following sections — which I encourage you to do. The good news is that you can write and run your code right in your browser with Scastie or ScalaFiddle.

但是,在两种情况下,您都必须下载并安装Scala。 但是有时您只是想先涉猎而不安装任何东西,或者按照我将在以下各节中介绍的内容进行操作,我鼓励您这样做。 好消息是,您可以使用Scastie或ScalaFiddle在浏览器中直接编写和运行代码。

Both sites are fine for smaller projects like the one down below, where you won’t be loading a lot of libraries. If you need to load something heavy, then ScalaFiddle might be the better option because it handles libraries quite efficiently.

这两个站点都适合较小的项目,例如下面的项目,您不会在其中装载很多库。 如果您需要重载,那么ScalaFiddle可能是更好的选择,因为它可以非常有效地处理库。

It goes without saying that, for the moment at least, code-in-browser projects shouldn’t be huge. If you’ve developed a liking for Scala and you want to build something bigger, then installing Scala on your machine will be the better option.

毋庸置疑,至少就目前而言,浏览器中的代码项目不应该很大。 如果您喜欢Scala,并且想要构建更大的东西,那么在您的计算机上安装Scala将是更好的选择。

That being said, it’s completely fine if you don’t have the time to follow along right now. By the end of this story, you’ll still be able to understand what’s going on, and have a basic understanding of how to code in Scala.

话虽如此,如果您现在没有时间跟进,那完全没问题。 到本故事结束时,您仍然可以了解正在发生的事情,并对如何在Scala中进行编码有基本的了解。

Scala的“你好,世界!” (Scala’s “Hello, World!”)

Go to Scastie or ScalaFiddle, and type:

转到Scastie或ScalaFiddle ,然后输入:

println("Hello, world!")

Then press “run”. And you get Hello, World! It’s that simple.

然后按“运行”。 您会收到Hello, World! 就这么简单。

Okay, if you want to run a real script on your local machine, you do need some boilerplate code. But we’ll get to that in a minute. First, there are a few basics that we’ll need to cover.

好的,如果您想在本地计算机上运行真实的脚本,则需要一些样板代码。 但是,我们将在一分钟内解决这个问题。 首先,我们需要介绍一些基本知识。

值和变量 (Values and variables)

You can assign immutable variables — in Scala they’re called values — using the val prefix:

您可以使用val前缀分配不可变变量(在Scala中称为值):

val Greeting = "Hello, World!"println(Greeting)

Since values are immutable, you can’t reassign anything to them. If you try to, the compiler will throw you an error. You guessed it right: that’s functional programming right there!

由于值是不可变的,因此您无法将任何内容重新分配给它们。 如果尝试这样做,编译器将向您抛出错误。 您猜对了:那就是功能编程!

There is an alternative, though, if you need to reassign something: just use the prefix var, and call it a day.

但是,如果您需要重新分配某些内容,则还有另一种方法:只需使用前缀var ,然后将其命名为day。

Scala is both object-oriented and functional. Photo by 7shifts on Unsplash
Scala既是面向对象的又是功能性的。 7shifts在Unsplash上的照片

功能与方法 (Functions and methods)

Functions are constructed really easily in Scala:

在Scala中,构造函数非常容易:

val GreetMe = (name: String) => println("Hi, " + name + "!")GreetMe("Rhea")

This returns Hi, Rhea! as expected. The part before the = defines the name of the function, then come its arguments, and after the => you’ll find the function body.

返回Hi, Rhea! 如预期的那样。 =之前的部分定义了函数的名称,然后是其参数,而=>之后的部分将找到函数主体。

You can define anonymous functions by leaving away the name definition, which is very much in the style of functional programming. What’s not functional at all is that you can define functions that have no arguments — in functional programming, you always need an argument.

您可以通过省略名称定义来定义匿名函数,该定义非常类似于函数式编程的样式。 根本不起作用的是,您可以定义不带参数的函数-在函数式编程中,您始终需要一个参数。

There are also methods, which are quite similar to functions:

还有一些方法,它们与函数非常相似:

def GreetMe2(name: String): Unit = {    val greeting = "Hi, " + name + "!"    println("Hi, " + name + "!")}GreetMe2("Rhea")

They’re quite similar to functions, but their syntax is a bit different. An output type needs to be specified, like the Unit in front of the curly braces in this example.

它们与函数非常相似,但是它们的语法有些不同。 需要指定输出类型,例如本示例中大括号前面的Unit

On a more theoretical level, functions are generalizations of methods. That’s because methods are always a part of a class. Functions can be part of a class but don’t need to; if they happen to be part of one, they’re called methods instead.

从理论上讲,功能是方法的概括 。 这是因为方法始终是类的一部分。 函数可以是类的一部分,但不需要; 如果它们恰好是其中一部分,则它们称为方法。

类和对象 (Classes and objects)

Classes are defined as follows (this I directly copied from the Tour of Scala):

类的定义如下(这是我直接从Scala之行复制的):

class Greeter(prefix: String, suffix: String) {    def greet(name: String): Unit =         println(prefix + name + suffix) }

Then I can define an instance of that class in the following way:

然后,我可以通过以下方式定义该类的实例:

val GreetMe3 = new Greeter("Hello, ", "!") GreetMe.greet("Rhea")

Calling the method greet in the class is done in the same way that you’d do it in Python or in other languages.

调用类中的greet方法的方式与使用Python或其他语言进行调用的方式相同。

Objects in Scala are instances of their own definitions:

Scala中的对象是它们自己的定义的实例:

object HowManyGreets {    private var counter = 0    def greet(): Int = {        counter += 1        counter    }}

Unlike classes, they can’t take any parameters. They do return things, though, when you call their methods:

与类不同,它们不能接受任何参数。 但是,当您调用其方法时,它们确实会返回东西:

val onegreet: Int = HowManyGreets.greet()println(onegreet)    // outputs 1val twogreets: Int = HowManyGreets.greet()println(twogreets)    // outputs 2

放在一起 (Putting it all together)

There’s one special object, the main method, that is the entry point of every Scala program. This is similar to Python, Java, or C and C++, where you’ll come across the main method, too.

有一个特殊的对象,即main方法,它是每个Scala程序的入口点。 这类似于Python,Java或C和C ++,在这里您还将遇到main方法。

So let’s write a main method that can greet me:

因此,让我们写一个可以问候我的主要方法:

object Main {  def main(name: String): Unit =    println("Hello, "+ name + "!")}val greettheworld: Unit = Main.main("World")    // Hello, World!

Perfect! If you’d be working on your command line or IDE, you’d save this piece as Hello.scala. Then you’d compile and execute it like this (the $ indicates that this is happening in your shell):

完善! 如果要在命令行或IDE上工作,请将Hello.scala另存为Hello.scala 。 然后,您将像这样编译并执行它( $表示这是在您的shell中发生的):

$ scalac Hello.scala$ scala Hello

Congratulations! Not only have you understood how to write your first little program in Scala. You’ve also gained some background knowledge about the concepts that constitute this program.

恭喜你! 您不仅了解如何在Scala中编写第一个小程序。 您还获得了有关构成该程序的概念的一些背景知识。

DISRUPTIVO on DISRUPTIVO摄于UnsplashUnsplash

在Scala中获得功能:高阶函数和嵌套方法 (Getting functional in Scala: higher-order functions and nested methods)

We’ve already encountered a few basic concepts of functional programming in Scala, for example, immutable variables and anonymous functions. Other phenomena that occur quite often in functional programming are functions that take or return other functions, and methods that are defined inside one another.

我们已经在Scala中遇到了一些函数式编程的基本概念,例如,不可变变量和匿名函数。 在函数式编程中经常发生的其他现象是采用或返回其他函数的函数,以及在内部定义的方法。

These things are possible to do in object-oriented programming, too. But in functional programming, they arise naturally and occur quite often. In object-oriented programming, these phenomena are somewhat rare encounters.

这些事情也可以在面向对象的编程中完成。 但是在函数式编程中,它们自然而然地出现并且经常发生。 在面向对象的编程中,这些现象很少见。

高阶函数 (Higher-order functions)

Say you’re doing similar operations over and over again. Often it’s easier to define a function that does everything these operations have in common, and sub-functions that do whatever is different in each operation.

假设您要一遍又一遍地执行类似的操作。 通常,定义一个函数可以执行这些操作共有的所有功能,而子函数则可以更轻松地定义每个操作的不同之处。

For example, let’s say we’re trying to perform different operations on a list. Maybe we’d like to add 2 to each element, or we’d like to square each element. You could write one function, calcAnything, that performs any calculation on a function. Then you write different functions for adding 2 or squaring the elements:

例如,假设我们正在尝试对列表执行不同的操作。 也许我们想为每个元素加2,或者我们想对每个元素求平方。 您可以编写一个函数calcAnything ,该函数可以对一个函数执行任何计算。 然后编写不同的函数以添加2或平方元素:

object CalcSomething {private def calcAnything(numberslist: List[Double], calcFunction:     Double => Double): List[Double] =    numberslist.map(calcFunction)def add2(numberslist: List[Double]): List[Double] =    calcAnything(numberslist, number => number + 2)def square(numberslist: List[Double]): List[Double] =    calcAnything(numberslist, number => number * number)}

The map function inside calcAnything takes care that the operation takes place on the list. We can call these functions like before:

calcAnything内部的map函数会确保操作在列表上进行。 我们可以像以前一样调用这些函数:

val newList = List(1.2, 4.5, 3.6)val squared: List[Double] = CalcSomething.square(newList)println(squared)    // output: List(1.44, 20.25, 12.96)val plustwo: List[Double] = CalcSomething.add2(newList)println(plustwo)    // output: List(3.2, 6.5, 5.6)

Note that when plustwo gets executed, the operation gets performed on the list as it was defined in the beginning. That’s a direct consequence of functional programming: variables like val are immutable. If you wanted to apply these operations sequentially, you’d need to use squared as an argument of add2.

请注意,当执行plustwo时,将对列表执行开头定义的操作。 这是函数式编程的直接结果:像val这样的变量是不可变的。 如果要顺序应用这些操作,则需要使用squared作为add2的参数。

Likewise, we can define functions that return other functions. There’s a neat example in the Scala Docs if you’re interested in digging deeper. For the sake of brevity, I won’t further elaborate on it here.

同样,我们可以定义返回其他函数的函数。 如果您想深入研究, Scala Docs中有一个简洁的示例。 为了简洁起见,在此不再赘述。

嵌套方法 (Nested methods)

Like in many other languages, you can define functions inside one another. One neat example would be to calculate the sum of all integers up to a particular number:

与许多其他语言一样,您可以在内部定义函数。 一个很好的例子是计算不超过一个特定数字的所有整数的和:

def bigSum(x: Int): Int = {    def sum(x: Int, summator: Int): Int = {        if (x < 1) summator        else sum(x - 1, x + summator)    }      sum(x, 0)}println("Sum of 0 to 8: " + bigSum(8))    // outputs 36println("Sum of 0 to 100: " + bigSum(100))     // outputs 5050println("Sum of 0 to 0: " + bigSum(0))    // outputs 0

You can verify this with the Gaussian sum formula: The sum of any sequence of integers up to an integer n is S = n⋆(n-1)/2.

您可以使用高斯和公式来验证这一点:直到整数n的任何整数序列的和为S =n⋆(n-1)/ 2

在Scala中获得面向对象的知识:类,副作用等 (Getting object-oriented in Scala: classes, side-effects, and more)

If you know Java, Python, C++, or another major programming language, it’s unlikely that you haven’t heard of object-oriented programming. And I’m sure that throughout this piece you’ve recognized some concepts!

如果您知道Java,Python,C ++或其他主要编程语言,那么您不太可能没有听说过面向对象的编程。 而且我敢肯定,在整个文章中,您已经认识到一些概念!

Starting with the main method which carries the prefix object, all the way to classes and methods within classes, the basic constituents of object-oriented programming are all present in Scala. Side-effects, i.e., arguments of functions that weren’t explicitly declared, are also easy to implement: for example, it’s possible to define a function without any arguments — but technically, every function needs some kind of argument, even if it’s just self!

从带有前缀object的main方法开始,一直到类以及类中的方法,Scala中都存在面向对象编程的基本组成部分。 副作用,即未明确声明的函数的参数,也很容易实现:例如,可以定义一个不带任何参数的函数,但是从技术上讲,每个函数都需要某种类型的参数,即使它只是self

If you’re a dedicated functional programmer, the only object-oriented thing that you won’t get around is the main method. But if your comfort zone is in the realm of what’s object-oriented, you’ll be covered, too.

如果您是一个专门的函数式程序员,那么唯一无法解决的面向对象的事情就是main方法。 但是,如果您的舒适区处于面向对象的领域,那么您也将获得覆盖。

是什么让Scala在其他语言中脱颖而出 (What makes Scala stand out from other languages)

Most popular programming languages of today started out object-oriented, and are now integrating more and more features of functional programming as demand is rising. Think of Python, Java, or Perl for more context. Scala, on the other hand, has been poised to integrate both from day one.

当今,大多数流行的编程语言都是从面向对象开始的,并且随着需求的增长,它们正在集成越来越多的功能编程功能。 考虑使用Python , Java或Perl以获得更多上下文。 另一方面,Scala已准备从第一天开始将两者整合。

It’s not the only language that started out as a mix of programming paradigms. Go, for example, also makes use of many different ones. The makeup and simplicity of Go makes it amazing for microservices, systems architecture, and such problems.

它不是唯一一种混合了编程范例的语言。 例如,Go还利用了许多不同的功能。 该化妆围棋和简单性使得它惊人的微服务,系统架构,和这样的问题。

On the other end of the spectrum is Rust: as a language, it’s harder to learn than Scala, and much harder to learn than Go. Like Scala and Go, it mixes paradigms, but it also has some unique features of its own. Learning all that means that you could easily take two weeks before you’re productive.

另一方面是Rust :作为一种语言,它比Scala难学,比Go难学。 像Scala和Go一样,它混合了范式,但它也具有一些独特的功能。 学习所有这些意味着您可以轻松地花两周时间才能提高工作效率。

Rust is used for many of the same problems as Scala, i.e., big data processing, machine learning, parallel programming, and more. But if you want to get productive quickly and not get too inundated with heavy jargon (or have you ever heard of monoids, arity, or foldables?), Scala might be the better option.

Rust用于与Scala相同的许多问题,例如大数据处理,机器学习,并行编程等。 但是,如果您想快速地提高生产力,而又不想被繁杂的行话淹没(或者您听说过monoid,arity或可折叠产品吗?),Scala可能是更好的选择。

If you’re not scared away from mathematically loaded jargon and other peculiarities, then Rust is also worth a go. This applies in particular if you plan to keep going in functional programming in the long term. For beginners in functional programming, however, I’d recommend Scala.

如果您不害怕数学上的行话和其他特性,那么Rust也值得一试。 如果您打算长期进行函数式编程,则尤其如此。 但是,对于函数式编程的初学者,我建议使用Scala。

Learning new languages together with others can be particularly encouraging. Photo by Brooke Cagle on Unsplash
与其他人一起学习新语言会特别令人鼓舞。 Brooke Cagle在Unsplash上拍摄的照片

在哪里了解更多 (Where to learn more)

If this article motivated you to download Scala and try it for yourself, the getting started page of Scala is where you need to go.

如果本文促使您下载Scala并自己尝试,则需要前往Scala 入门页面。

Scala comes with rather excellent documentation. The site also provides you with some nice online resources that are worth checking out.

Scala随附了非常出色的文档。 该网站还为您提供了一些不错的在线资源 ,值得一试。

If you’re a hands-on learner (I know I am), then these two tutorials are worth checking out. For a more structured approach and lots of neat examples, check out the Tour of Scala. And for a deeper dive, check out the Scala Book.

如果您是动手学习者(我知道我是),那么这两个 教程值得一试。 有关更结构化的方法和许多简洁的示例,请查看“ Scala之行” 。 要进行更深入的了解,请查看Scala Book 。

底线:Scala可能对您的职业生涯来说不仅仅有利可图 (The bottom line: Scala might be more than lucrative for your career)

If you up your game in Scala, that could result in a serious boost in terms of salary. But that’s only one side of it all.

如果您在Scala中进行游戏,这可能会严重提高薪水。 但这仅是全部。

Scala provides you with enough object-oriented programming that you’ll feel like you’re on familiar ground. At the same time, it’s an excellent way to get to know functional programming at your own pace.

Scala为您提供了足够的面向对象编程,使您仿佛置身于熟悉的领域。 同时,这是一种以您自己的节奏了解函数式编程的绝妙方法。

Functional programming is excellent for anything big data, machine learning, and the like. And demand for those areas isn’t stalling anytime soon.

函数式编程非常适合任何大数据,机器学习等。 对这些区域的需求不会很快停止。

It’s uncertain whether Scala is the one language that will dominate functional programming. I’d rather treat Scala as a stepstone to learning the concepts of an extremely important programming paradigm.

尚不确定Scala是否是将在函数式编程中占主导地位的一种语言。 我宁愿将Scala视为学习极其重要的编程范例概念的基石。

Whether you stick with Scala, go back to Python or Java and add more functional snippets to your code, or whether you move on to more complex languages like Rust — that’s entirely up to you. Even if you don’t stick with Scala, it just might be your door-opener to getting to grips with functional programming.

无论您是坚持使用Scala,还是回到Python或Java并在代码中添加更多功能片段,还是继续使用更复杂的语言(例如Rust),这完全取决于您。 即使您不坚持使用Scala,也可能只是您开始使用函数式编程的大门。

翻译自: https://towardsdatascience.com/want-to-get-started-in-functional-programming-enter-scala-ea71e5cfe5f8

scala函数式编程


http://www.taodudu.cc/news/show-3400834.html

相关文章:

  • 总结过去展望未来_未来的发生速度将比过去快得多
  • 响应式网页设计_响应式网页设计的意义和目的
  • English trip V1 - 6.Accidents Happen! 发生意外! Teacher:Corrine Key: 过去进行时 was or were + Ving...
  • 一般过去时
  • 人工智能 AI
  • 科技创新公司跑步去香港上市应该知道的一二三四五六七八
  • 2017医疗大数据与人工智能报告
  • 2016中国人工智能企业TOP100, CBinsight2016年100家人工智能公司
  • [笔记]深澜校园网无法打开(弹出)登陆网页解决方案
  • 某大学计算机接入中国教育和,关于我校校园网正式接入中国教育和科研计算机网的公告...
  • 禁止连接校园网(特别是软件拨号上网如:Netkeeper)后弹出认证网页
  • 西安电子科技大学 校外接入 查询文献
  • 西安电子科技大学启智校园行活动
  • 西电校园网路由策略
  • 西电计算机考研历年分数线,西电历年考研分数线
  • 西安电子科技大学MSP 3月校园活动总结
  • 西电网络赛 - A
  • 校园网DDNS
  • 基于GIS的校园公交车管理系统设计(西安电子科技大学GIS课程大作业)
  • 西安服务器虚拟化,西安电子科技大学数据中心服务器虚拟化建设实践
  • 【Windows】电脑成功连接网络却无法上网?
  • Ubuntu 命令行连接校园网
  • 校园网自动pppoe拨号+Web认证
  • 【Ubuntu】开启ssh服务/配置ftp内网穿透/自动连接校园网
  • 开机自动登录校园网(西安电子科技大学)
  • 解决西电校园网若干问题
  • 试试看
  • 浏览器地震
  • 显示器屏幕抖动原因汇总
  • javascript动态网页制作

scala函数式编程_想要开始进行函数式编程,请进入scala相关推荐

  1. java8 函数式编程_如何使用Java 8函数式编程生成字母序列

    java8 函数式编程 我偶然发现了用户" mip"一个有趣的堆栈溢出问题 . 问题是: 我正在寻找一种生成字母序列的方法: A, B, C, ..., Z, AA, AB, AC ...

  2. python成为金融编程_想做金融矿工,会写Python和C++就够了吗?

    "对 Quant 而言 Python 的需求高吗,除 C++ 外还有哪些流行的编程语言?">>更多FRM 相关问题点我咨询 1. 高 2. 还有:Python, Jav ...

  3. java元编程_一文读懂元编程

    元编程(Metaprogramming)是编写.操纵程序的程序,简而言之即为用代码生成代码.元编程是一种编程范式,在传统的编程范式中,程序运行是动态的,但程序本身是静态的.在元编程中,两者都是动态的[ ...

  4. python 核心编程_【02】Python核心编程 (全)

    一.浅拷贝和深拷贝 1.浅拷贝 是对于一个对象的顶层拷贝,通俗的理解是:拷贝了引用,并没有拷贝内容.相当于把变量里面指向的一个地址给了另一个变量就是浅拷贝,而没有创建一个新的对象,如a=b. 2.深拷 ...

  5. 机械臂编程_建立自己的机械臂-编程

    机械臂编程 现在,手臂已经组装好了,是时候将其提升到一个新的水平. 现在是释放野兽并完全控制整个机器人手臂的时候了. 在这篇文章的结尾,您应该对如何对该机械臂进行编程以完成您想要的事情有一个想法. 要 ...

  6. python怎么开始编程_如何开始第一个 Python 编程实践项目?

    导语:上期我们谈了谈如何高效的入门 Python 编程,了解了 Python 的编程环境以及常用的包,如 Pandas.Matplotlib.Numpy 等.这次我们将以实践项目的形式,帮助大家快速的 ...

  7. python 小孩学编程_让小孩学Python语言编程有意义吗?

    当然有! python现在可是公认的主流语言好吗,如果小孩子的时候就能写的一手好的python代码.相信我,清华北大你大胆地冲! 不过,不建议孩子太小的时候就开始接触python,没学会走就打算跑了? ...

  8. python实现gui编程_怎样用Python3实现GUI编程?

    目前来说,大部分用python实现GUI开发,主要是tkinter,wxPython,PyQt这3个包,如果你只是实现一个小型的桌面GUI应用,做个小型系统的话,tkinter和wxPython完全就 ...

  9. 树莓派 学习编程_为什么要学习在树莓派上编程

    树莓派 学习编程 In this article "Java vs Python - Which Programming Language Should Programmer Learn F ...

最新文章

  1. rtmp协议封装h264与h265打包flv发送
  2. linux vim编译命令行,LINUX VIM编译器常用命令总结
  3. 中国数据库OceanBase登顶之路
  4. mac上的Android虚拟机,android虚拟机能在retina MacBook pro上跑吗?
  5. 2020定额招投标报价评审办法及案例分享交流会圆满结束
  6. 开发悬赏平台APP心得
  7. 计算机网络管理员中级试题及解析,计算机网络管理员中级考试题及答案(一)(1)...
  8. Android 最常用的设计模式十 安卓源码分析——策略模式(Strategy)
  9. PM2.5数据的清洗,汇总与制作散点图(含源数据链接)
  10. 在64位win10中开启64位ie浏览器的方法(IE11)
  11. 多媒体音箱选购指南--理论篇
  12. 【VUE项目实战】51、商品添加功能(一)
  13. layui table表格中加input 日期插件
  14. 2019第十届蓝桥杯大赛软件类省赛C++ B组真题题解
  15. 嵌入式存储设备学习笔记
  16. VRP_SA-模拟退火
  17. 东辉职校计算机专业录取分数线,2016年上海东辉职校录取分数
  18. 如何使用python实现简单爬取网页数据并导入MySQL中的数据库
  19. 【具体实现过程】百度地图POI区域的边界经纬度坐标数据采集
  20. 为什么说“去中心化”是互联网的未来?

热门文章

  1. 关于在react项目中img标签src的路径问题
  2. 简历制作-优秀网站集合
  3. 教你批量查询韵达快递物流并分析出包含提前签收的单号
  4. [札记]开源中最好的Web开发资源汇总
  5. Ubuntu 16.04 安装 ta-lib
  6. 盈建科内楼板局部荷载的导荷计算
  7. 【go】异常,字符串操作,文件处理
  8. 机器学习应届面试会问到的面试问题汇总
  9. 小生不才:tensorflow实战01-基于bp神经网络的手写数字识别
  10. 如果要卸载office2003可以通过二种方法来解决