mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-10-13 15:06:24 +08:00
Fix typos (#654)
This commit is contained in:
parent
cb6f8b63cf
commit
e16c8a5dab
14 changed files with 17 additions and 17 deletions
|
@ -108,7 +108,7 @@ defmodule Livebook.Evaluator do
|
||||||
end
|
end
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
Fetches an evalutaion context from another `Evaluator` process
|
Fetches an evaluation context from another `Evaluator` process
|
||||||
and configures it as the initial context for this evaluator.
|
and configures it as the initial context for this evaluator.
|
||||||
|
|
||||||
The process dictionary is also copied to match the given evaluator.
|
The process dictionary is also copied to match the given evaluator.
|
||||||
|
|
|
@ -8,7 +8,7 @@ defmodule Livebook.Intellisense.IdentifierMatcher do
|
||||||
# This functionality is a basic building block to be
|
# This functionality is a basic building block to be
|
||||||
# used for code completion and information extraction.
|
# used for code completion and information extraction.
|
||||||
#
|
#
|
||||||
# The implementation is based primarly on `IEx.Autocomplete`.
|
# The implementation is based primarily on `IEx.Autocomplete`.
|
||||||
# It also takes insights from `ElixirSense.Providers.Suggestion.Complete`,
|
# It also takes insights from `ElixirSense.Providers.Suggestion.Complete`,
|
||||||
# which is a very extensive implementation used in the
|
# which is a very extensive implementation used in the
|
||||||
# Elixir Language Server.
|
# Elixir Language Server.
|
||||||
|
@ -962,7 +962,7 @@ defmodule Livebook.Intellisense.IdentifierMatcher do
|
||||||
`do` would always be a keyword.
|
`do` would always be a keyword.
|
||||||
|
|
||||||
The `position` contains both the `line` and `column`, both starting
|
The `position` contains both the `line` and `column`, both starting
|
||||||
with the index of 1. The column must preceed the surrounding expression.
|
with the index of 1. The column must precede the surrounding expression.
|
||||||
For example, the expression `foo`, will return something for the columns
|
For example, the expression `foo`, will return something for the columns
|
||||||
1, 2, and 3, but not 4:
|
1, 2, and 3, but not 4:
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ defmodule Livebook.JSInterop do
|
||||||
@doc """
|
@doc """
|
||||||
Returns the result of applying `delta` to `string`.
|
Returns the result of applying `delta` to `string`.
|
||||||
|
|
||||||
The delta operation lenghts (retain, delete) are treated
|
The delta operation lengths (retain, delete) are treated
|
||||||
such that they match the JavaScript strings behavior.
|
such that they match the JavaScript strings behavior.
|
||||||
|
|
||||||
JavaScript uses UTF-16 encoding, in which every character is stored
|
JavaScript uses UTF-16 encoding, in which every character is stored
|
||||||
|
|
|
@ -118,7 +118,7 @@ defmodule Livebook.Notebook.Cell.Input do
|
||||||
end
|
end
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
Converts inpu type to string.
|
Converts input type to string.
|
||||||
"""
|
"""
|
||||||
@spec type_to_string(type()) :: String.t()
|
@spec type_to_string(type()) :: String.t()
|
||||||
def type_to_string(type) do
|
def type_to_string(type) do
|
||||||
|
|
|
@ -251,7 +251,7 @@ mutated the list. We can break a list apart or add new elements to the
|
||||||
head, but the original list is never modified.
|
head, but the original list is never modified.
|
||||||
|
|
||||||
That said, when we need to keep some sort of state, like the data
|
That said, when we need to keep some sort of state, like the data
|
||||||
transfering through a portal, we must use an abstraction that stores
|
transferring through a portal, we must use an abstraction that stores
|
||||||
this state for us. One such abstraction in Elixir is called an agent.
|
this state for us. One such abstraction in Elixir is called an agent.
|
||||||
Before we use agents, we need to briefly talk about anonymous functions.
|
Before we use agents, we need to briefly talk about anonymous functions.
|
||||||
|
|
||||||
|
|
|
@ -411,7 +411,7 @@ Nx.subtract(tensor, 1)
|
||||||
|
|
||||||
This result is possible because Nx broadcasts _both tensors_
|
This result is possible because Nx broadcasts _both tensors_
|
||||||
in `subtract/2` to compatible shapes. That means you can provide
|
in `subtract/2` to compatible shapes. That means you can provide
|
||||||
scalar values as either arugment:
|
scalar values as either argument:
|
||||||
|
|
||||||
```elixir
|
```elixir
|
||||||
Nx.subtract(10, tensor)
|
Nx.subtract(10, tensor)
|
||||||
|
@ -580,7 +580,7 @@ The last major feature we'll cover is called auto-differentiation, or autograd.
|
||||||
|
|
||||||
An important mathematical property for a function is the
|
An important mathematical property for a function is the
|
||||||
rate of change, or the gradient. These gradients are critical
|
rate of change, or the gradient. These gradients are critical
|
||||||
for solving systems of equations and building probablistic
|
for solving systems of equations and building probabilistic
|
||||||
models. In advanced math, derivatives, or differential equations,
|
models. In advanced math, derivatives, or differential equations,
|
||||||
are used to take gradients. Nx can compute these derivatives
|
are used to take gradients. Nx can compute these derivatives
|
||||||
automatically through a feature called automatic differentiation,
|
automatically through a feature called automatic differentiation,
|
||||||
|
|
|
@ -134,7 +134,7 @@ end)
|
||||||
```
|
```
|
||||||
|
|
||||||
Now go to [the dashboard](/dashboard) and check out the select
|
Now go to [the dashboard](/dashboard) and check out the select
|
||||||
in the upper right corner. If the connection was successfull, you
|
in the upper right corner. If the connection was successful, you
|
||||||
should be able to pick the desired node and see its details.
|
should be able to pick the desired node and see its details.
|
||||||
|
|
||||||
## Inspecting processes
|
## Inspecting processes
|
||||||
|
@ -178,7 +178,7 @@ we actually care about the resulting value of `Process.list/0`!
|
||||||
|
|
||||||
We could still use `Node.spawn/2` to send us the results, which
|
We could still use `Node.spawn/2` to send us the results, which
|
||||||
we would `receive`, but doing that over and over can be quite tedious.
|
we would `receive`, but doing that over and over can be quite tedious.
|
||||||
Fortunatelly, `:rpc.call/4` does essentially that - evaluates the given
|
Fortunately, `:rpc.call/4` does essentially that - evaluates the given
|
||||||
function on the remote node and returns its result.
|
function on the remote node and returns its result.
|
||||||
|
|
||||||
Now, let's gather more information about each process 🕵️
|
Now, let's gather more information about each process 🕵️
|
||||||
|
|
|
@ -20,7 +20,7 @@ defmodule Livebook.Runtime.ErlDist.IOForwardGL do
|
||||||
|
|
||||||
## Options
|
## Options
|
||||||
|
|
||||||
* `:name` - the name to regsiter the process under. Optional.
|
* `:name` - the name to register the process under. Optional.
|
||||||
If the name is already used, it will be unregistered before
|
If the name is already used, it will be unregistered before
|
||||||
starting the process and registered back when the server
|
starting the process and registered back when the server
|
||||||
terminates.
|
terminates.
|
||||||
|
|
|
@ -6,7 +6,7 @@ defmodule Livebook.Runtime.ErlDist.LoggerGLBackend do
|
||||||
#
|
#
|
||||||
# The backend is based on `Logger.Backends.Console`,
|
# The backend is based on `Logger.Backends.Console`,
|
||||||
# but instead of logging to the console, it sends
|
# but instead of logging to the console, it sends
|
||||||
# log output to the group leader of the soruce process,
|
# log output to the group leader of the source process,
|
||||||
# provided the group leader is an instance of
|
# provided the group leader is an instance of
|
||||||
# `Livebook.Evaluator.IOProxy`.
|
# `Livebook.Evaluator.IOProxy`.
|
||||||
#
|
#
|
||||||
|
|
|
@ -35,7 +35,7 @@ defmodule Livebook.Runtime.NodePool do
|
||||||
end
|
end
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
Retuns a node name.
|
Returns a node name.
|
||||||
|
|
||||||
Generates a new name if pool is empty, or takes one from pool.
|
Generates a new name if pool is empty, or takes one from pool.
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -857,7 +857,7 @@ defmodule Livebook.Session.Data do
|
||||||
Enum.any?(data.section_infos, fn {_section_id, info} -> info.evaluation_queue != [] end)
|
Enum.any?(data.section_infos, fn {_section_id, info} -> info.evaluation_queue != [] end)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Don't tigger evaluation if we don't have a runtime started yet
|
# Don't trigger evaluation if we don't have a runtime started yet
|
||||||
defp maybe_evaluate_queued({%{runtime: nil}, _} = data_actions), do: data_actions
|
defp maybe_evaluate_queued({%{runtime: nil}, _} = data_actions), do: data_actions
|
||||||
|
|
||||||
defp maybe_evaluate_queued({data, _} = data_actions) do
|
defp maybe_evaluate_queued({data, _} = data_actions) do
|
||||||
|
|
|
@ -31,7 +31,7 @@ defmodule LivebookWeb.Endpoint do
|
||||||
from: "tmp/static_dev"
|
from: "tmp/static_dev"
|
||||||
end
|
end
|
||||||
|
|
||||||
# Serve static failes at "/"
|
# Serve static files at "/"
|
||||||
|
|
||||||
if code_reloading? do
|
if code_reloading? do
|
||||||
# In development we use assets from tmp/static_dev (rebuilt dynamically on every change).
|
# In development we use assets from tmp/static_dev (rebuilt dynamically on every change).
|
||||||
|
|
|
@ -1283,7 +1283,7 @@ defmodule LivebookWeb.SessionLive do
|
||||||
end
|
end
|
||||||
|
|
||||||
# Changes that affect only a single cell are still likely to
|
# Changes that affect only a single cell are still likely to
|
||||||
# have impact on dirtyness, so we need to always mirror it
|
# have impact on dirtiness, so we need to always mirror it
|
||||||
defp update_dirty_status(data_view, data) do
|
defp update_dirty_status(data_view, data) do
|
||||||
put_in(data_view.dirty, data.dirty)
|
put_in(data_view.dirty, data.dirty)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
defmodule LivebookWeb.SessionLive.PersistenceLive do
|
defmodule LivebookWeb.SessionLive.PersistenceLive do
|
||||||
# TODO: rewrite this live view as a component, once live_view
|
# TODO: rewrite this live view as a component, once live_view
|
||||||
# has a unified way of sending events programatically from a child
|
# has a unified way of sending events programmatically from a child
|
||||||
# component to parent live view or component. Currently we send an
|
# component to parent live view or component. Currently we send an
|
||||||
# event to self() from FileSelectComponent and use handle_info in
|
# event to self() from FileSelectComponent and use handle_info in
|
||||||
# the parent live view.
|
# the parent live view.
|
||||||
|
|
Loading…
Add table
Reference in a new issue