diff --git a/guide/chinese/algorithms/flood-fill/index.md b/guide/chinese/algorithms/flood-fill/index.md index 0ef0d4bf1a..337be2cac9 100644 --- a/guide/chinese/algorithms/flood-fill/index.md +++ b/guide/chinese/algorithms/flood-fill/index.md @@ -27,7 +27,7 @@ localeTitle: 洪水填充算法 有关更多详细信息,请参阅此处描述该函数的代码: -```c++ +```cpp int wall = -1; void flood_fill(int pos_x, int pos_y, int target_color, int color) @@ -80,7 +80,7 @@ int wall = -1; 您有以下输入: -```c++ +```cpp 2 4 4 0 0 0 1 0 0 1 1 diff --git a/guide/chinese/algorithms/lee-algorithm/index.md b/guide/chinese/algorithms/lee-algorithm/index.md index 5beb191042..9f811a179d 100644 --- a/guide/chinese/algorithms/lee-algorithm/index.md +++ b/guide/chinese/algorithms/lee-algorithm/index.md @@ -21,7 +21,7 @@ C ++已经在``库中实现了`` ,但如果您正在使用其他 C ++代码: -```c++ +```cpp int dl[] = {-1, 0, 1, 0}; // these arrays will help you travel in the 4 directions more easily int dc[] = {0, 1, 0, -1}; diff --git a/guide/chinese/algorithms/search-algorithms/binary-search/index.md b/guide/chinese/algorithms/search-algorithms/binary-search/index.md index 0d5ad5cc93..ef1545258f 100644 --- a/guide/chinese/algorithms/search-algorithms/binary-search/index.md +++ b/guide/chinese/algorithms/search-algorithms/binary-search/index.md @@ -174,7 +174,7 @@ int binarySearch(int a[], int l, int r, int x) { ### C / C ++实现 -```C++ +```cpp int binary_search(int arr[], int l, int r, int target) { if (r >= l) @@ -208,7 +208,7 @@ def binary_search(arr, l, r, target): ### C ++中的示例 -```c++ +```cpp // Binary Search using iteration int binary_search(int arr[], int beg, int end, int num) { @@ -225,7 +225,7 @@ def binary_search(arr, l, r, target): } ``` -```c++ +```cpp // Binary Search using recursion int binary_search(int arr[], int beg, int end, int num) { diff --git a/guide/chinese/algorithms/search-algorithms/linear-search/index.md b/guide/chinese/algorithms/search-algorithms/linear-search/index.md index b43af25f17..83a451dc41 100644 --- a/guide/chinese/algorithms/search-algorithms/linear-search/index.md +++ b/guide/chinese/algorithms/search-algorithms/linear-search/index.md @@ -75,7 +75,7 @@ def linear_search(target, array) ### C ++中的示例 -```c++ +```cpp int linear_search(int arr[],int n,int num) { for(int i=0;i using namespace std; void heapify(int arr[], int n, int i) diff --git a/guide/chinese/algorithms/sorting-algorithms/insertion-sort/index.md b/guide/chinese/algorithms/sorting-algorithms/insertion-sort/index.md index c6cfb84208..fdf8ff4509 100644 --- a/guide/chinese/algorithms/sorting-algorithms/insertion-sort/index.md +++ b/guide/chinese/algorithms/sorting-algorithms/insertion-sort/index.md @@ -92,7 +92,7 @@ localeTitle: 插入排序 以下算法是略微优化的版本,以避免在每次迭代中交换`key`元素。这里, `key`元素将在迭代结束时交换(步骤)。 -```Algorithm +``` InsertionSort(arr[]) for j = 1 to arr.length key = arr[j] diff --git a/guide/chinese/algorithms/sorting-algorithms/merge-sort/index.md b/guide/chinese/algorithms/sorting-algorithms/merge-sort/index.md index 3e9828620c..d26ff527e8 100644 --- a/guide/chinese/algorithms/sorting-algorithms/merge-sort/index.md +++ b/guide/chinese/algorithms/sorting-algorithms/merge-sort/index.md @@ -23,7 +23,7 @@ T(n) = 2T(n/2) + n 计算结尾总和中n的重复次数,我们看到它们有lg n + 1。因此运行时间是n(lg n + 1)= n lg n + n。我们观察到,对于n> 0,n lg n + n l: 1. Find the middle point to divide the array into two halves: diff --git a/guide/chinese/c/math/index.md b/guide/chinese/c/math/index.md index da7d87420f..da25d6b992 100644 --- a/guide/chinese/c/math/index.md +++ b/guide/chinese/c/math/index.md @@ -132,7 +132,8 @@ double result = 23.0 / 2; C提供了一个数学库( `math.h` ),它提供了许多有用的数学函数。例如,数字的幂可以计算为: -```#include +```c +#include int result = pow(2,3) // will result in 2*2*2 or 8 ``` diff --git a/guide/chinese/certifications/apis-and-microservices/basic-node-and-express/use-body-parser-to-parse-post-requests/index.md b/guide/chinese/certifications/apis-and-microservices/basic-node-and-express/use-body-parser-to-parse-post-requests/index.md index 788561796e..df0a79760e 100644 --- a/guide/chinese/certifications/apis-and-microservices/basic-node-and-express/use-body-parser-to-parse-post-requests/index.md +++ b/guide/chinese/certifications/apis-and-microservices/basic-node-and-express/use-body-parser-to-parse-post-requests/index.md @@ -6,7 +6,7 @@ localeTitle: 使用body-parser来解析POST请求 如果您使用提供的样板,则应该已经将身体解析器添加到您的项目中,但如果不是,它应该在那里: -```code +```json "dependencies": { "body-parser": "^1.4.3", ... diff --git a/guide/chinese/certifications/front-end-libraries/react/change-inline-css-conditionally-based-on-component-state/index.md b/guide/chinese/certifications/front-end-libraries/react/change-inline-css-conditionally-based-on-component-state/index.md index 6240bb35cd..4740958352 100644 --- a/guide/chinese/certifications/front-end-libraries/react/change-inline-css-conditionally-based-on-component-state/index.md +++ b/guide/chinese/certifications/front-end-libraries/react/change-inline-css-conditionally-based-on-component-state/index.md @@ -58,7 +58,7 @@ class GateKeeper extends React.Component { 编写根据您的状态计算的条件语句,如质询描述中所述,检查输入的长度并将新对象分配给inputStyle变量。 -```react.js +```jsx if (this.state.input.length > 15) { inputStyle = { border: '3px solid red' diff --git a/guide/chinese/certifications/front-end-libraries/react/create-a-controlled-form/index.md b/guide/chinese/certifications/front-end-libraries/react/create-a-controlled-form/index.md index 71305123f0..7210a8eaaa 100644 --- a/guide/chinese/certifications/front-end-libraries/react/create-a-controlled-form/index.md +++ b/guide/chinese/certifications/front-end-libraries/react/create-a-controlled-form/index.md @@ -10,13 +10,13 @@ localeTitle: 创建受控表格 ### 解 -```react.js +```jsx ``` 接下来,为组件创建handleSubmit方法。首先,因为您的表单正在提交,您必须阻止页面刷新。其次,调用`setState()`方法,传入要更改的不同键值对的对象。在这种情况下,您希望将“submit”设置为变量“input”的值,并将“input”设置为空字符串。 -```react.js +```jsx handleSubmit(event) { event.preventDefault(); this.setState({ diff --git a/guide/chinese/certifications/front-end-libraries/react/give-sibling-elements-a-unique-key-attribute/index.md b/guide/chinese/certifications/front-end-libraries/react/give-sibling-elements-a-unique-key-attribute/index.md index 682af4904f..0082d69adf 100644 --- a/guide/chinese/certifications/front-end-libraries/react/give-sibling-elements-a-unique-key-attribute/index.md +++ b/guide/chinese/certifications/front-end-libraries/react/give-sibling-elements-a-unique-key-attribute/index.md @@ -12,7 +12,7 @@ localeTitle: 为兄弟元素提供唯一的键属性 只需将`key`属性添加到`
  • `标记即可使其唯一 -```react.js +```jsx const renderFrameworks = frontEndFrameworks.map((item) =>
  • {item}
  • ); diff --git a/guide/chinese/certifications/front-end-libraries/react/introducing-inline-styles/index.md b/guide/chinese/certifications/front-end-libraries/react/introducing-inline-styles/index.md index 969c889632..a629c4dfaf 100644 --- a/guide/chinese/certifications/front-end-libraries/react/introducing-inline-styles/index.md +++ b/guide/chinese/certifications/front-end-libraries/react/introducing-inline-styles/index.md @@ -10,7 +10,7 @@ localeTitle: 介绍内联样式 让我们逐步了解这些步骤,以便您了解其中的差异。 首先将样式标记设置为**JavaScript对象** 。 -```react.js +```jsx class Colorful extends React.Component { render() { return ( @@ -26,7 +26,7 @@ class Colorful extends React.Component { 其次,让我们将颜色设置为红色。 -```react.js +```jsx class Colorful extends React.Component { render() { return ( @@ -42,7 +42,7 @@ class Colorful extends React.Component { ### 扰流板 -```react.js +```jsx class Colorful extends React.Component { render() { return ( diff --git a/guide/chinese/certifications/front-end-libraries/react/override-default-props/index.md b/guide/chinese/certifications/front-end-libraries/react/override-default-props/index.md index 33875ffe9f..e22c2943fc 100644 --- a/guide/chinese/certifications/front-end-libraries/react/override-default-props/index.md +++ b/guide/chinese/certifications/front-end-libraries/react/override-default-props/index.md @@ -6,7 +6,7 @@ localeTitle: 覆盖默认道具 此挑战使您可以覆盖Items组件的props `quantity`的默认值。其中, `quantity`默认值设置为`0` 。 -```react.js +```jsx const Items = (props) => { return

    Current Quantity of Items in Cart: {props.quantity}

    } @@ -18,13 +18,13 @@ const Items = (props) => { 要覆盖默认的props值,要遵循的语法是 -```react.js +```jsx ``` 在语法之后,应在给定代码下面声明以下代码 -```react.js +```jsx ``` diff --git a/guide/chinese/certifications/front-end-libraries/react/render-conditionally-from-props/index.md b/guide/chinese/certifications/front-end-libraries/react/render-conditionally-from-props/index.md index 12c593600a..527150b76c 100644 --- a/guide/chinese/certifications/front-end-libraries/react/render-conditionally-from-props/index.md +++ b/guide/chinese/certifications/front-end-libraries/react/render-conditionally-from-props/index.md @@ -10,7 +10,7 @@ localeTitle: 从道具有条理地渲染 使用适当的增量声明更改`handleClick()` 。 -```react.js +```jsx handleClick() { this.setState({ counter: this.state.counter + 1 @@ -20,7 +20,7 @@ handleClick() { 在`render()`方法中,使用质询描述中提到的`Math.random()`并编写三元表达式以在**Results**组件中传递`props` 。 -```react.js +```jsx let expression = Math.random() > .5; {(expression == 1)? : } @@ -28,7 +28,7 @@ handleClick() { 然后在Results组件中渲染`fiftyFifty`道具。 -```react.js +```jsx

    { this.props.fiftyFifty diff --git a/guide/chinese/certifications/front-end-libraries/react/render-state-in-the-user-interface/index.md b/guide/chinese/certifications/front-end-libraries/react/render-state-in-the-user-interface/index.md index 7aa90f5916..92bbb91fc0 100644 --- a/guide/chinese/certifications/front-end-libraries/react/render-state-in-the-user-interface/index.md +++ b/guide/chinese/certifications/front-end-libraries/react/render-state-in-the-user-interface/index.md @@ -12,7 +12,7 @@ localeTitle: 在用户界面中渲染状态 ## 解 -```react.js +```jsx class MyComponent extends React.Component { constructor(props) { super(props); diff --git a/guide/chinese/certifications/front-end-libraries/react/render-with-an-ifelse-condition/index.md b/guide/chinese/certifications/front-end-libraries/react/render-with-an-ifelse-condition/index.md index 7e183dccd3..c896f24acc 100644 --- a/guide/chinese/certifications/front-end-libraries/react/render-with-an-ifelse-condition/index.md +++ b/guide/chinese/certifications/front-end-libraries/react/render-with-an-ifelse-condition/index.md @@ -12,7 +12,7 @@ localeTitle: 使用If / Else条件渲染 ### 解 -```react.js +```jsx if (this.state.display === true) { return (
    @@ -25,7 +25,7 @@ if (this.state.display === true) { 接下来,创建一个else语句,返回**不带** `h1`元素的相同JSX。 -```react.js +```jsx else { return (
    diff --git a/guide/chinese/certifications/front-end-libraries/react/use-a-ternary-expression-for-conditional-rendering/index.md b/guide/chinese/certifications/front-end-libraries/react/use-a-ternary-expression-for-conditional-rendering/index.md index 3d6fab4ae2..5b0bcf6b0f 100644 --- a/guide/chinese/certifications/front-end-libraries/react/use-a-ternary-expression-for-conditional-rendering/index.md +++ b/guide/chinese/certifications/front-end-libraries/react/use-a-ternary-expression-for-conditional-rendering/index.md @@ -17,7 +17,7 @@ condition ? expressionIfTrue : expressionIfFalse 这是使用三元表达的示例解决方案。 首先,您需要在构造函数中声明状态,如下所示 -```react.js +```jsx constructor(props) { super(props); // change code below this line @@ -33,7 +33,7 @@ constructor(props) { 然后是三元运算符 -```react.js +```jsx { /* change code here */ (this.state.userAge >= 18) ? buttonTwo : (this.state.userAge== '')? buttonOne: buttonThree diff --git a/guide/chinese/certifications/front-end-libraries/react/use-proptypes-to-define-the-props-you-expect/index.md b/guide/chinese/certifications/front-end-libraries/react/use-proptypes-to-define-the-props-you-expect/index.md index c2b780ac24..79fde5cf0e 100644 --- a/guide/chinese/certifications/front-end-libraries/react/use-proptypes-to-define-the-props-you-expect/index.md +++ b/guide/chinese/certifications/front-end-libraries/react/use-proptypes-to-define-the-props-you-expect/index.md @@ -6,7 +6,7 @@ localeTitle: 使用PropTypes定义您期望的道具 您可以通过此挑战为`Items`组件设置`propTypes` 。 -```react.js +```jsx const Items = (props) => { return

    Current Quantity of Items in Cart: {props.quantity}

    }; @@ -14,7 +14,7 @@ const Items = (props) => { 要设置propTypes,要遵循的语法是 -```react.js +```jsx itemName.propTypes = { props: PropTypes.dataType.isRequired }; @@ -22,7 +22,7 @@ itemName.propTypes = { 在语法之后,应该在`Items`组件的`quantity`道具的给定代码下面设置以下代码 -```react.js +```jsx Items.propTypes = { quantity: PropTypes.number.isRequired }; diff --git a/guide/chinese/certifications/front-end-libraries/redux/define-a-redux-action/index.md b/guide/chinese/certifications/front-end-libraries/redux/define-a-redux-action/index.md index 1de6b4f093..1e88d1afe9 100644 --- a/guide/chinese/certifications/front-end-libraries/redux/define-a-redux-action/index.md +++ b/guide/chinese/certifications/front-end-libraries/redux/define-a-redux-action/index.md @@ -6,9 +6,9 @@ localeTitle: 定义Redux动作 以下是如何声明Redux Action。 -```react.js +```js let action={ type: 'LOGIN' } -``` \ No newline at end of file +``` diff --git a/guide/chinese/certifications/front-end-libraries/redux/dispatch-an-action-event/index.md b/guide/chinese/certifications/front-end-libraries/redux/dispatch-an-action-event/index.md index 910e8817e5..a69969ca77 100644 --- a/guide/chinese/certifications/front-end-libraries/redux/dispatch-an-action-event/index.md +++ b/guide/chinese/certifications/front-end-libraries/redux/dispatch-an-action-event/index.md @@ -6,7 +6,7 @@ localeTitle: 派遣行动事件 通过调用dispatch方法将LOGIN操作发送到Redux存储,并传入`loginAction()`创建的操作。 -```react.js +```js store.dispatch(loginAction()); -``` \ No newline at end of file +``` diff --git a/guide/chinese/certifications/front-end-libraries/redux/get-state-from-the-redux-store/index.md b/guide/chinese/certifications/front-end-libraries/redux/get-state-from-the-redux-store/index.md index 2957e0551a..5f4e28da33 100644 --- a/guide/chinese/certifications/front-end-libraries/redux/get-state-from-the-redux-store/index.md +++ b/guide/chinese/certifications/front-end-libraries/redux/get-state-from-the-redux-store/index.md @@ -6,7 +6,7 @@ localeTitle: 从Redux商店获取状态 使用`getState()`方法从存储中检索数据。 -```react.js +```js let currentState = store.getState(); -``` \ No newline at end of file +``` diff --git a/guide/chinese/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-a-literal-string-with-different-possibilities/index.md b/guide/chinese/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-a-literal-string-with-different-possibilities/index.md index 1b2380d86b..93a06de98c 100644 --- a/guide/chinese/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-a-literal-string-with-different-possibilities/index.md +++ b/guide/chinese/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-a-literal-string-with-different-possibilities/index.md @@ -14,7 +14,7 @@ localeTitle: 匹配具有不同可能性的文字字符串 ## 解: -```javascriot +```js let petString = "James has a pet cat."; let petRegex = /dog|cat|bird|fish/; let result = petRegex.test(petString); diff --git a/guide/chinese/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-single-characters-not-specified/index.md b/guide/chinese/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-single-characters-not-specified/index.md index be34409120..7780c2250a 100644 --- a/guide/chinese/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-single-characters-not-specified/index.md +++ b/guide/chinese/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-single-characters-not-specified/index.md @@ -24,7 +24,7 @@ let exampleRegExp = /[^az]/; 一定要检查你的号码范围是否正确 - 挑战要求我们否定0-99之间的所有数字。这可以使用在正则表达式的第一个开始括号后立即放置的否定插入符来完成。 -```javacsript +```js let numbersRegExp = /[^0-99]/ig; ``` diff --git a/guide/chinese/computer-science/data-structures/stacks/index.md b/guide/chinese/computer-science/data-structures/stacks/index.md index 0d32d81bcf..97b6302de3 100644 --- a/guide/chinese/computer-science/data-structures/stacks/index.md +++ b/guide/chinese/computer-science/data-structures/stacks/index.md @@ -17,7 +17,7 @@ localeTitle: 堆栈 使用数组或链表可以实现堆栈。以下是具有最常见操作的堆栈数据结构的简单数组实现。 -```C++ +```cpp //Stack implementation using array in C++ //You can also include and then use the C++ STL Library stack class. diff --git a/guide/chinese/containers/docker/creating-a-new-container/index.md b/guide/chinese/containers/docker/creating-a-new-container/index.md index 4f8504fc2e..8471e6179d 100644 --- a/guide/chinese/containers/docker/creating-a-new-container/index.md +++ b/guide/chinese/containers/docker/creating-a-new-container/index.md @@ -12,7 +12,7 @@ docker create [OPTIONS] IMAGE [COMMAND] [ARG...] 创建并启动容器 -```sh +```shell $ docker create -t -i fedora bash ``` \ No newline at end of file diff --git a/guide/chinese/cplusplus/arrays/index.md b/guide/chinese/cplusplus/arrays/index.md index 0d1b542ffd..0325bd47f1 100644 --- a/guide/chinese/cplusplus/arrays/index.md +++ b/guide/chinese/cplusplus/arrays/index.md @@ -8,13 +8,13 @@ localeTitle: C ++数组 例如,包含5个称为数字的整数值的数组声明如下: -```C++ +```cpp int numbers [5]; ``` Initializiation: -```C++ +```cpp //Initialization with entries: int numbers [5] = {1, 2, 3, 4, 5}; @@ -34,7 +34,7 @@ Initializiation: 可以通过引用它们在数组中的位置来访问数组中的元素。 (从0开始计数)。 例: -```C++ +```cpp x = numbers[0]; // = 1. [0] == first position numbers[2] = 55; // Sets the third position (3) to the new number 55 //numbers[] is now: {1, 2, 55, 4, 5} diff --git a/guide/chinese/cplusplus/for-loop/index.md b/guide/chinese/cplusplus/for-loop/index.md index 01ffe9ca67..d351b771ea 100644 --- a/guide/chinese/cplusplus/for-loop/index.md +++ b/guide/chinese/cplusplus/for-loop/index.md @@ -37,7 +37,7 @@ update语句用于通过使用加法,减法,乘法或除法等简单操作 ## 实现: -```C++ +```cpp #include using namespace std; // Here we use the scope resolution operator to define the scope of the standar functions as std:: diff --git a/guide/chinese/cplusplus/input-and-output/index.md b/guide/chinese/cplusplus/input-and-output/index.md index 12b0a04b86..2039341db4 100644 --- a/guide/chinese/cplusplus/input-and-output/index.md +++ b/guide/chinese/cplusplus/input-and-output/index.md @@ -10,7 +10,7 @@ localeTitle: 输入和输出 “Hello World”程序使用`cout`打印“Hello World!”到控制台: -```C++ +```cpp #include using namespace std; @@ -30,24 +30,24 @@ localeTitle: 输入和输出 几乎所有东西都可以放入一个流:字符串,数字,变量,表达式等。这里有一些有效的流插入示例: -```C++ +```cpp // Notice we can use the number 42 and not the string "42". cout << "The meaning of life is " << 42 << endl;` // Output: The meaning of life is 42 ``` -```C++ +```cpp string name = "Tim"; cout << "Except for you, " << name << endl;`// Output: Except for you, Tim ``` -```C++ +```cpp string name = "Tim"; cout << name; cout << " is a great guy!" << endl;` // Output: Tim is a great guy! ``` -```C++ +```cpp int a = 3; cout << a*2 + 18/a << endl;`// Output: 12 ``` @@ -56,7 +56,7 @@ int a = 3; C ++总是让_你_掌控,并且只完成你告诉它要做的事情。这有时会令人惊讶,如下例所示: -```C++ +```cpp string name = "Sarah"; cout << "Good morning" << name << "how are you today? << endl; ``` @@ -65,7 +65,7 @@ string name = "Sarah"; 换行也不会自己发生。你可能会认为这会在四行打印一个食谱: -```C++ +```cpp cout << "To make bread, you need:"; cout << "* One egg"; cout << "* One water"; @@ -76,7 +76,7 @@ cout << "To make bread, you need:"; 您可以通过在每行之后添加`endl`来解决此问题,因为如前所述, `endl`在换行流中插入换行符。但是,它也会强制冲洗缓冲区,这会让我们失去一点性能,因为我们可以一次打印所有的线条。因此,最好的方法是在行尾添加实际的换行符,并且最后只使用`endl` : -```C++ +```cpp cout << "To make bread, you need:\n"; cout << "* One egg\n"; cout << "* One water\n"; @@ -89,7 +89,7 @@ cout << "To make bread, you need:\n"; 要从控制台中读取,您可以像使用`cout`一样使用_输入流_ `cin` ,但不要将内容放入`cin` ,而是“将它们取出”。以下程序从用户读取两个数字并将它们加在一起: -```C++ +```cpp #include using namespace std; @@ -112,7 +112,7 @@ cout << "To make bread, you need:\n"; 提取运算符`<<`也可以链接。这是与上次相同的程序,但是以更简洁的方式编写: -```C++ +```cpp #include using namespace std; diff --git a/guide/chinese/cplusplus/map/index.md b/guide/chinese/cplusplus/map/index.md index 3c9564d3d9..be16cf257a 100644 --- a/guide/chinese/cplusplus/map/index.md +++ b/guide/chinese/cplusplus/map/index.md @@ -16,7 +16,7 @@ localeTitle: 地图 这是一个例子: -```c++ +```cpp #include #include @@ -56,7 +56,7 @@ a => 10 使用插入成员函数插入数据。 -```c++ +```cpp myMap.insert(make_pair("earth", 1)); myMap.insert(make_pair("moon", 2)); ``` @@ -69,7 +69,7 @@ myMap.insert(make_pair("earth", 1)); 要访问地图元素,您必须为它创建迭代器。这是前面提到的一个例子。 -```c++ +```cpp map::iterator it; for(it=first.begin(); it!=first.end(); ++it){ cout << it->first << " => " << it->second << '\n'; diff --git a/guide/chinese/cplusplus/terms-to-know-for-beginners/index.md b/guide/chinese/cplusplus/terms-to-know-for-beginners/index.md index 24b311b664..be46e77d5c 100644 --- a/guide/chinese/cplusplus/terms-to-know-for-beginners/index.md +++ b/guide/chinese/cplusplus/terms-to-know-for-beginners/index.md @@ -1,7 +1,8 @@ ---- -title: IDE and Printing different text -localeTitle: IDE和打印不同的文本 ---- # IDE简介和打印不同的文本: +--- +title: IDE and Printing different text +localeTitle: IDE和打印不同的文本 +--- +# IDE简介和打印不同的文本: * 在上一篇文章中,有一些编程所需软件的下载链接。像这样的软件被称为IDE。 **IDE代表集成开发环境** @@ -33,8 +34,7 @@ _问:尝试在Google上搜索IDE并在其上运行您的第一个程序。检 ``` 上面的代码返回一个错误,因为在第2行,我们使用了冒号(:)而不是分号(;) 那么,让我们调试错误: - -```C++ +```cpp #include using namespace std ; int main() @@ -139,4 +139,4 @@ Hello World! I love freeCodeCamp! `cpp (7!=5);` 评估结果为true -[本文中使用的所有打印语句的总和。随意调整代码! :)](https://repl.it/L4ox) \ No newline at end of file +[本文中使用的所有打印语句的总和。随意调整代码! :)](https://repl.it/L4ox) diff --git a/guide/chinese/cplusplus/while-loop/index.md b/guide/chinese/cplusplus/while-loop/index.md index 5bd100f220..cdfe92e050 100644 --- a/guide/chinese/cplusplus/while-loop/index.md +++ b/guide/chinese/cplusplus/while-loop/index.md @@ -10,7 +10,7 @@ while循环的一个关键点是循环可能永远不会运行。 当测试条 例: -```C++ +```cpp #include using namespace std; diff --git a/guide/chinese/csharp/for/index.md b/guide/chinese/csharp/for/index.md index 31054f608d..cf17adeff6 100644 --- a/guide/chinese/csharp/for/index.md +++ b/guide/chinese/csharp/for/index.md @@ -8,7 +8,7 @@ localeTitle: 对于循环 ## 句法 -```C# +```csharp for ((Initial variable); (condition); (step)) { (code) @@ -25,7 +25,7 @@ C#for循环由三个表达式和一些代码组成。 ## 例 -```C# +```csharp int[] array = { 1, 2, 3, 4, 5 }; for (int i = 0; i < array.Length; i++) { diff --git a/guide/chinese/csharp/foreach/index.md b/guide/chinese/csharp/foreach/index.md index ab044baf26..ec55104996 100644 --- a/guide/chinese/csharp/foreach/index.md +++ b/guide/chinese/csharp/foreach/index.md @@ -24,7 +24,7 @@ foreach (element in iterable-item) ### 输出: -```sh +```shell > We have Jim > We have Jane > We have Jack diff --git a/guide/chinese/csharp/hello-world/index.md b/guide/chinese/csharp/hello-world/index.md index dbacac8739..7164115136 100644 --- a/guide/chinese/csharp/hello-world/index.md +++ b/guide/chinese/csharp/hello-world/index.md @@ -1,7 +1,8 @@ ---- -title: Hello World -localeTitle: 你好,世界 ---- # 你好,世界 +--- +title: Hello World +localeTitle: 你好,世界 +--- +# 你好,世界 要在控制台上编写一些文本,我们使用`Console.WriteLine()` 。此方法将字符串作为输入。 @@ -28,9 +29,8 @@ using System; ``` ## 输出: - -```sh +```shell > Hello World! > Press any key to exit. -``` \ No newline at end of file +``` diff --git a/guide/chinese/csharp/null-coalescing-operator/index.md b/guide/chinese/csharp/null-coalescing-operator/index.md index 0becfc3b16..13a60540c9 100644 --- a/guide/chinese/csharp/null-coalescing-operator/index.md +++ b/guide/chinese/csharp/null-coalescing-operator/index.md @@ -10,7 +10,7 @@ C#中的null-coalescing运算符用于帮助将一个变量分配给另一个 由于`name`为`null` , `clientName`将为`clientName`分配值“John Doe”。 -```cs +```csharp string name = null; string clientName = name ?? "John Doe"; @@ -18,7 +18,7 @@ string name = null; Console.WriteLine(clientName); ``` -```cs +```csharp > John Doe ``` @@ -26,7 +26,7 @@ string name = null; 由于`name`不为`null` , `clientName`将为`clientName`分配`name`的值,即“Jane Smith”。 -```cs +```csharp string name = "Jane Smith"; string clientName = name ?? "John Doe"; @@ -34,7 +34,7 @@ string name = "Jane Smith"; Console.WriteLine(clientName); ``` -```cs +```csharp > Jane Smith ``` @@ -42,7 +42,7 @@ string name = "Jane Smith"; 您可以使用`if...else`语句来测试是否存在`null`并分配不同的值。 -```cs +```csharp string clientName; if (name != null) @@ -53,7 +53,7 @@ string clientName; 但是,使用null-coalescing运算符可以大大简化这一点。 -```cs +```csharp string clientName = name ?? "John Doe"; ``` @@ -61,13 +61,13 @@ string clientName = name ?? "John Doe"; 也可以使用条件运算符来测试`null`的存在并分配不同的值。 -```cs +```csharp string clientName = name != null ? name : "John Doe"; ``` 同样,这可以使用null-coalescing运算符进行简化。 -```cs +```csharp string clientName = name ?? "John Doe"; ``` diff --git a/guide/chinese/csharp/xaml/index.md b/guide/chinese/csharp/xaml/index.md index b382cc14dd..bf1823b8ff 100644 --- a/guide/chinese/csharp/xaml/index.md +++ b/guide/chinese/csharp/xaml/index.md @@ -26,7 +26,7 @@ Silverlight,移动开发,WPF(Windows Presentation Foindation),Windows 以下示例显示了带有“Hello World!”的标签。作为其顶级容器中的内容,称为UserControl。 -```XAML +```xml diff --git a/guide/chinese/css/breakpoints/index.md b/guide/chinese/css/breakpoints/index.md index 7175b1d645..cece4163a7 100644 --- a/guide/chinese/css/breakpoints/index.md +++ b/guide/chinese/css/breakpoints/index.md @@ -174,7 +174,7 @@ CSS断点可以被认为是响应式网页设计的核心,因为它们定义 您还可以设置最小和最大宽度,让您使用不同的范围进行实验。这个大致触发了smar-phone和更大的桌面和显示器尺寸 -```code +```css @media only screen and (min-width: 700px) and (max-width: 1500px) { something { something: something; diff --git a/guide/chinese/go/installing-go/arch-linux/index.md b/guide/chinese/go/installing-go/arch-linux/index.md index a42b8e7c02..a57114c061 100644 --- a/guide/chinese/go/installing-go/arch-linux/index.md +++ b/guide/chinese/go/installing-go/arch-linux/index.md @@ -6,7 +6,7 @@ localeTitle: 使用pacman在Arch Linux中安装Go 使用Arch Linux Package Manager(pacman)是安装Go的最简单方法。基于Arch Linux非常快速地提供新软件版本的理念,您将获得最新版本的go。 在安装go软件包之前,必须使系统保持最新状态。 -```sh +```shell $ sudo pacman -Syu $ sudo pacman -S go ``` @@ -15,7 +15,7 @@ $ sudo pacman -Syu 要检查go是否已成功安装,请使用: -```sh +```shell $ go version > go version go2.11.1 linux/amd64 ``` diff --git a/guide/chinese/go/installing-go/mac-package-installer/index.md b/guide/chinese/go/installing-go/mac-package-installer/index.md index 7b55ce0922..b5df118378 100644 --- a/guide/chinese/go/installing-go/mac-package-installer/index.md +++ b/guide/chinese/go/installing-go/mac-package-installer/index.md @@ -12,7 +12,7 @@ localeTitle: 使用Package Installer在Mac OS X中安装Go 要检查是否已成功安装,请打开终端并使用: -```sh +```shell $ go version ``` diff --git a/guide/chinese/go/installing-go/mac-tarball/index.md b/guide/chinese/go/installing-go/mac-tarball/index.md index f9a086e76f..8319132c03 100644 --- a/guide/chinese/go/installing-go/mac-tarball/index.md +++ b/guide/chinese/go/installing-go/mac-tarball/index.md @@ -25,7 +25,7 @@ $ curl -O https://storage.googleapis.com/golang/go1.9.1.darwin-amd64.tar.gz 要检查go是否已成功安装,请使用: -```sh +```shell $ go version ``` diff --git a/guide/chinese/go/installing-go/ubuntu-apt-get/index.md b/guide/chinese/go/installing-go/ubuntu-apt-get/index.md index 2fb9e79487..a14f23fa2c 100644 --- a/guide/chinese/go/installing-go/ubuntu-apt-get/index.md +++ b/guide/chinese/go/installing-go/ubuntu-apt-get/index.md @@ -8,7 +8,7 @@ localeTitle: 使用apt-get在Ubuntu中安装Go > 在撰写本文时,Ubuntu Xenial的版本是1.6.1,而最新版本 稳定版本是1.9.1 -```sh +```shell $ sudo apt-get update $ sudo apt-get install golang-go ``` @@ -17,7 +17,7 @@ $ sudo apt-get update 要检查go是否已成功安装,请使用: -```sh +```shell $ go version > go version go1.9.1 linux/amd64 ``` diff --git a/guide/chinese/go/installing-go/ubuntu-tarball/index.md b/guide/chinese/go/installing-go/ubuntu-tarball/index.md index 6c2b4865cc..f1457367a6 100644 --- a/guide/chinese/go/installing-go/ubuntu-tarball/index.md +++ b/guide/chinese/go/installing-go/ubuntu-tarball/index.md @@ -10,7 +10,7 @@ localeTitle: 使用tarball在Ubuntu中安装Go 在继续之前,请确保您知道您的系统是32位还是64位。如果您不知道,请运行以下命令以查找: -```sh +```shell $ lscpu | grep Architecture ``` @@ -52,7 +52,7 @@ $ wget https://storage.googleapis.com/golang/go1.9.1.linux-386.tar.gz 要检查go是否已成功安装,请使用: -```sh +```shell $ go version > go version go1.9.1 linux/amd64 ``` diff --git a/guide/chinese/javascript/with/index.md b/guide/chinese/javascript/with/index.md index a276931bd1..d7452446b5 100644 --- a/guide/chinese/javascript/with/index.md +++ b/guide/chinese/javascript/with/index.md @@ -10,7 +10,7 @@ JavaScript的`with`语句是在一个对象上编辑多个属性的简便方法 ### 句法 -```syntax +```js with (expression) statement ``` diff --git a/guide/chinese/linux/basic-linux-commands/index.md b/guide/chinese/linux/basic-linux-commands/index.md index 681c288624..c1bd8f5688 100644 --- a/guide/chinese/linux/basic-linux-commands/index.md +++ b/guide/chinese/linux/basic-linux-commands/index.md @@ -63,7 +63,7 @@ localeTitle: 基本Linux命令 15. **grep** - grep搜索任何给定的输入文件,选择与一个或多个模式匹配的行。 - 使用`grep`查找文件,目录,文件/目录中的一些文本。 **例子:** -```sh +```shell $ ps ax | grep -w login 25291 s000 Ss 0:00.11 login -pf 25467 s000 R+ 0:00.00 grep -w login diff --git a/guide/chinese/linux/getting-started/index.md b/guide/chinese/linux/getting-started/index.md index 42f2790472..f4d24aac0e 100644 --- a/guide/chinese/linux/getting-started/index.md +++ b/guide/chinese/linux/getting-started/index.md @@ -22,7 +22,7 @@ Linux的终端不用担心,实际上它很容易使用一些练习,它可以 cd(更改目录) - cd命令是您在linux命令行中使用最多的命令之一。它允许您更改工作目录。您可以使用它在文件系统的层次结构中移动。 -```unix +```shell cd ``` @@ -30,7 +30,7 @@ cd ls(List) - 该命令列出当前目录中的内容。它还可以用于列出文件信息。 -```unix +```shell ls ``` diff --git a/guide/chinese/linux/how-to-use-sftp-to-securely-transfer-files-with-a-remote-server/index.md b/guide/chinese/linux/how-to-use-sftp-to-securely-transfer-files-with-a-remote-server/index.md index 3f9fa988e3..175999dd8a 100644 --- a/guide/chinese/linux/how-to-use-sftp-to-securely-transfer-files-with-a-remote-server/index.md +++ b/guide/chinese/linux/how-to-use-sftp-to-securely-transfer-files-with-a-remote-server/index.md @@ -10,7 +10,7 @@ localeTitle: 如何使用SFTP通过远程服务器安全地传输文件 如果您还没有,请测试您是否能够SSH到服务器。 SFTP使用Secure Shell(SSH)协议,因此如果您无法通过SSH,您可能也无法使用SFTP。 -```unix +```shell ssh your_username@hostname_or_ip_address ``` @@ -18,13 +18,13 @@ ssh your_username@hostname_or_ip_address 它使用与SSH相同的语法,并打开一个可以传输文件的会话。 -```unix +```shell sftp your_username@hostname_or_ip_address ``` 要列出有用的命令: -```unix +```shell help ``` @@ -32,19 +32,19 @@ help 要下载文件: -```unix +```shell get ``` 要下载文件夹及其内容,请使用“-r”标志(也可用于上载): -```unix +```shell get -r ``` 要上传文件: -```unix +```shell put ``` @@ -52,13 +52,13 @@ put 要更改本地文件夹: -```unix +```shell lcd ``` 要更改远程文件夹: -```unix +```shell cd ``` \ No newline at end of file diff --git a/guide/chinese/linux/setting-up-yum-repositories-in-redhat-linux/index.md b/guide/chinese/linux/setting-up-yum-repositories-in-redhat-linux/index.md index cff93eca92..461990ed8b 100644 --- a/guide/chinese/linux/setting-up-yum-repositories-in-redhat-linux/index.md +++ b/guide/chinese/linux/setting-up-yum-repositories-in-redhat-linux/index.md @@ -10,7 +10,7 @@ RPM包文件是Red Hat Package Manager文件,可以在Red Hat / CentOS Linux 第1步:检查是否存在现有存储库。 -```sh +```shell #yum repolist ``` @@ -18,19 +18,19 @@ RPM包文件是Red Hat Package Manager文件,可以在Red Hat / CentOS Linux 第2步:将目录更改为 -```sh +```shell #cd /etc/yum.repos.d ``` 第3步:创建新文件 -```sh +```shell #vim myrepo.repo ``` 第4步:在文件中键入以下行 -```sh +```shell [file-name] name=filename baseurl="location of yum repositories" @@ -41,7 +41,7 @@ RPM包文件是Red Hat Package Manager文件,可以在Red Hat / CentOS Linux 第6步:重复步骤1 -```sh +```shell You Will find repositories ``` \ No newline at end of file diff --git a/guide/chinese/linux/the-anatomy-of-the-linux-command-line/index.md b/guide/chinese/linux/the-anatomy-of-the-linux-command-line/index.md index 7375a00d70..4d63e12756 100644 --- a/guide/chinese/linux/the-anatomy-of-the-linux-command-line/index.md +++ b/guide/chinese/linux/the-anatomy-of-the-linux-command-line/index.md @@ -14,7 +14,7 @@ localeTitle: Linux命令行的剖析 要开始使用打开终端(对于Ubuntu只需按住Ctrl + Alt + T),你会受到以这种格式排列的一系列字符的欢迎; -```linux +```shell user_name@machine_name:~$ ``` diff --git a/guide/chinese/nodejs/index.md b/guide/chinese/nodejs/index.md index 384b5fa573..a940c204d2 100644 --- a/guide/chinese/nodejs/index.md +++ b/guide/chinese/nodejs/index.md @@ -32,7 +32,7 @@ import time **Node.js的** -```node +```js function my_io_task() { setTimeout(function() { console.log('done'); diff --git a/guide/chinese/php/loops/for-loop/index.md b/guide/chinese/php/loops/for-loop/index.md index cb74335051..8720ffad59 100644 --- a/guide/chinese/php/loops/for-loop/index.md +++ b/guide/chinese/php/loops/for-loop/index.md @@ -52,7 +52,7 @@ For循环通常用于计算一定数量的迭代以重复语句。 这将输出: -```txt +```shell int(1) int(2) int(3) NULL ``` diff --git a/guide/chinese/python/python-coding-standards/index.md b/guide/chinese/python/python-coding-standards/index.md index 2c8a1f9857..311a790410 100644 --- a/guide/chinese/python/python-coding-standards/index.md +++ b/guide/chinese/python/python-coding-standards/index.md @@ -22,7 +22,7 @@ localeTitle: 编码标准 这是你如何检查你的python代码是否符合他的标准。 -```console +```shell :~$ pip install pep8 :~$ pep8 --first myCode.py ``` diff --git a/guide/chinese/react/what-are-react-props/index.md b/guide/chinese/react/what-are-react-props/index.md index 7be524fda8..49dc5b8ebd 100644 --- a/guide/chinese/react/what-are-react-props/index.md +++ b/guide/chinese/react/what-are-react-props/index.md @@ -12,7 +12,7 @@ localeTitle: 使用PropTypes进行React TypeChecking 为了使用它,需要通过在控制台中发出以下命令将其作为依赖项添加到项目中。 -```sh +```shell npm install --save prop-types ``` diff --git a/guide/chinese/redux/tutorial/index.md b/guide/chinese/redux/tutorial/index.md index f05cf1ac64..fc1d92a7a7 100644 --- a/guide/chinese/redux/tutorial/index.md +++ b/guide/chinese/redux/tutorial/index.md @@ -1,7 +1,8 @@ ---- -title: React Redux Basic Setup -localeTitle: React Redux Basic Setup ---- ## React Redux Basic Setup +--- +title: React Redux Basic Setup +localeTitle: React Redux Basic Setup +--- +## React Redux Basic Setup 在本指南中,将向读者介绍如何设置简单的React和Redux应用程序。 @@ -12,8 +13,7 @@ localeTitle: React Redux Basic Setup 假设所有设置都正常并且正常工作,则需要添加一些软件包才能使Redux与React一起工作。 在已创建的项目文件夹中打开一个终端并发出以下命令 - -```sh +```shell npm install --save react react react-dom react-redux react-router redux ``` @@ -277,4 +277,4 @@ export defaultStoreStore( 例 ); \`\`\` 上面的代码演示了如何定义 [Redux Api](http://redux.js.org/docs/api/) -[Redux示例](https://github.com/reactjs/redux/tree/master/examples) \ No newline at end of file +[Redux示例](https://github.com/reactjs/redux/tree/master/examples) diff --git a/guide/chinese/rust/installing-rust/index.md b/guide/chinese/rust/installing-rust/index.md index b132882de8..b221645b92 100644 --- a/guide/chinese/rust/installing-rust/index.md +++ b/guide/chinese/rust/installing-rust/index.md @@ -1,7 +1,8 @@ ---- -title: Installing Rust -localeTitle: 安装Rust ---- # 安装Rust +--- +title: Installing Rust +localeTitle: 安装Rust +--- +# 安装Rust 使用`rustup`是Rust安装的首选。 `rustup`为您的系统安装和管理Rust。 @@ -12,8 +13,7 @@ localeTitle: 安装Rust ## 在其他操作系统中安装Rust(Mac OS X,Linux,BSD,Unix) 打开终端并输入以下命令: - -```sh +```shell curl https://sh.rustup.rs -sSf | sh ``` @@ -22,8 +22,7 @@ curl https://sh.rustup.rs -sSf | sh # 验证安装 安装`rustup`将安装与rust相关的所有内容,但最重要的是这意味着安装编译器和包管理器。要验证是否已安装所有内容,请运行以下命令: - -```sh +```shell cargo version ``` @@ -31,4 +30,4 @@ cargo version # 更多信息 -要了解有关安装过程的更多信息,请访问 https://www.rust-lang.org/en-US/install.html \ No newline at end of file +要了解有关安装过程的更多信息,请访问 https://www.rust-lang.org/en-US/install.html diff --git a/guide/chinese/software-engineering/design-patterns/singleton/index.md b/guide/chinese/software-engineering/design-patterns/singleton/index.md index 1ae54ff189..792a880e30 100644 --- a/guide/chinese/software-engineering/design-patterns/singleton/index.md +++ b/guide/chinese/software-engineering/design-patterns/singleton/index.md @@ -126,7 +126,7 @@ obj_0 = MyClass() ## iOS中的Singleton -```Swift4 +```swift class Singleton { static let sharedInstance = Singleton() diff --git a/guide/english/algorithms/flood-fill/index.md b/guide/english/algorithms/flood-fill/index.md index 141ab1b73d..4fad56db59 100644 --- a/guide/english/algorithms/flood-fill/index.md +++ b/guide/english/algorithms/flood-fill/index.md @@ -29,7 +29,7 @@ The red square is the starting point and the gray squares are the so called wall For further details, here's a piece of code describing the function: -```c++ +```cpp int wall = -1; @@ -89,7 +89,7 @@ to island x. **Ex:** You have the following input: -```c++ +```cpp 2 4 4 0 0 0 1 0 0 1 1 diff --git a/guide/english/algorithms/lee-algorithm/index.md b/guide/english/algorithms/lee-algorithm/index.md index 448880ec27..7092e6cf2c 100644 --- a/guide/english/algorithms/lee-algorithm/index.md +++ b/guide/english/algorithms/lee-algorithm/index.md @@ -23,7 +23,7 @@ your own version of queue. C++ code: -```c++ +```cpp int dl[] = {-1, 0, 1, 0}; // these arrays will help you travel in the 4 directions more easily int dc[] = {0, 1, 0, -1}; diff --git a/guide/english/algorithms/search-algorithms/binary-search/index.md b/guide/english/algorithms/search-algorithms/binary-search/index.md index 2aac7acfa8..5132929422 100644 --- a/guide/english/algorithms/search-algorithms/binary-search/index.md +++ b/guide/english/algorithms/search-algorithms/binary-search/index.md @@ -200,7 +200,7 @@ def binary_search(arr, l, r, target): Recursive approach! -```C++ - +```cpp // Recursive approach in C++ int binarySearch(int arr[], int start, int end, int x) { @@ -221,7 +221,7 @@ int binarySearch(int arr[], int start, int end, int x) Iterative approach! -```C++ +```cpp int binarySearch(int arr[], int start, int end, int x) { while (start <= end) diff --git a/guide/english/algorithms/search-algorithms/linear-search/index.md b/guide/english/algorithms/search-algorithms/linear-search/index.md index 9f0b3eba90..437f762b75 100644 --- a/guide/english/algorithms/search-algorithms/linear-search/index.md +++ b/guide/english/algorithms/search-algorithms/linear-search/index.md @@ -88,7 +88,7 @@ end ``` ### Example in C++ -```c++ +```cpp int linear_search(int arr[],int n,int num) { for(int i=0;i Int? { ``` ### Example in Java -```Java 8 +```java int linearSearch(int[] arr, int element) { for(int i=0;i #define MAXCHAR 256 //there are 256 ASCII characters using namespace std; diff --git a/guide/english/apache/index.md b/guide/english/apache/index.md index 5d28424bc7..c1b4b5d5db 100644 --- a/guide/english/apache/index.md +++ b/guide/english/apache/index.md @@ -66,12 +66,12 @@ The `-R` flag will cause grep to search recursively through the `/etc` directory ``` #### Start Apache -```sh +```shell sudo systemctl start httpd ``` #### Run Apache on Startup -```sh +```shell sudo systemctl enable httpd ``` @@ -96,12 +96,12 @@ If you want to host multiple domains on a single server, you can configure Virtu You can copy the `default.conf` and modify accordingly in the following directory: #### On Ubuntu: -```sh +```shell /etc/apache2/sites-enabled/ ``` #### On Centos: -```sh +```shell /etc/httpd/sites-enabled/ ``` diff --git a/guide/english/bulma/get-started/index.md b/guide/english/bulma/get-started/index.md index 46cbcc98ef..bc7c616622 100644 --- a/guide/english/bulma/get-started/index.md +++ b/guide/english/bulma/get-started/index.md @@ -10,7 +10,7 @@ There are several ways to get started with Bulma. * Use the GitHub Repository to get the latest development version. 1) Using npm -```terminal +```shell $ npm install bulma ``` 2) Use the cdnjs CDN diff --git a/guide/english/c/pointers/index.md b/guide/english/c/pointers/index.md index 034328d35b..c9367e7f22 100644 --- a/guide/english/c/pointers/index.md +++ b/guide/english/c/pointers/index.md @@ -328,7 +328,7 @@ void main() { } ``` The output becomes -```output +```shell The value of integer variable is = 10 ``` diff --git a/guide/english/certifications/apis-and-microservices/managing-packages-with-npm/add-a-license-to-your-package.json/index.md b/guide/english/certifications/apis-and-microservices/managing-packages-with-npm/add-a-license-to-your-package.json/index.md index c2c3629e23..e1d204a539 100644 --- a/guide/english/certifications/apis-and-microservices/managing-packages-with-npm/add-a-license-to-your-package.json/index.md +++ b/guide/english/certifications/apis-and-microservices/managing-packages-with-npm/add-a-license-to-your-package.json/index.md @@ -6,7 +6,7 @@ title: Add a License to Your package.json You should go over to the `package.json` file in your project. Licenses follow a similar convention as this: -```code +```json "license": "ExampleLicense" ``` diff --git a/guide/english/certifications/apis-and-microservices/managing-packages-with-npm/add-a-version-to-your-package.json/index.md b/guide/english/certifications/apis-and-microservices/managing-packages-with-npm/add-a-version-to-your-package.json/index.md index c00c040e18..6aaea95821 100644 --- a/guide/english/certifications/apis-and-microservices/managing-packages-with-npm/add-a-version-to-your-package.json/index.md +++ b/guide/english/certifications/apis-and-microservices/managing-packages-with-npm/add-a-version-to-your-package.json/index.md @@ -6,7 +6,7 @@ title: Add a Version to Your package.json You should go over to the package.json file in your project. Versions follow a similar convention as this: -```code +```json "version": "x.x.x" ``` diff --git a/guide/english/certifications/apis-and-microservices/managing-packages-with-npm/expand-your-project-with-external-packages-from-npm/index.md b/guide/english/certifications/apis-and-microservices/managing-packages-with-npm/expand-your-project-with-external-packages-from-npm/index.md index ae3b85b6ac..b59a2ad297 100644 --- a/guide/english/certifications/apis-and-microservices/managing-packages-with-npm/expand-your-project-with-external-packages-from-npm/index.md +++ b/guide/english/certifications/apis-and-microservices/managing-packages-with-npm/expand-your-project-with-external-packages-from-npm/index.md @@ -6,7 +6,7 @@ title: Expand Your Project with External Packages from npm You should go over to the `package.json` file in your project. Dependencies follow a similar convention as this: -```code +```json "dependencies": { "express": "^4.16.4", "helmet": "^3.14.0" diff --git a/guide/english/certifications/apis-and-microservices/managing-packages-with-npm/manage-npm-dependencies-by-understanding-semantic-versioning/index.md b/guide/english/certifications/apis-and-microservices/managing-packages-with-npm/manage-npm-dependencies-by-understanding-semantic-versioning/index.md index 7d3e4e5fe7..ae6fc0e232 100644 --- a/guide/english/certifications/apis-and-microservices/managing-packages-with-npm/manage-npm-dependencies-by-understanding-semantic-versioning/index.md +++ b/guide/english/certifications/apis-and-microservices/managing-packages-with-npm/manage-npm-dependencies-by-understanding-semantic-versioning/index.md @@ -6,7 +6,7 @@ title: Manage npm Dependencies By Understanding Semantic Versioning You should go over to the `package.json` file in your project. SemVer dependencies follow a similar convention like this: -```code +```json "dependencies": { "dependency1": "^major.minor.patch" }, diff --git a/guide/english/certifications/apis-and-microservices/managing-packages-with-npm/remove-a-package-from-your-dependencies/index.md b/guide/english/certifications/apis-and-microservices/managing-packages-with-npm/remove-a-package-from-your-dependencies/index.md index c54da4a808..9b46c6eecb 100644 --- a/guide/english/certifications/apis-and-microservices/managing-packages-with-npm/remove-a-package-from-your-dependencies/index.md +++ b/guide/english/certifications/apis-and-microservices/managing-packages-with-npm/remove-a-package-from-your-dependencies/index.md @@ -7,7 +7,7 @@ title: Remove a Package from Your Dependencies You should go over to the `package.json` file in your project. Removing a package is as simple as going into your dependencies section and removing the line with the corresponding item. In the following example "express" is removed from `package.json`: Before -```code +```json "dependencies": { "express": "^4.16.4", "helmet": "^3.14.0" @@ -15,7 +15,7 @@ Before ``` After -```code +```json "dependencies": { "express": "^4.16.4", }, diff --git a/guide/english/certifications/coding-interview-prep/data-structures/create-a-circular-queue/index.md b/guide/english/certifications/coding-interview-prep/data-structures/create-a-circular-queue/index.md index 2be1733d60..28e63b9eb7 100644 --- a/guide/english/certifications/coding-interview-prep/data-structures/create-a-circular-queue/index.md +++ b/guide/english/certifications/coding-interview-prep/data-structures/create-a-circular-queue/index.md @@ -10,25 +10,25 @@ title: Create a Circular Queue - The dequeue method on the other hand, moves the read pointer but doesnt exceed the write pointer. - Example: - First, we create an array of length 5: - ```output + ```shell [null, null, null, null, null] ^Read @ 0 ^Write @ 0 ``` - Then we enqueue `a`, `b`, and `c`: - ```output + ```shell [a, b, c, null, null] ^Read @ 0 ^Write @ 3 ``` - Now we dequeue all the enqueued items: - ```output + ```shell [null, null, null, null, null] ^Read @ 3 ^Write @ 3 ``` - Finally, we enqueue `d`, `e` and `f`: - ```output + ```shell [f, null, null, d, e] ^Read @ 3 ^Write @ 1 diff --git a/guide/english/certifications/front-end-libraries/react/change-inline-css-conditionally-based-on-component-state/index.md b/guide/english/certifications/front-end-libraries/react/change-inline-css-conditionally-based-on-component-state/index.md index ff61567ce7..982d9a0e00 100644 --- a/guide/english/certifications/front-end-libraries/react/change-inline-css-conditionally-based-on-component-state/index.md +++ b/guide/english/certifications/front-end-libraries/react/change-inline-css-conditionally-based-on-component-state/index.md @@ -59,7 +59,7 @@ class GateKeeper extends React.Component { ## Solution Write a conditional statement that is evaluated according to your state, as mentioned in the challenge description, checks the length of the input and assigns a new object to the inputStyle variable. -```react.js +```jsx if (this.state.input.length > 15) { inputStyle = { border: '3px solid red' diff --git a/guide/english/certifications/front-end-libraries/react/create-a-controlled-form/index.md b/guide/english/certifications/front-end-libraries/react/create-a-controlled-form/index.md index aa92ad3d8d..0e90438113 100644 --- a/guide/english/certifications/front-end-libraries/react/create-a-controlled-form/index.md +++ b/guide/english/certifications/front-end-libraries/react/create-a-controlled-form/index.md @@ -9,12 +9,12 @@ First, create a controlled input that stores its value in state, so that there i (This is what you did in the previous challenge.) Create an input element, set its value attribute to the input variable located in state. Remember, state can be accessed by `this.state`. Next, set the input element's `onChange` attribute to call the function 'handleChange'. ### Solution -```react.js +```jsx ``` Next, create the handleSubmit method for your component. First, because your form is submitting you will have to prevent the page from refreshing. Second, call the `setState()` method, passing in an object of the different key-value pairs that you want to change. In this case, you want to set 'submit' to the value of the variable 'input' and set 'input' to an empty string. -```react.js +```jsx handleSubmit(event) { event.preventDefault(); this.setState({ diff --git a/guide/english/certifications/front-end-libraries/react/give-sibling-elements-a-unique-key-attribute/index.md b/guide/english/certifications/front-end-libraries/react/give-sibling-elements-a-unique-key-attribute/index.md index 9f4225c6fa..f1e28c46db 100644 --- a/guide/english/certifications/front-end-libraries/react/give-sibling-elements-a-unique-key-attribute/index.md +++ b/guide/english/certifications/front-end-libraries/react/give-sibling-elements-a-unique-key-attribute/index.md @@ -8,7 +8,7 @@ It is just almost same as previous [challenge](https://learn.freecodecamp.org/fr ## Solution Just add `key` attribute to the `
  • ` tag to make unique -```react.js +```jsx const renderFrameworks = frontEndFrameworks.map((item) =>
  • {item}
  • ); diff --git a/guide/english/certifications/front-end-libraries/react/introducing-inline-styles/index.md b/guide/english/certifications/front-end-libraries/react/introducing-inline-styles/index.md index 29e0c57315..eb1fddbe0c 100644 --- a/guide/english/certifications/front-end-libraries/react/introducing-inline-styles/index.md +++ b/guide/english/certifications/front-end-libraries/react/introducing-inline-styles/index.md @@ -9,7 +9,7 @@ This one can be a little tricky because JSX is very similar to HTML but **NOT th Let's walkthrough the steps so that you understand the difference. First set your style tag to a **JavaScript object**. -```react.js +```jsx class Colorful extends React.Component { render() { return ( @@ -24,7 +24,7 @@ Now you have your style tag set to an empty object. Notice how there are two set Second, let's set the color to red. -```react.js +```jsx class Colorful extends React.Component { render() { return ( @@ -39,7 +39,7 @@ class Colorful extends React.Component { Finally, let's set the font size to 72px. ### Spoiler -```react.js +```jsx class Colorful extends React.Component { render() { return ( diff --git a/guide/english/certifications/front-end-libraries/react/override-default-props/index.md b/guide/english/certifications/front-end-libraries/react/override-default-props/index.md index b8319e5798..25970953a2 100644 --- a/guide/english/certifications/front-end-libraries/react/override-default-props/index.md +++ b/guide/english/certifications/front-end-libraries/react/override-default-props/index.md @@ -3,7 +3,7 @@ title: Override Default Props --- ## Override Default Props This challenge has you override the default value of props `quantity` for the Items component. Where default value of `quantity` is set to `0`. -```react.js +```jsx const Items = (props) => { return

    Current Quantity of Items in Cart: {props.quantity}

    } @@ -13,12 +13,12 @@ Items.defaultProps = { } ``` To override a default props value, the syntax to be followed is -```react.js +```jsx ``` Following the Syntax, the following code should be declared below the given code -```react.js +```jsx ``` This will override value `0` to `50` diff --git a/guide/english/certifications/front-end-libraries/react/render-conditionally-from-props/index.md b/guide/english/certifications/front-end-libraries/react/render-conditionally-from-props/index.md index 050c71a098..9b3d041015 100644 --- a/guide/english/certifications/front-end-libraries/react/render-conditionally-from-props/index.md +++ b/guide/english/certifications/front-end-libraries/react/render-conditionally-from-props/index.md @@ -7,7 +7,7 @@ This is a bit tricky challenge but easy though. ## Solution Change `handleClick()` with proper increment statement. -```react.js +```jsx handleClick() { this.setState({ counter: this.state.counter + 1 @@ -15,7 +15,7 @@ handleClick() { } ``` In `render()` method use `Math.random()` as mentioned in the challenge description and write a ternary expression to pass `props` in the **Results** component. -```react.js +```jsx let expression = Math.random() > .5; {(expression == 1)? : } @@ -23,7 +23,7 @@ In `render()` method use `Math.random()` as mentioned in the challenge descripti ``` Then render the `fiftyFifty` props in the Results component. -```react.js +```jsx

    { this.props.fiftyFifty diff --git a/guide/english/certifications/front-end-libraries/react/render-state-in-the-user-interface/index.md b/guide/english/certifications/front-end-libraries/react/render-state-in-the-user-interface/index.md index bfd26a41b8..4f44c34538 100644 --- a/guide/english/certifications/front-end-libraries/react/render-state-in-the-user-interface/index.md +++ b/guide/english/certifications/front-end-libraries/react/render-state-in-the-user-interface/index.md @@ -10,7 +10,7 @@ Just make a `

    ` tag and render `this.state.name` between tag. ## Solution -```react.js +```jsx class MyComponent extends React.Component { constructor(props) { super(props); diff --git a/guide/english/certifications/front-end-libraries/react/render-with-an-ifelse-condition/index.md b/guide/english/certifications/front-end-libraries/react/render-with-an-ifelse-condition/index.md index e39dcca21c..42e122f539 100644 --- a/guide/english/certifications/front-end-libraries/react/render-with-an-ifelse-condition/index.md +++ b/guide/english/certifications/front-end-libraries/react/render-with-an-ifelse-condition/index.md @@ -9,7 +9,7 @@ Inside of the render method of the component, write if/else statements that each First, wrap the current return method inside of an if statement and set the condition to check if the variable 'display' is true. Remember, you access state using `this.state`. ### Solution -```react.js +```jsx if (this.state.display === true) { return (
    @@ -21,7 +21,7 @@ if (this.state.display === true) { ``` Next, create an else statement that returns the same JSX **without** the `h1` element. -```react.js +```jsx else { return (
    diff --git a/guide/english/certifications/front-end-libraries/react/use-a-ternary-expression-for-conditional-rendering/index.md b/guide/english/certifications/front-end-libraries/react/use-a-ternary-expression-for-conditional-rendering/index.md index 45679ddc45..85e7e597c6 100644 --- a/guide/english/certifications/front-end-libraries/react/use-a-ternary-expression-for-conditional-rendering/index.md +++ b/guide/english/certifications/front-end-libraries/react/use-a-ternary-expression-for-conditional-rendering/index.md @@ -13,7 +13,7 @@ condition ? expressionIfTrue : expressionIfFalse Here is sample solution of using ternary expression. First you need declare state in constructor like this -```react.js +```jsx constructor(props) { super(props); // change code below this line @@ -27,7 +27,7 @@ constructor(props) { } ``` Then the ternary operator -```react.js +```jsx { /* change code here */ (this.state.userAge >= 18) ? buttonTwo : (this.state.userAge== '')? buttonOne: buttonThree diff --git a/guide/english/certifications/front-end-libraries/react/use-proptypes-to-define-the-props-you-expect/index.md b/guide/english/certifications/front-end-libraries/react/use-proptypes-to-define-the-props-you-expect/index.md index ef7646cc11..31ac3642b3 100644 --- a/guide/english/certifications/front-end-libraries/react/use-proptypes-to-define-the-props-you-expect/index.md +++ b/guide/english/certifications/front-end-libraries/react/use-proptypes-to-define-the-props-you-expect/index.md @@ -4,21 +4,21 @@ title: Use PropTypes to Define the Props You Expect ## Use PropTypes to Define the Props You Expect This challenge has you set a `propTypes` for the `Items` component. -```react.js +```jsx const Items = (props) => { return

    Current Quantity of Items in Cart: {props.quantity}

    }; ``` To set a propTypes, the syntax to be followed is -```react.js +```jsx itemName.propTypes = { props: PropTypes.dataType.isRequired }; ``` Following the Syntax, the following code should be set below the given code for the `quantity` props of `Items` component -```react.js +```jsx Items.propTypes = { quantity: PropTypes.number.isRequired }; diff --git a/guide/english/certifications/front-end-libraries/redux/define-a-redux-action/index.md b/guide/english/certifications/front-end-libraries/redux/define-a-redux-action/index.md index cd5f225007..3bbc50f546 100644 --- a/guide/english/certifications/front-end-libraries/redux/define-a-redux-action/index.md +++ b/guide/english/certifications/front-end-libraries/redux/define-a-redux-action/index.md @@ -4,7 +4,7 @@ title: Define a Redux Action ## Define a Redux Action Here is how to declare a Redux Action. -```react.js +```jsx let action={ type: 'LOGIN' } diff --git a/guide/english/certifications/front-end-libraries/redux/dispatch-an-action-event/index.md b/guide/english/certifications/front-end-libraries/redux/dispatch-an-action-event/index.md index 026e82f085..0d175c1943 100644 --- a/guide/english/certifications/front-end-libraries/redux/dispatch-an-action-event/index.md +++ b/guide/english/certifications/front-end-libraries/redux/dispatch-an-action-event/index.md @@ -5,6 +5,6 @@ title: Dispatch an Action Event Dispatch the LOGIN action to the Redux store by calling the dispatch method, and pass in the action created by `loginAction()`. -```react.js +```jsx store.dispatch(loginAction()); ``` diff --git a/guide/english/certifications/front-end-libraries/redux/get-state-from-the-redux-store/index.md b/guide/english/certifications/front-end-libraries/redux/get-state-from-the-redux-store/index.md index 72d682c7a1..d45d29ee3e 100644 --- a/guide/english/certifications/front-end-libraries/redux/get-state-from-the-redux-store/index.md +++ b/guide/english/certifications/front-end-libraries/redux/get-state-from-the-redux-store/index.md @@ -4,6 +4,6 @@ title: Get State from the Redux Store ## Get State from the Redux Store Retrieve data from store by using `getState()` method. -```react.js +```jsx let currentState = store.getState(); ``` diff --git a/guide/english/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-a-literal-string-with-different-possibilities/index.md b/guide/english/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-a-literal-string-with-different-possibilities/index.md index 3e55d9e8d0..a6196830ad 100644 --- a/guide/english/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-a-literal-string-with-different-possibilities/index.md +++ b/guide/english/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-a-literal-string-with-different-possibilities/index.md @@ -14,7 +14,7 @@ Inside the string literal, place the pet names, each seperated by the `|` symbol ## Solution: -```javascriot +```js let petString = "James has a pet cat."; let petRegex = /dog|cat|bird|fish/; let result = petRegex.test(petString); diff --git a/guide/english/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-all-letters-and-numbers/index.md b/guide/english/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-all-letters-and-numbers/index.md index 85d932184a..10ffc76570 100644 --- a/guide/english/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-all-letters-and-numbers/index.md +++ b/guide/english/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-all-letters-and-numbers/index.md @@ -8,7 +8,8 @@ Use the shorthand character class \w to count the number of alphanumeric charact ## Solution -```let quoteSample = "The five boxing wizards jump quickly."; +```js +let quoteSample = "The five boxing wizards jump quickly."; let alphabetRegexV2 = /\w/gi; // Change this line let result = quoteSample.match(alphabetRegexV2).length; ``` diff --git a/guide/english/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-single-characters-not-specified/index.md b/guide/english/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-single-characters-not-specified/index.md index 621033fb07..c7b512499f 100644 --- a/guide/english/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-single-characters-not-specified/index.md +++ b/guide/english/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-single-characters-not-specified/index.md @@ -16,7 +16,7 @@ If so, then double check you're adding the appropriate flags: ### Hint 2: Be sure to check whether your number range is correct -- the challenge asks us to negate all numbers from 0 to 9. This can be done using the negate caret placed immediately after the first opening bracket of your regexp. -```javacsript +```js let numbersRegExp = /[^0-9]/ig; ``` diff --git a/guide/english/computer-science/data-structures/trees/index.md b/guide/english/computer-science/data-structures/trees/index.md index 7b2f4cadbf..9ac2b81045 100644 --- a/guide/english/computer-science/data-structures/trees/index.md +++ b/guide/english/computer-science/data-structures/trees/index.md @@ -93,7 +93,7 @@ A forest is a set of n ≥ 0 disjoint trees. ### Code of a tree node -``` c++ +```cpp struct node { int data; //Data element @@ -105,7 +105,7 @@ struct node ### Code for node creation createNode() returns a new node with the given data and NULL left and right pointers. -``` c++ +```cpp struct node* newNode(int element) { struct node* temp = (node*)malloc(sizeof(node)); //Allocate memeory for temp node diff --git a/guide/english/computer-science/error-handling/index.md b/guide/english/computer-science/error-handling/index.md index 5db7329d84..21a0c9c564 100644 --- a/guide/english/computer-science/error-handling/index.md +++ b/guide/english/computer-science/error-handling/index.md @@ -12,7 +12,7 @@ The try-catch statement consists of a **try** block and a **catch** block and an Below is an example program that handles the divide by zero exception using predefined class in C# library. Exception is the base class for all the exceptions. -```c# +```csharp using System; namespace ErrorHandling { diff --git a/guide/english/containers/docker/creating-a-new-container/index.md b/guide/english/containers/docker/creating-a-new-container/index.md index 6eb40a674c..a9303ac957 100644 --- a/guide/english/containers/docker/creating-a-new-container/index.md +++ b/guide/english/containers/docker/creating-a-new-container/index.md @@ -9,6 +9,6 @@ docker create [OPTIONS] IMAGE [COMMAND] [ARG...] ``` # Examples Create and start a container -```sh +```shell $ docker create -t -i fedora bash ``` diff --git a/guide/english/cplusplus/for-loop/index.md b/guide/english/cplusplus/for-loop/index.md index ff09bf7b7a..e144761ade 100644 --- a/guide/english/cplusplus/for-loop/index.md +++ b/guide/english/cplusplus/for-loop/index.md @@ -15,7 +15,7 @@ For loop is an entry controlled loop unlike do-while loop. ## Syntax -```c++ +```cpp for (init; condition; increment ) { update_statement(s); } @@ -23,7 +23,7 @@ for (init; condition; increment ) { The increment can also placed inside the for loop i.e. in its body- -```c++ +```cpp for ( init; condition;) { update_statement(s); increment; @@ -32,7 +32,7 @@ for ( init; condition;) { It is also allowed to ignore the init variables if and only if they are declared beforehand. For example : -```c++ +```cpp int a = 1; for (; a <= 10 ;) { cout << a << '\n'; @@ -58,7 +58,7 @@ The update statement is used to alter the loop variable by using simple operatio You will often see an increment operation as the update statement (e.g. i++, count++). This is often seen as one of the distinguishing features and possible name sources for the C++ language. ## Implementation -```c++ +```cpp #include using std::cout; // Here we use the scope resolution operator to define the scope of the standard functions as std using std::endl; @@ -74,7 +74,7 @@ int main () { ``` Output: -```output +```shell value of a: 10 value of a: 11 value of a: 12 @@ -91,7 +91,7 @@ value of a: 19 The body of the for loop need not be enclosed in braces if the loop iterates over only one statement. ### Example -```c++ +```cpp #include using std::cout; @@ -107,7 +107,7 @@ int main () { This would generate the same output as the previous program. Output: -```output +```shell value of a: 10 value of a: 11 value of a: 12 @@ -128,13 +128,13 @@ C++ also has what we call "range-based" `for` loops which iterate through all th ### Syntax -```c++ +```cpp for ( element: container ) { statement(s); } ``` -```c++ +```cpp int[5] array = { 1, 2, 3, 4, 5 } for ( int i: array ) { cout << i << endl; @@ -142,7 +142,7 @@ for ( int i: array ) { ``` Output: -```output +```shell 1 2 3 @@ -154,7 +154,7 @@ Output: Iterator based for loops are also possible in C++ and functionality for them exists in many of the data structures found within the STL. Unlike for-each loops, iterator based loops allow for mutating the contents of the container during iteration. This is rather useful when one needs to remove or insert values while looping over data. ### Syntax -```c++ +```cpp // Create a vector std::vector vec; @@ -176,7 +176,7 @@ for(std::vector::iterator it = vec.begin(); it != vec.end(); it++) { ### Use as infinite loops This C-style for-loop is commonly the source of an infinite loop since the fundamental steps of iteration are completely in the control of the programmer. In fact, when infinite loops are intended, this type of for-loop can be used (with empty expressions), such as: -```c++ +```cpp for (;;) { //loop body } diff --git a/guide/english/cplusplus/lists/index.md b/guide/english/cplusplus/lists/index.md index f5291d91a7..abb5064c10 100644 --- a/guide/english/cplusplus/lists/index.md +++ b/guide/english/cplusplus/lists/index.md @@ -17,7 +17,7 @@ Traversal in a list is slow as compared to Vectors and Arrays, but once a positi ## How to declare a List Possible declarations of a list: -```c++ +```cpp #include int main() diff --git a/guide/english/cplusplus/loops/index.md b/guide/english/cplusplus/loops/index.md index adfa7442c4..477eb3f337 100644 --- a/guide/english/cplusplus/loops/index.md +++ b/guide/english/cplusplus/loops/index.md @@ -9,7 +9,7 @@ title: Loops Now let's discuss something known as loop. Suppose you want to print the even numbers from 1 to 1000 on the screen. One way to do this is to write the following lines -``` c++ +```cpp cout << 0 << endl; cout << 2 << endl; cout << 4 << endl; @@ -30,7 +30,7 @@ While and do while loops allow you to run the loop until a condition finishes. The difference between While and Do while is that Do while loop always executes at least once. The very use of Do while loop can be seen in the scenarios when the number of times that the loop will run depends upon the first iteration of the loop. Here you can see an example: -``` c++ +```cpp while (condition){ // Code that will execute while condition is true } @@ -44,7 +44,7 @@ For loops are usually used when you know how many times the code will execute. The flow can be seen in this [graph](https://www.tutorialspoint.com/cplusplus/images/cpp_for_loop.jpg). They are declared this way: -``` c++ +```cpp for ( initialize a variable; check a condition; increment the initialized variable ) { //Code to execute } @@ -52,7 +52,7 @@ for ( initialize a variable; check a condition; increment the initialized variab Let's write a program which will print numbers from 0 to 1000 including 1000 on the screen using a for loop. -``` c++ +```cpp for (int i = 0;i<=1000;i++) { cout << i << endl; @@ -77,7 +77,7 @@ Now let's discuss how the for loop works. ` for(int i=0;i<=1000;i++) ` * If there is only one statement inside the loop then the curly bracket is optional but its better to write loop code within brackets so that you don't get confused. - ``` c++ + ```cpp for(int i=0;i<=1000;i++) { } @@ -88,7 +88,7 @@ Now let's discuss how the for loop works. If you want to print even numbers from 1 to 1000 then your program will look like this: -``` c++ +```cpp for (int i = 0;i<=1000;i=i+2) { cout << i << endl; @@ -100,7 +100,7 @@ for (int i = 0;i<=1000;i=i+2) Our next program to print even numbers from 0 to 1000 will look like this: - ``` c++ + ```cpp #include using namespace std; int main() @@ -114,7 +114,7 @@ int main() ``` Another type of for loop is the [Range-based for loop](https://en.cppreference.com/w/cpp/language/range-for). - ``` c++ + ```cpp #include using namespace std; int main() diff --git a/guide/english/cplusplus/queue/index.md b/guide/english/cplusplus/queue/index.md index 48fca5c910..bc28da7a18 100644 --- a/guide/english/cplusplus/queue/index.md +++ b/guide/english/cplusplus/queue/index.md @@ -146,7 +146,8 @@ int main () Returns whether the `queue` is empty ,i.e. whether your queue size is zero. It returns `true` if queue's size 0 else returns `false` -```cpp//Empty operation in Queue +```cpp +//Empty operation in Queue #include // std::cout #include // std::stack diff --git a/guide/english/cplusplus/switch-statements/index.md b/guide/english/cplusplus/switch-statements/index.md index cb351f9100..9812be16ef 100644 --- a/guide/english/cplusplus/switch-statements/index.md +++ b/guide/english/cplusplus/switch-statements/index.md @@ -39,7 +39,7 @@ Two case labels cannot have the same value. Example: -```C++ +```cpp #include using namespace std; diff --git a/guide/english/cplusplus/while-loop/index.md b/guide/english/cplusplus/while-loop/index.md index 2982890617..07c23b881e 100644 --- a/guide/english/cplusplus/while-loop/index.md +++ b/guide/english/cplusplus/while-loop/index.md @@ -5,7 +5,7 @@ title: While-loop A while loop statement repeatedly executes a target statement as long as a given condition is true. It is often used when the number of iterations is unknown. Syntax: -```C++ +```cpp while(condition) { statement(s); } @@ -18,7 +18,7 @@ Another important point about the while loop is to remember to increment/decreme Example: -```C++ +```cpp #include using namespace std; @@ -52,7 +52,7 @@ value of a: 19 ``` Example of Skipped Loop Body: -```C++ +```cpp #include using namespace std; diff --git a/guide/english/csharp/class/index.md b/guide/english/csharp/class/index.md index 7730da56da..ec8799724d 100644 --- a/guide/english/csharp/class/index.md +++ b/guide/english/csharp/class/index.md @@ -67,7 +67,7 @@ namespace CPrograms ``` ## Output: -```sh +```shell > Employee Name: John Doe, Employee ID: 420156 ``` diff --git a/guide/english/csharp/foreach/index.md b/guide/english/csharp/foreach/index.md index 471d8a85d2..a8dfb4fa9d 100644 --- a/guide/english/csharp/foreach/index.md +++ b/guide/english/csharp/foreach/index.md @@ -27,7 +27,7 @@ foreach(string name in Names) ``` ### Output: -```sh +```shell > We have Jim > We have Jane > We have Jack diff --git a/guide/english/csharp/hello-world/index.md b/guide/english/csharp/hello-world/index.md index 259c16cf68..645c2a2cbe 100644 --- a/guide/english/csharp/hello-world/index.md +++ b/guide/english/csharp/hello-world/index.md @@ -31,7 +31,7 @@ namespace HelloWorld ``` ## Output: -```sh +```shell > Hello World! > Press any key to exit. ``` diff --git a/guide/english/csharp/null-coalescing-operator/index.md b/guide/english/csharp/null-coalescing-operator/index.md index 631131f1df..4bdee3ab2d 100644 --- a/guide/english/csharp/null-coalescing-operator/index.md +++ b/guide/english/csharp/null-coalescing-operator/index.md @@ -10,7 +10,7 @@ The null-coalescing operator in C# is used to help assign one variable to anothe Since `name` is `null`, `clientName` will be assigned the value "John Doe". -```cs +```csharp string name = null; string clientName = name ?? "John Doe"; @@ -18,7 +18,7 @@ string clientName = name ?? "John Doe"; Console.WriteLine(clientName); ``` -```cs +```csharp > John Doe ``` @@ -26,7 +26,7 @@ Console.WriteLine(clientName); Since `name` is not `null`, `clientName` will be assigned the value of `name`, which is "Jane Smith". -```cs +```csharp string name = "Jane Smith"; string clientName = name ?? "John Doe"; @@ -34,7 +34,7 @@ string clientName = name ?? "John Doe"; Console.WriteLine(clientName); ``` -```cs +```csharp > Jane Smith ``` @@ -42,7 +42,7 @@ Console.WriteLine(clientName); You could use an `if...else` statement to test for the presence of `null` and assign a different value. -```cs +```csharp string clientName; if (name != null) @@ -53,7 +53,7 @@ else However, this can be greatly simplified using the null-coalescing operator. -```cs +```csharp string clientName = name ?? "John Doe"; ``` @@ -61,13 +61,13 @@ string clientName = name ?? "John Doe"; It is also possible to use the conditional operator to test for the presence of `null` and assign a different value. -```cs +```csharp string clientName = name != null ? name : "John Doe"; ``` Again, this can be simplified using the null-coalescing operator. -```cs +```csharp string clientName = name ?? "John Doe"; ``` diff --git a/guide/english/csharp/unit-testing/index.md b/guide/english/csharp/unit-testing/index.md index 155847eee3..fc0be21938 100644 --- a/guide/english/csharp/unit-testing/index.md +++ b/guide/english/csharp/unit-testing/index.md @@ -29,7 +29,7 @@ Unit testing is also closely used in conjunction with test driven development. ## Example code The code below is testing whether the ```MultiplyPointsMethod``` in the ```Multiply Points Class``` will output ```600``` from an input of 6. -```cs +```csharp [TestMethod] public void BonusPointsOutputTestWithInt6() { diff --git a/guide/english/csharp/xaml/index.md b/guide/english/csharp/xaml/index.md index f305e5c1b6..4e1a17de96 100644 --- a/guide/english/csharp/xaml/index.md +++ b/guide/english/csharp/xaml/index.md @@ -24,7 +24,7 @@ Creating a TextBlock with several properties. TextBlocks are usually employed f ### Example 2 The following example shows a label with "Hello World!" as its content in a top level container called UserControl. -```XAML +```xml diff --git a/guide/english/css/breakpoints/index.md b/guide/english/css/breakpoints/index.md index 2fafb0e3a0..6dcd412764 100644 --- a/guide/english/css/breakpoints/index.md +++ b/guide/english/css/breakpoints/index.md @@ -180,7 +180,7 @@ Breakpoints that are based on content as opposed to device are less complicated. You can also set a minimum and maximum width, which lets you experiment with different ranges. This one triggers roughly between smart-phone and larger desktop and monitor sizes -```code +```css @media only screen and (min-width: 700px) and (max-width: 1500px) { something { something: something; diff --git a/guide/english/data-science-tools/pandas/index.md b/guide/english/data-science-tools/pandas/index.md index 577d2f067b..77f6fd4380 100644 --- a/guide/english/data-science-tools/pandas/index.md +++ b/guide/english/data-science-tools/pandas/index.md @@ -39,7 +39,7 @@ Series is the basic data-type in pandas. A Series is very similar to an array (N pd.Series([1,2,3]) ``` output: -```output +```shell 0 1 1 2 2 3 @@ -49,7 +49,7 @@ dtype: int64 np.array([1,2,3]) ``` output: -```output +```shell array([1, 2, 3]) ``` diff --git a/guide/english/go/installing-go/arch-linux/index.md b/guide/english/go/installing-go/arch-linux/index.md index b82a9c107d..dc122b2623 100644 --- a/guide/english/go/installing-go/arch-linux/index.md +++ b/guide/english/go/installing-go/arch-linux/index.md @@ -6,7 +6,7 @@ title: Installing Go in Arch Linux using pacman Using Arch Linux Package Manager (pacman) is the easiest way to install Go. Based on the Arch Linux philosophy of providing new software versions very fast, you will get a very current version of go. Before you can install the go package, you have to bring the system up to date. -```sh +```shell $ sudo pacman -Syu $ sudo pacman -S go ``` @@ -15,7 +15,7 @@ $ sudo pacman -S go To check if go was successfully installed, use: -```sh +```shell $ go version > go version go2.11.1 linux/amd64 ``` diff --git a/guide/english/go/installing-go/mac-package-installer/index.md b/guide/english/go/installing-go/mac-package-installer/index.md index 8a9b66e276..a73df5f240 100644 --- a/guide/english/go/installing-go/mac-package-installer/index.md +++ b/guide/english/go/installing-go/mac-package-installer/index.md @@ -11,7 +11,7 @@ From the [golang's download page](https://golang.org/dl/), get the Mac package i To check if go was successfully installed, open your terminal and use: -```sh +```shell $ go version ``` This should print to the console the version of go, while at the same time making sure the installation went smoothly. diff --git a/guide/english/go/installing-go/mac-tarball/index.md b/guide/english/go/installing-go/mac-tarball/index.md index 644ed21d2f..8f837dff74 100644 --- a/guide/english/go/installing-go/mac-tarball/index.md +++ b/guide/english/go/installing-go/mac-tarball/index.md @@ -25,7 +25,7 @@ $ export PATH=$PATH:/usr/local/go/bin To check if go was successfully installed, use: -```sh +```shell $ go version ``` This should print to the console the version of go, while at the same time making sure the installation went smoothly. diff --git a/guide/english/go/installing-go/ubuntu-apt-get/index.md b/guide/english/go/installing-go/ubuntu-apt-get/index.md index c2e519851c..5c86509882 100644 --- a/guide/english/go/installing-go/ubuntu-apt-get/index.md +++ b/guide/english/go/installing-go/ubuntu-apt-get/index.md @@ -7,7 +7,7 @@ Using Ubuntu's Source Package Manager (apt-get) is the easiest way to install Go >As of this writing, Ubuntu Xenial's version of go is 1.6.1, while the latest stable version is 1.9.1 -```sh +```shell $ sudo apt-get update $ sudo apt-get install golang-go ``` @@ -16,7 +16,7 @@ $ sudo apt-get install golang-go To check if go was successfully installed, use: -```sh +```shell $ go version > go version go1.9.1 linux/amd64 ``` diff --git a/guide/english/go/installing-go/ubuntu-tarball/index.md b/guide/english/go/installing-go/ubuntu-tarball/index.md index 82e4a15b70..6512fb30d0 100644 --- a/guide/english/go/installing-go/ubuntu-tarball/index.md +++ b/guide/english/go/installing-go/ubuntu-tarball/index.md @@ -9,7 +9,7 @@ title: Installing Go in Ubuntu using a tarball Before proceeding make sure you know if your system is 32 or 64 bit. If you don't know, run the following command to find out: -```sh +```shell $ lscpu | grep Architecture ``` If you see ``` Architecture: x86_64``` your system is 64bit, otherwise if you get ```Architecture: i686```, then your system is 32bit. Now that you know your system architecture, let's proceed. @@ -52,7 +52,7 @@ $ export PATH=$PATH:/usr/local/go/bin To check if go was successfully installed, use: -```sh +```shell $ go version > go version go1.9.1 linux/amd64 ``` diff --git a/guide/english/graphql/index.md b/guide/english/graphql/index.md index b802de2a46..c52b0bd389 100644 --- a/guide/english/graphql/index.md +++ b/guide/english/graphql/index.md @@ -12,7 +12,7 @@ GraphQL schemas are often coupled with frameworks such as [Relay](https://facebo ## Installation From the command line run: -```sh +```shell npm init npm install graphql --save ``` diff --git a/guide/english/javascript/semicolons/index.md b/guide/english/javascript/semicolons/index.md index 39aa543b8a..18462165ef 100644 --- a/guide/english/javascript/semicolons/index.md +++ b/guide/english/javascript/semicolons/index.md @@ -21,7 +21,7 @@ A consistent coding style makes code more readable. Decide whether you will or w When JavaScript was first made it was meant to aid beginners to get into programming. Nobody wants to be searching for a dang semi-colon in their code when they first start programming. So the choice of semi-colons was implemented, as stated above they are technically there. For example: -```javasctipt +```js function foo(x) { return function(y) { diff --git a/guide/english/javascript/with/index.md b/guide/english/javascript/with/index.md index c7347f85bb..db0c66933c 100644 --- a/guide/english/javascript/with/index.md +++ b/guide/english/javascript/with/index.md @@ -9,7 +9,7 @@ JavaScript's `with` statement is a shorthand way to edit several properties on o ### Syntax -```syntax +```js with (expression) statement ``` diff --git a/guide/english/laravel/index.md b/guide/english/laravel/index.md index 91979bc81f..bde50ad665 100644 --- a/guide/english/laravel/index.md +++ b/guide/english/laravel/index.md @@ -72,7 +72,7 @@ Laravel utilizes [Composer](https://getcomposer.org/) to manage its dependencies #### Via Laravel Installer First, download the Laravel installer using Composer: -```sh +```shell > composer global require laravel/installer ``` @@ -83,21 +83,21 @@ Make sure to place composer's system-wide vendor bin directory in your `$PATH` v Once installed, the laravel `new` command will create a fresh Laravel installation in the directory you specify. For instance, laravel new blog will create a directory named blog containing a fresh Laravel installation with all of Laravel's dependencies already installed: -```sh +```shell > laravel new blog ``` #### Via Composer Create-Project Alternatively, you may also install Laravel by issuing the Composer create-project command in your terminal: -```sh +```shell > composer create-project --prefer-dist laravel/laravel blog ``` Local Development Server If you have PHP installed locally and you would like to use PHP's built-in development server to serve your application, you may use the Artisan `serve` command. This command will start a development server at `http://localhost:8000`: -```sh +```shell > php artisan serve ``` diff --git a/guide/english/linux/getting-started/index.md b/guide/english/linux/getting-started/index.md index 1cce495730..8ab45e3a71 100644 --- a/guide/english/linux/getting-started/index.md +++ b/guide/english/linux/getting-started/index.md @@ -55,7 +55,7 @@ In Debian/Ubuntu and derivatives, the shortcut to open the CLI (Command Line Int cd (Change Directory) - The cd command is one of the commands you will use the most at the command line in Linux. It allows you to change your working directory. You use it to move around within the hierarchy of your file system. -```unix +```shell cd ``` @@ -63,7 +63,7 @@ Using the cd command alone will change the current directory to your user home d ls (List) - This command list the content in the current directory. It can also be used to list file information. -```sh +```shell ls ``` Now we can see our directories in our home. @@ -71,7 +71,7 @@ Now we can see our directories in our home. pwd (Print Working Directory) - This command lists the directory you are currently in. -```sh +```shell pwd ``` diff --git a/guide/english/linux/setting-up-yum-repositories-in-redhat-linux/index.md b/guide/english/linux/setting-up-yum-repositories-in-redhat-linux/index.md index eed669111a..a49ca51a54 100644 --- a/guide/english/linux/setting-up-yum-repositories-in-redhat-linux/index.md +++ b/guide/english/linux/setting-up-yum-repositories-in-redhat-linux/index.md @@ -10,7 +10,7 @@ RPM package file is a Red Hat Package Manager file and enables quick and easy so Step 1: Check if there are existing repositories or not. -```sh +```shell #yum repolist ``` @@ -18,19 +18,19 @@ You will find there is no repositories. Step 2: Change Directory to -```sh +```shell #cd /etc/yum.repos.d ``` Step 3: Create new file -```sh +```shell #vim myrepo.repo ``` Step 4: Type following lines in file -```sh +```shell [file-name] name=filename baseurl="location of yum repositories" @@ -40,6 +40,6 @@ Step 5: Save and Exit Step 6: Repeat Step 1 -```sh +```shell You Will find repositories ``` diff --git a/guide/english/linux/the-anatomy-of-the-linux-command-line/index.md b/guide/english/linux/the-anatomy-of-the-linux-command-line/index.md index f8ed0d2570..0109a244b2 100644 --- a/guide/english/linux/the-anatomy-of-the-linux-command-line/index.md +++ b/guide/english/linux/the-anatomy-of-the-linux-command-line/index.md @@ -18,7 +18,7 @@ In Linux, commands are given (typed) in the terminal. Though the terminal applic To get started using open the terminal (for Ubuntu simply hold the Ctrl + Alt + T) and you're welcomed by a series of characters arranged in this format; -```linux +```shell user_name@machine_name:~$ ``` diff --git a/guide/english/miscellaneous/the-c-programming-language/index.md b/guide/english/miscellaneous/the-c-programming-language/index.md index 1047e4696f..7925c65afb 100644 --- a/guide/english/miscellaneous/the-c-programming-language/index.md +++ b/guide/english/miscellaneous/the-c-programming-language/index.md @@ -59,7 +59,7 @@ Alternatively, you could also download Edit in .NET Fiddle -```C# +```csharp int a = 10; int b = 20; a=b; @@ -138,7 +138,7 @@ More information If else statement : Edit in .NET Fiddle - ```C# + ```csharp int myScore = 700; if (myScore == 700) { @@ -162,7 +162,7 @@ More information Switch statement : Edit in .NET Fiddle - ```C# + ```csharp using System; public class Program @@ -200,7 +200,7 @@ More information For & Foreach : Edit in .NET Fiddle - ```C# + ```csharp for (int i = 0; i < 10; i++) { Console.WriteLine(i); //prints 0-9 @@ -228,7 +228,7 @@ More information While & do-while : Edit in .NET Fiddle - ```C# + ```csharp // Continue the while-loop until index is equal to 10. int i = 0; while (i < 10) diff --git a/guide/english/nginx/index.md b/guide/english/nginx/index.md index 3bb723a8d8..31815cccb0 100644 --- a/guide/english/nginx/index.md +++ b/guide/english/nginx/index.md @@ -21,19 +21,19 @@ Nginx offers a different option than using Apache or other web servers and claim Update the local package index and install Nginx from default repositories: -```sh +```shell $ sudo apt-get update && sudo apt-get upgrade $ sudo apt-get install nginx $ sudo systemctl status nginx ``` Enable nginx on the firewall using `ufw` -```sh +```shell sudo ufw allow 'Nginx HTTP' ``` Validate nginx is running: -```sh +```shell systemctl status nginx ``` @@ -41,7 +41,7 @@ systemctl status nginx Add Nginx repository and install: -```sh +```shell $ sudo yum install epel-release $ sudo yum install nginx $ sudo systemctl start nginx # will start the server diff --git a/guide/english/nodejs/express/index.md b/guide/english/nodejs/express/index.md index b03ae68b25..712ff90d08 100644 --- a/guide/english/nodejs/express/index.md +++ b/guide/english/nodejs/express/index.md @@ -371,7 +371,7 @@ The dotenv middleware loads environmental variables from a `.env` file into `pro npm install --save dotenv ``` -```sh +```shell # .env file DB_HOST=localhost DB_USER=root diff --git a/guide/english/nodejs/index.md b/guide/english/nodejs/index.md index 2cf0611fbc..0286792a95 100644 --- a/guide/english/nodejs/index.md +++ b/guide/english/nodejs/index.md @@ -33,7 +33,7 @@ my_io_task() ``` **Node.js** -```node +```js function my_io_task() { setTimeout(function() { console.log('done'); diff --git a/guide/english/php/basic-syntax/index.md b/guide/english/php/basic-syntax/index.md index 71471b5f09..79c6b80b50 100644 --- a/guide/english/php/basic-syntax/index.md +++ b/guide/english/php/basic-syntax/index.md @@ -9,7 +9,8 @@ A PHP script starts with `` Below, we have an example of a simple PHP file, with a PHP script that uses a built-in PHP function "echo" to output the text "Hello World!" on a web page -```` +```html + diff --git a/guide/english/php/loops/for-loop/index.md b/guide/english/php/loops/for-loop/index.md index f1d1a38d6e..0a6b1b30de 100644 --- a/guide/english/php/loops/for-loop/index.md +++ b/guide/english/php/loops/for-loop/index.md @@ -52,7 +52,7 @@ for ($i = 0; $i <= count($arr); $i++) { This will output: -```txt +```shell int(1) int(2) int(3) NULL ``` diff --git a/guide/english/python/python-2-vs-python-3/index.md b/guide/english/python/python-2-vs-python-3/index.md index a9abf16cc6..a5dcbe94ab 100644 --- a/guide/english/python/python-2-vs-python-3/index.md +++ b/guide/english/python/python-2-vs-python-3/index.md @@ -57,12 +57,12 @@ Both Python 2 and Python 3 are great. Most Linux and macOS distributions come pr ## Installing Modules - Python2 vs. Python3 To install modules for python 2, you can use the following: -```sh +```shell pip2 install [module-name] ``` To install modules for python 3, you can use the following: -```sh +```shell pip3 install [module-name] ``` diff --git a/guide/english/react/what-are-react-props/index.md b/guide/english/react/what-are-react-props/index.md index d4d0ca95b7..0e7be966a6 100644 --- a/guide/english/react/what-are-react-props/index.md +++ b/guide/english/react/what-are-react-props/index.md @@ -11,7 +11,7 @@ Starting with React version 15.5 this feature was moved to a separate package na In order to use it, it's required to be added to the project as a dependency by issuing the following command in a console. -```sh +```shell npm install --save prop-types ``` After that a whole range of validators that can be used to make sure the data the developer is going to recieve is actually valid. diff --git a/guide/english/rest-api/index.md b/guide/english/rest-api/index.md index eebe5eda77..df41c78661 100644 --- a/guide/english/rest-api/index.md +++ b/guide/english/rest-api/index.md @@ -130,11 +130,11 @@ The frustrating **4xx** resources! The lesser known **400** suggests that you are passing wrong parameter. The response can also pass information that describes what is wrong. Example: -```output +```shell DELETE /cars/MH09234 ``` returns `400` or message -```output +```shell Expecting int car id /car/id got string car/MH09234 ``` diff --git a/guide/english/rust/installing-rust/index.md b/guide/english/rust/installing-rust/index.md index e1abff8903..40304b0689 100644 --- a/guide/english/rust/installing-rust/index.md +++ b/guide/english/rust/installing-rust/index.md @@ -14,7 +14,7 @@ Visit the [rustup website](https://rustup.rs) and download the `rustup-init.exe` Open up your terminal and type in this command: -```sh +```shell curl https://sh.rustup.rs -sSf | sh ``` @@ -23,7 +23,7 @@ This will fetch the `rustup` installer and in turn fetch everything you need. ### Mac OS X (Homebrew) Mac OS X users can also use [Homebrew](https://brew.sh/) to install rust: -```sh +```shell brew install rust ``` @@ -31,7 +31,7 @@ brew install rust Installing `rustup` will install all things relevant to rust, but most relevantly this means installing the compiler and the package manager. To verify that everything is installed, run this command: -```sh +```shell cargo version ``` diff --git a/guide/english/sql/sql-interview-questions/index.md b/guide/english/sql/sql-interview-questions/index.md index e1602f5d33..9ab194dbac 100644 --- a/guide/english/sql/sql-interview-questions/index.md +++ b/guide/english/sql/sql-interview-questions/index.md @@ -46,13 +46,13 @@ NOT NULL is the only constraint that works at the column level. ### What are the pseudocolumns in SQL? Give some examples? -A pseudocolumn is a function which returns a system generated value. The reason it is known as so because a pseudocolumn is an Oracle assigned value used in the same context as an Oracle database column but not stored on disk. -``` Some examples of it are: +A pseudocolumn is a function which returns a system generated value. The reason it is known as so because a pseudocolumn is an Oracle assigned value used in the same context as an Oracle database column but not stored on disk. Some examples of it are: +``` ROWNUM, ROWID, USER, CURRVAL, NEXTVAL etc. ``` ### Create a user my723acct with password kmd26pt. Use the user_data and temporary data tablespaces provided by PO8 and provide to this user 10M of storage space in user_data and 5M of storage space in temporary_data. -``` sql +```sql CREATE USER my723acct IDENTIFIED BY kmd26pt DEFAULT TABLESPACE user_data TEMPORARY TABLESPACE temporary_data @@ -61,7 +61,7 @@ A pseudocolumn is a function which returns a system generated value. The reason ### Create the role role_tables_and_views. -``` sql +```sql CREATE ROLE role_tables_and_views ``` @@ -76,12 +76,12 @@ The privilege to create view is CREATE VIEW ### Grant the previous role in the question to the users anny and rita -``` sql +```sql GRANT role_tables_and_views TO anny, rita ``` ### Create a user my723acct with password kmd26pt. Use the user_data and temporary data tablespaces provided by PO8 and provide to this user 10M of storage space in user_data and 5M of storage space in temporary_data. -``` sql +```sql CREATE USER my723acct IDENTIFIED BY kmd26pt DEFAULT TABLESPACE user_data TEMPORARY TABLESPACE temporary_data @@ -93,36 +93,36 @@ The privilege to create view is CREATE VIEW The privilege to connect to the database is CREATE SESSION The privilege to create table is CREATE TABLE The privilege to create view is CREATE VIEW -``` sql +```sql GRANT Create session, create table, create view TO role_tables_and_views ``` ### Grant the previous role in the question to the users anny and rita -``` sql +```sql GRANT role_tables_and_views TO anny, rita ``` ### Write a command to change the password of the user rita from abcd to dfgh -``` sql +```sql ALTER USER rita IDENTIFIED BY dfgh ``` ### The users rita and anny do not have SELECT privileges on the table INVENTORY that was created by SCOTT. Write a command to allow SCOTT to grant the users SELECT priviliges on these tables. -``` sql +```sql GRANT select ON inventory TO rita, anny ``` ### User rita has been transferred and no longer needs the privilege that was granted to her through the role role_tables_and_views. Write a command to remove her from her previous given priviliges except that she still could connect to the database. -``` sql +```sql REVOKE select ON scott.inventory FROM rita REVOKE create table, create view FROM rita ``` ### The user rita who was transferred is now moving to another company. Since the objects that she created is of no longer use, write a commmand to remove this user and all her objects. Here CASCADE option is necessary to remove all the objects of the user in the database. -``` sql +```sql DROP USER rita CASCADE ``` @@ -135,13 +135,13 @@ Here CASCADE option is necessary to remove all the objects of the user in the da ### The user rita who was transferred is now moving to another company. Since the objects that she created is of no longer use, write a commmand to remove this user and all her objects. Here CASCADE option is necessary to remove all the objects of the user in the database. -``` sql +```sql DROP USER rita CASCADE ``` ### Write SQL query to find the nth highest salary from table. -``` sql +```sql SELECT TOP 1 Salary FROM ( SELECT DISTINCT TOP N Salary diff --git a/guide/english/sql/sql-select-statement/index.md b/guide/english/sql/sql-select-statement/index.md index 003878d988..2b7d9254b4 100644 --- a/guide/english/sql/sql-select-statement/index.md +++ b/guide/english/sql/sql-select-statement/index.md @@ -41,7 +41,7 @@ SELECT * from As defined in above section, there is another way of selecting all data without defining names of each and every attribute in query. This technique is short and very helpfull in querying faster: -```Select query +```sql select * from student; ``` diff --git a/guide/english/wordpress/index.md b/guide/english/wordpress/index.md index 4ab1f8aaa0..a7eae94bc9 100644 --- a/guide/english/wordpress/index.md +++ b/guide/english/wordpress/index.md @@ -175,11 +175,11 @@ After confirming installation you will be on the WordPress Dashboard. 1. Download WordPress from https://wordpress.org/download/ 2. Extract the WordPress files from the .tar.gz archive. 3. Move the extracted WordPress directory to /srv/http. This can be achieved using the following command. Remember to replace the text within the <> with the name of the extracted WordPress directory in your computer (use sudo if superuser access is required): - ```sh + ```shell mv ~Downloads/ #include #include @@ -91,7 +91,7 @@ int main() A DFS é completa num numero finito de nós. Trabalhando melhor em arvores esparssas. ### Implementation of DFS in C++ -```c++ +```cpp #include #include #include diff --git a/guide/portuguese/algorithms/lee-algorithm/index.md b/guide/portuguese/algorithms/lee-algorithm/index.md index b95951e418..68ba93b013 100644 --- a/guide/portuguese/algorithms/lee-algorithm/index.md +++ b/guide/portuguese/algorithms/lee-algorithm/index.md @@ -21,7 +21,7 @@ O C ++ já tem a fila implementada na biblioteca `` , mas se você estive Código C ++: -```c++ +```cpp int dl[] = {-1, 0, 1, 0}; // these arrays will help you travel in the 4 directions more easily int dc[] = {0, 1, 0, -1}; diff --git a/guide/portuguese/algorithms/search-algorithms/binary-search/index.md b/guide/portuguese/algorithms/search-algorithms/binary-search/index.md index 5ac7f763f9..b0637cb9dc 100644 --- a/guide/portuguese/algorithms/search-algorithms/binary-search/index.md +++ b/guide/portuguese/algorithms/search-algorithms/binary-search/index.md @@ -174,7 +174,7 @@ int binarySearch(int a[], int l, int r, int x) { ### Implementação C / C ++ -```C++ +```cpp int binary_search(int arr[], int l, int r, int target) { if (r >= l) @@ -208,7 +208,7 @@ def binary_search(arr, l, r, target): ### Exemplo em C ++ -```c++ +```cpp // Binary Search using iteration int binary_search(int arr[], int beg, int end, int num) { @@ -225,7 +225,7 @@ def binary_search(arr, l, r, target): } ``` -```c++ +```cpp // Binary Search using recursion int binary_search(int arr[], int beg, int end, int num) { diff --git a/guide/portuguese/algorithms/search-algorithms/linear-search/index.md b/guide/portuguese/algorithms/search-algorithms/linear-search/index.md index 2ab722c466..9b86bd0f44 100644 --- a/guide/portuguese/algorithms/search-algorithms/linear-search/index.md +++ b/guide/portuguese/algorithms/search-algorithms/linear-search/index.md @@ -75,7 +75,7 @@ def linear_search(target, array) ### Exemplo em C ++ -```c++ +```cpp int linear_search(int arr[],int n,int num) { for(int i=0;i using namespace std; void heapify(int arr[], int n, int i) diff --git a/guide/portuguese/algorithms/sorting-algorithms/insertion-sort/index.md b/guide/portuguese/algorithms/sorting-algorithms/insertion-sort/index.md index 2f2c3437fb..afe6c3f963 100644 --- a/guide/portuguese/algorithms/sorting-algorithms/insertion-sort/index.md +++ b/guide/portuguese/algorithms/sorting-algorithms/insertion-sort/index.md @@ -92,7 +92,7 @@ Passo 5: O algoritmo abaixo é uma versão ligeiramente otimizada para evitar a troca do elemento- `key` em cada iteração. Aqui, o elemento- `key` será trocado no final da iteração (etapa). -```Algorithm +``` InsertionSort(arr[]) for j = 1 to arr.length key = arr[j] diff --git a/guide/portuguese/algorithms/sorting-algorithms/merge-sort/index.md b/guide/portuguese/algorithms/sorting-algorithms/merge-sort/index.md index 925695de4d..7f97374353 100644 --- a/guide/portuguese/algorithms/sorting-algorithms/merge-sort/index.md +++ b/guide/portuguese/algorithms/sorting-algorithms/merge-sort/index.md @@ -23,7 +23,7 @@ T(n) = 2T(n/2) + n Contando o número de repetições de n na soma no final, vemos que há lg n + 1 delas. Assim, o tempo de execução é n (lg n + 1) = n l n n + n. Observamos que n ng n + n 0, então o tempo de execução é O (n lg n). -```Algorithm +``` MergeSort(arr[], left, right): If right > l: 1. Find the middle point to divide the array into two halves: diff --git a/guide/portuguese/certifications/apis-and-microservices/basic-node-and-express/use-body-parser-to-parse-post-requests/index.md b/guide/portuguese/certifications/apis-and-microservices/basic-node-and-express/use-body-parser-to-parse-post-requests/index.md index 455a6f6751..f514edcb82 100644 --- a/guide/portuguese/certifications/apis-and-microservices/basic-node-and-express/use-body-parser-to-parse-post-requests/index.md +++ b/guide/portuguese/certifications/apis-and-microservices/basic-node-and-express/use-body-parser-to-parse-post-requests/index.md @@ -6,7 +6,7 @@ localeTitle: Use o analisador de corpo para analisar solicitações de POST O analisador de corpo já deve ser adicionado ao seu projeto se você usou o clichê fornecido, mas se não deveria estar lá como: -```code +```json "dependencies": { "body-parser": "^1.4.3", ... diff --git a/guide/portuguese/certifications/front-end-libraries/react/change-inline-css-conditionally-based-on-component-state/index.md b/guide/portuguese/certifications/front-end-libraries/react/change-inline-css-conditionally-based-on-component-state/index.md index d91d24037e..06f885e296 100644 --- a/guide/portuguese/certifications/front-end-libraries/react/change-inline-css-conditionally-based-on-component-state/index.md +++ b/guide/portuguese/certifications/front-end-libraries/react/change-inline-css-conditionally-based-on-component-state/index.md @@ -58,7 +58,7 @@ class GateKeeper extends React.Component { Escreva uma instrução condicional que seja avaliada de acordo com o seu estado, conforme mencionado na descrição do desafio, verifique o comprimento da entrada e atribua um novo objeto à variável inputStyle. -```react.js +```jsx if (this.state.input.length > 15) { inputStyle = { border: '3px solid red' diff --git a/guide/portuguese/certifications/front-end-libraries/react/create-a-controlled-form/index.md b/guide/portuguese/certifications/front-end-libraries/react/create-a-controlled-form/index.md index 531eed85e1..b1a2f6a3f8 100644 --- a/guide/portuguese/certifications/front-end-libraries/react/create-a-controlled-form/index.md +++ b/guide/portuguese/certifications/front-end-libraries/react/create-a-controlled-form/index.md @@ -10,13 +10,13 @@ Primeiro, crie uma entrada controlada que armazene seu valor no estado, para que ### Solução -```react.js +```jsx ``` Em seguida, crie o método handleSubmit para o seu componente. Primeiro, porque o formulário está sendo enviado, você terá que evitar que a página seja atualizada. Em segundo lugar, chame o método `setState()` , passando um objeto dos diferentes pares de valor-chave que você deseja alterar. Neste caso, você deseja definir 'submit' para o valor da variável 'input' e definir 'input' para uma string vazia. -```react.js +```jsx handleSubmit(event) { event.preventDefault(); this.setState({ diff --git a/guide/portuguese/certifications/front-end-libraries/react/give-sibling-elements-a-unique-key-attribute/index.md b/guide/portuguese/certifications/front-end-libraries/react/give-sibling-elements-a-unique-key-attribute/index.md index 3d43027a94..152ef1da5e 100644 --- a/guide/portuguese/certifications/front-end-libraries/react/give-sibling-elements-a-unique-key-attribute/index.md +++ b/guide/portuguese/certifications/front-end-libraries/react/give-sibling-elements-a-unique-key-attribute/index.md @@ -12,7 +12,7 @@ localeTitle: Dê aos Irmãos Elementos um Atributo de Chave Única Basta adicionar `key` atributo- `key` à tag `
  • ` para torná-lo exclusivo -```react.js +```jsx const renderFrameworks = frontEndFrameworks.map((item) =>
  • {item}
  • ); diff --git a/guide/portuguese/certifications/front-end-libraries/react/introducing-inline-styles/index.md b/guide/portuguese/certifications/front-end-libraries/react/introducing-inline-styles/index.md index 2075fd4c12..f24ab5f0b8 100644 --- a/guide/portuguese/certifications/front-end-libraries/react/introducing-inline-styles/index.md +++ b/guide/portuguese/certifications/front-end-libraries/react/introducing-inline-styles/index.md @@ -10,7 +10,7 @@ Este pode ser um pouco complicado, porque o JSX é muito semelhante ao HTML, mas Vamos percorrer os passos para que você entenda a diferença. Primeiro, defina sua tag de estilo para um **objeto JavaScript** . -```react.js +```jsx class Colorful extends React.Component { render() { return ( @@ -26,7 +26,7 @@ Agora você tem sua tag de estilo definida para um objeto vazio. Observe como h Em segundo lugar, vamos definir a cor para vermelho. -```react.js +```jsx class Colorful extends React.Component { render() { return ( @@ -42,7 +42,7 @@ Finalmente, vamos definir o tamanho da fonte para 72px. ### Spoiler -```react.js +```jsx class Colorful extends React.Component { render() { return ( diff --git a/guide/portuguese/certifications/front-end-libraries/react/override-default-props/index.md b/guide/portuguese/certifications/front-end-libraries/react/override-default-props/index.md index a5d79ce742..2591567c24 100644 --- a/guide/portuguese/certifications/front-end-libraries/react/override-default-props/index.md +++ b/guide/portuguese/certifications/front-end-libraries/react/override-default-props/index.md @@ -6,7 +6,7 @@ localeTitle: Substituir Adereços Padrão Esse desafio substitui o valor padrão da `quantity` de props para o componente Itens. Onde o valor padrão da `quantity` é definido como `0` . -```react.js +```jsx const Items = (props) => { return

    Current Quantity of Items in Cart: {props.quantity}

    } @@ -18,13 +18,13 @@ const Items = (props) => { Para substituir um valor props padrão, a sintaxe a ser seguida é -```react.js +```jsx ``` Após a sintaxe, o seguinte código deve ser declarado abaixo do código fornecido -```react.js +```jsx ``` diff --git a/guide/portuguese/certifications/front-end-libraries/react/render-conditionally-from-props/index.md b/guide/portuguese/certifications/front-end-libraries/react/render-conditionally-from-props/index.md index 9b45abdd40..c4e06146a7 100644 --- a/guide/portuguese/certifications/front-end-libraries/react/render-conditionally-from-props/index.md +++ b/guide/portuguese/certifications/front-end-libraries/react/render-conditionally-from-props/index.md @@ -10,7 +10,7 @@ Este é um desafio complicado, mas fácil. Altere o `handleClick()` com a instrução de `handleClick()` adequada. -```react.js +```jsx handleClick() { this.setState({ counter: this.state.counter + 1 @@ -20,7 +20,7 @@ handleClick() { No método `render()` , use `Math.random()` como mencionado na descrição do desafio e escreva uma expressão ternária para passar `props` no componente **Results** . -```react.js +```jsx let expression = Math.random() > .5; {(expression == 1)? : } @@ -28,7 +28,7 @@ No método `render()` , use `Math.random()` como mencionado na descrição do de Em seguida, renderize os `fiftyFifty` no componente Results. -```react.js +```jsx

    { this.props.fiftyFifty diff --git a/guide/portuguese/certifications/front-end-libraries/react/render-state-in-the-user-interface/index.md b/guide/portuguese/certifications/front-end-libraries/react/render-state-in-the-user-interface/index.md index 15847f234c..d978a3cc9a 100644 --- a/guide/portuguese/certifications/front-end-libraries/react/render-state-in-the-user-interface/index.md +++ b/guide/portuguese/certifications/front-end-libraries/react/render-state-in-the-user-interface/index.md @@ -12,7 +12,7 @@ Basta criar uma tag `

    ` e renderizar `this.state.name` entre a tag. ## Solução -```react.js +```jsx class MyComponent extends React.Component { constructor(props) { super(props); diff --git a/guide/portuguese/certifications/front-end-libraries/react/render-with-an-ifelse-condition/index.md b/guide/portuguese/certifications/front-end-libraries/react/render-with-an-ifelse-condition/index.md index 66d7ff6348..6ae9e809d4 100644 --- a/guide/portuguese/certifications/front-end-libraries/react/render-with-an-ifelse-condition/index.md +++ b/guide/portuguese/certifications/front-end-libraries/react/render-with-an-ifelse-condition/index.md @@ -12,7 +12,7 @@ Primeiro, envolva o método de retorno atual dentro de uma instrução if e defi ### Solução -```react.js +```jsx if (this.state.display === true) { return (
    @@ -25,7 +25,7 @@ if (this.state.display === true) { Em seguida, crie uma instrução else que retorne o mesmo JSX **sem** o elemento `h1` . -```react.js +```jsx else { return (
    diff --git a/guide/portuguese/certifications/front-end-libraries/react/use-a-ternary-expression-for-conditional-rendering/index.md b/guide/portuguese/certifications/front-end-libraries/react/use-a-ternary-expression-for-conditional-rendering/index.md index ef8bfa55ba..2d7bb51f21 100644 --- a/guide/portuguese/certifications/front-end-libraries/react/use-a-ternary-expression-for-conditional-rendering/index.md +++ b/guide/portuguese/certifications/front-end-libraries/react/use-a-ternary-expression-for-conditional-rendering/index.md @@ -17,7 +17,7 @@ condition ? expressionIfTrue : expressionIfFalse Aqui está uma solução de exemplo de uso da expressão ternária. Primeiro você precisa declarar estado no construtor como este -```react.js +```jsx constructor(props) { super(props); // change code below this line @@ -33,7 +33,7 @@ constructor(props) { Então o operador ternário -```react.js +```jsx { /* change code here */ (this.state.userAge >= 18) ? buttonTwo : (this.state.userAge== '')? buttonOne: buttonThree diff --git a/guide/portuguese/certifications/front-end-libraries/react/use-proptypes-to-define-the-props-you-expect/index.md b/guide/portuguese/certifications/front-end-libraries/react/use-proptypes-to-define-the-props-you-expect/index.md index 5afe0783ad..a02aaf3b23 100644 --- a/guide/portuguese/certifications/front-end-libraries/react/use-proptypes-to-define-the-props-you-expect/index.md +++ b/guide/portuguese/certifications/front-end-libraries/react/use-proptypes-to-define-the-props-you-expect/index.md @@ -6,7 +6,7 @@ localeTitle: Use PropTypes para definir os suportes que você espera Este desafio você definiu um `propTypes` para o componente `Items` . -```react.js +```jsx const Items = (props) => { return

    Current Quantity of Items in Cart: {props.quantity}

    }; @@ -14,7 +14,7 @@ const Items = (props) => { Para definir um propTypes, a sintaxe a ser seguida é -```react.js +```jsx itemName.propTypes = { props: PropTypes.dataType.isRequired }; @@ -22,7 +22,7 @@ itemName.propTypes = { Seguindo a sintaxe, o código a seguir deve ser definido abaixo do código fornecido para a `quantity` props do componente `Items` -```react.js +```jsx Items.propTypes = { quantity: PropTypes.number.isRequired }; diff --git a/guide/portuguese/certifications/front-end-libraries/redux/define-a-redux-action/index.md b/guide/portuguese/certifications/front-end-libraries/redux/define-a-redux-action/index.md index e637b4fd51..a4e22496ba 100644 --- a/guide/portuguese/certifications/front-end-libraries/redux/define-a-redux-action/index.md +++ b/guide/portuguese/certifications/front-end-libraries/redux/define-a-redux-action/index.md @@ -6,7 +6,7 @@ localeTitle: Definir uma ação do Redux Aqui está como declarar uma ação do Redux. -```react.js +```jsx let action={ type: 'LOGIN' } diff --git a/guide/portuguese/certifications/front-end-libraries/redux/dispatch-an-action-event/index.md b/guide/portuguese/certifications/front-end-libraries/redux/dispatch-an-action-event/index.md index d53d222588..51575570d1 100644 --- a/guide/portuguese/certifications/front-end-libraries/redux/dispatch-an-action-event/index.md +++ b/guide/portuguese/certifications/front-end-libraries/redux/dispatch-an-action-event/index.md @@ -6,7 +6,7 @@ localeTitle: Despachar um Evento de Ação Despache a ação LOGIN para o armazenamento Redux chamando o método de dispatch e passe a ação criada por `loginAction()` . -```react.js +```jsx store.dispatch(loginAction()); ``` \ No newline at end of file diff --git a/guide/portuguese/certifications/front-end-libraries/redux/get-state-from-the-redux-store/index.md b/guide/portuguese/certifications/front-end-libraries/redux/get-state-from-the-redux-store/index.md index b0170c6f1b..f8dd2f5468 100644 --- a/guide/portuguese/certifications/front-end-libraries/redux/get-state-from-the-redux-store/index.md +++ b/guide/portuguese/certifications/front-end-libraries/redux/get-state-from-the-redux-store/index.md @@ -6,7 +6,7 @@ localeTitle: Obtenha o estado da loja Redux Recuperar dados da loja usando o método `getState()` . -```react.js +```jsx let currentState = store.getState(); ``` \ No newline at end of file diff --git a/guide/portuguese/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-a-literal-string-with-different-possibilities/index.md b/guide/portuguese/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-a-literal-string-with-different-possibilities/index.md index a0929c0ac2..df5d72f0cd 100644 --- a/guide/portuguese/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-a-literal-string-with-different-possibilities/index.md +++ b/guide/portuguese/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-a-literal-string-with-different-possibilities/index.md @@ -14,7 +14,7 @@ Dentro da string literal, coloque os nomes dos animais de estimação, cada um s ## Solução: -```javascriot +```js let petString = "James has a pet cat."; let petRegex = /dog|cat|bird|fish/; let result = petRegex.test(petString); diff --git a/guide/portuguese/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-single-characters-not-specified/index.md b/guide/portuguese/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-single-characters-not-specified/index.md index d4176e681a..bc702391e5 100644 --- a/guide/portuguese/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-single-characters-not-specified/index.md +++ b/guide/portuguese/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-single-characters-not-specified/index.md @@ -24,7 +24,7 @@ Em caso afirmativo, verifique se você está adicionando os sinalizadores apropr Certifique-se de verificar se o seu intervalo de numeração está correto - o desafio nos pede para negar todos os números de 0 a 99. Isso pode ser feito usando o cursor negado colocado imediatamente após o primeiro parêntese de abertura do seu regexp. -```javacsript +```js let numbersRegExp = /[^0-99]/ig; ``` diff --git a/guide/portuguese/containers/docker/creating-a-new-container/index.md b/guide/portuguese/containers/docker/creating-a-new-container/index.md index decfa81fcd..9e59354ce3 100644 --- a/guide/portuguese/containers/docker/creating-a-new-container/index.md +++ b/guide/portuguese/containers/docker/creating-a-new-container/index.md @@ -12,7 +12,7 @@ docker create [OPTIONS] IMAGE [COMMAND] [ARG...] Crie e inicie um contêiner -```sh +```shell $ docker create -t -i fedora bash ``` \ No newline at end of file diff --git a/guide/portuguese/cplusplus/arrays/index.md b/guide/portuguese/cplusplus/arrays/index.md index 3967028caf..85d72d7a1d 100644 --- a/guide/portuguese/cplusplus/arrays/index.md +++ b/guide/portuguese/cplusplus/arrays/index.md @@ -8,13 +8,13 @@ Uma matriz é uma série de elementos do mesmo tipo de dados que são armazenado Por exemplo, uma matriz contendo 5 valores inteiros chamados números é declarada da seguinte forma: -```C++ +```cpp int numbers [5]; ``` Inicialização: -```C++ +```cpp //Initialization with entries: int numbers [5] = {1, 2, 3, 4, 5}; @@ -34,7 +34,7 @@ Inicialização: Elementos de uma matriz podem ser acessados ​​por referência de sua posição na matriz. (Comece a contar de 0). Exemplo: -```C++ +```cpp x = numbers[0]; // = 1. [0] == first position numbers[2] = 55; // Sets the third position (3) to the new number 55 //numbers[] is now: {1, 2, 55, 4, 5} diff --git a/guide/portuguese/cplusplus/input-and-output/index.md b/guide/portuguese/cplusplus/input-and-output/index.md index b2a4376f14..65d83aced4 100644 --- a/guide/portuguese/cplusplus/input-and-output/index.md +++ b/guide/portuguese/cplusplus/input-and-output/index.md @@ -10,7 +10,7 @@ Para imprimir coisas no console, ou ler a partir dele, use `cout` e `cin` , que O programa "Hello World" usa `cout` para imprimir "Hello World!" para o console: -```C++ +```cpp #include using namespace std; @@ -30,24 +30,24 @@ As duas primeiras linhas no topo são necessárias para você usar `cout` e outr Quase tudo pode ser colocado em um fluxo: strings, números, variáveis, expressões, etc. Aqui estão alguns exemplos de inserções de fluxo válidas: -```C++ +```cpp // Notice we can use the number 42 and not the string "42". cout << "The meaning of life is " << 42 << endl;` // Output: The meaning of life is 42 ``` -```C++ +```cpp string name = "Tim"; cout << "Except for you, " << name << endl;`// Output: Except for you, Tim ``` -```C++ +```cpp string name = "Tim"; cout << name; cout << " is a great guy!" << endl;` // Output: Tim is a great guy! ``` -```C++ +```cpp int a = 3; cout << a*2 + 18/a << endl;`// Output: 12 ``` @@ -56,7 +56,7 @@ int a = 3; C ++ sempre coloca _você_ no controle e faz exatamente as coisas que você diz para fazer. Isso às vezes pode ser surpreendente, como no exemplo a seguir: -```C++ +```cpp string name = "Sarah"; cout << "Good morning" << name << "how are you today? << endl; ``` @@ -65,7 +65,7 @@ Você pode esperar que seja impresso "Bom dia Sarah, como você está hoje?", Ma Quebras de linha também não acontecem sozinhas. Você pode pensar que isso imprimiria uma receita em quatro linhas: -```C++ +```cpp cout << "To make bread, you need:"; cout << "* One egg"; cout << "* One water"; @@ -76,7 +76,7 @@ mas a saída é na verdade tudo em uma linha: "Para fazer pão, você precisa: \ Você poderia consertar isso adicionando `endl` s após cada linha, porque, como discutido anteriormente, o `endl` insere um caractere de nova linha no fluxo de saída. No entanto, isso também força o buffer a ser liberado, o que nos perde um pouco o desempenho, já que poderíamos imprimir todas as linhas de uma só vez. Portanto, o melhor seria adicionar caracteres reais de nova linha no final das linhas e usar somente `endl` no final: -```C++ +```cpp cout << "To make bread, you need:\n"; cout << "* One egg\n"; cout << "* One water\n"; @@ -89,7 +89,7 @@ Se você está apenas imprimindo uma pequena receita, o tempo que você economiz Para ler a partir do console, você usa o _fluxo de entrada_ `cin` da mesma forma como faria `cout` , mas em vez de colocar as coisas em `cin` , você "tirá-los". O programa a seguir lê dois números do usuário e os adiciona juntos: -```C++ +```cpp #include using namespace std; @@ -112,7 +112,7 @@ Vale a pena notar que o `cin` irá parar todo o programa para esperar que o usu O operador de extração `<<` pode ser encadeado também. Aqui está o mesmo programa da última vez, mas escrito de uma maneira mais concisa: -```C++ +```cpp #include using namespace std; diff --git a/guide/portuguese/cplusplus/map/index.md b/guide/portuguese/cplusplus/map/index.md index 78897d74ad..b516ee19d7 100644 --- a/guide/portuguese/cplusplus/map/index.md +++ b/guide/portuguese/cplusplus/map/index.md @@ -16,7 +16,7 @@ localeTitle: Mapa Aqui está um exemplo: -```c++ +```cpp #include #include @@ -56,7 +56,7 @@ a => 10 Inserindo dados com a função de membro de inserção. -```c++ +```cpp myMap.insert(make_pair("earth", 1)); myMap.insert(make_pair("moon", 2)); ``` @@ -69,7 +69,7 @@ Nós também podemos inserir dados em std :: map usando operator \[\] ie Para acessar os elementos do mapa, você precisa criar um iterador para ele. Aqui está um exemplo como dito antes. -```c++ +```cpp map::iterator it; for(it=first.begin(); it!=first.end(); ++it){ cout << it->first << " => " << it->second << '\n'; diff --git a/guide/portuguese/cplusplus/terms-to-know-for-beginners/index.md b/guide/portuguese/cplusplus/terms-to-know-for-beginners/index.md index 454bd7efbd..c70a60668d 100644 --- a/guide/portuguese/cplusplus/terms-to-know-for-beginners/index.md +++ b/guide/portuguese/cplusplus/terms-to-know-for-beginners/index.md @@ -1,7 +1,8 @@ ---- -title: IDE and Printing different text -localeTitle: IDE e impressão de texto diferente ---- # Introdução a um IDE e impressão de texto diferente: +--- +title: IDE and Printing different text +localeTitle: IDE e impressão de texto diferente +--- +# Introdução a um IDE e impressão de texto diferente: * No último artigo, alguns links para download de software necessários para a programação. Um software como esse é conhecido como IDE. **IDE significa Integrated Development Environment** @@ -33,8 +34,7 @@ Um programa de amostra: ``` O código acima retorna um erro porque na linha 2, usamos dois pontos (:) em vez de um ponto-e-vírgula (;) Então, vamos depurar o erro: - -```C++ +```cpp #include using namespace std ; int main() @@ -139,4 +139,4 @@ Isso é avaliado como falso `cpp (7!=5);` Isso é avaliado como verdadeiro -[Um resumo de todas as declarações de impressão usadas neste artigo. Sinta-se à vontade para mexer no código! :)](https://repl.it/L4ox) \ No newline at end of file +[Um resumo de todas as declarações de impressão usadas neste artigo. Sinta-se à vontade para mexer no código! :)](https://repl.it/L4ox) diff --git a/guide/portuguese/cplusplus/while-loop/index.md b/guide/portuguese/cplusplus/while-loop/index.md index c72fdfc002..e9cc15b9aa 100644 --- a/guide/portuguese/cplusplus/while-loop/index.md +++ b/guide/portuguese/cplusplus/while-loop/index.md @@ -10,7 +10,7 @@ Um ponto-chave do loop while é que o loop pode não ser executado. Quando a con Exemplo: -```C++ +```cpp #include using namespace std; diff --git a/guide/portuguese/csharp/for/index.md b/guide/portuguese/csharp/for/index.md index 09f4032a4d..39bc4919d2 100644 --- a/guide/portuguese/csharp/for/index.md +++ b/guide/portuguese/csharp/for/index.md @@ -8,7 +8,7 @@ O loop `for` executa um bloco de código até que uma condição especificada se ## Sintaxe -```C# +```csharp for ((Initial variable); (condition); (step)) { (code) @@ -25,7 +25,7 @@ O loop C # for consiste em três expressões e algum código. ## Exemplo -```C# +```csharp int[] array = { 1, 2, 3, 4, 5 }; for (int i = 0; i < array.Length; i++) { diff --git a/guide/portuguese/csharp/null-coalescing-operator/index.md b/guide/portuguese/csharp/null-coalescing-operator/index.md index 16f2445ced..d4c62f3b39 100644 --- a/guide/portuguese/csharp/null-coalescing-operator/index.md +++ b/guide/portuguese/csharp/null-coalescing-operator/index.md @@ -10,7 +10,7 @@ O operador de coalescência nula em C # é usado para ajudar a designar uma vari Como `name` é `null` , o `clientName` receberá o valor "John Doe". -```cs +```csharp string name = null; string clientName = name ?? "John Doe"; @@ -18,7 +18,7 @@ string name = null; Console.WriteLine(clientName); ``` -```cs +```csharp > John Doe ``` @@ -26,7 +26,7 @@ string name = null; Como o `name` não é `null` , o `clientName` receberá o valor do `name` , que é "Jane Smith". -```cs +```csharp string name = "Jane Smith"; string clientName = name ?? "John Doe"; @@ -34,7 +34,7 @@ string name = "Jane Smith"; Console.WriteLine(clientName); ``` -```cs +```csharp > Jane Smith ``` @@ -42,7 +42,7 @@ string name = "Jane Smith"; Você poderia usar uma instrução `if...else` para testar a presença de `null` e atribuir um valor diferente. -```cs +```csharp string clientName; if (name != null) @@ -53,7 +53,7 @@ string clientName; No entanto, isso pode ser muito simplificado usando o operador de coalescência nula. -```cs +```csharp string clientName = name ?? "John Doe"; ``` @@ -61,13 +61,13 @@ string clientName = name ?? "John Doe"; Também é possível usar o operador condicional para testar a presença de `null` e atribuir um valor diferente. -```cs +```csharp string clientName = name != null ? name : "John Doe"; ``` Novamente, isso pode ser simplificado usando o operador de coalescência nula. -```cs +```csharp string clientName = name ?? "John Doe"; ``` diff --git a/guide/portuguese/csharp/xaml/index.md b/guide/portuguese/csharp/xaml/index.md index ef6132c20f..499bf8b248 100644 --- a/guide/portuguese/csharp/xaml/index.md +++ b/guide/portuguese/csharp/xaml/index.md @@ -26,7 +26,7 @@ Criando um TextBlock com várias propriedades. TextBlocks geralmente são empreg O exemplo a seguir mostra um rótulo com "Hello World!" como seu conteúdo em um contêiner de nível superior chamado UserControl. -```XAML +```xml diff --git a/guide/portuguese/css/breakpoints/index.md b/guide/portuguese/css/breakpoints/index.md index f6d618b52f..5afaf47080 100644 --- a/guide/portuguese/css/breakpoints/index.md +++ b/guide/portuguese/css/breakpoints/index.md @@ -174,7 +174,7 @@ Os pontos de interrupção baseados no conteúdo, e não no dispositivo, são me Você também pode definir uma largura mínima e máxima, o que permite que você faça experimentos com intervalos diferentes. Este dispara entre smar-phone e tamanhos maiores de desktops e monitores -```code +```css @media only screen and (min-width: 700px) and (max-width: 1500px) { something { something: something; diff --git a/guide/portuguese/go/installing-go/arch-linux/index.md b/guide/portuguese/go/installing-go/arch-linux/index.md index 33942a7376..857750a83e 100644 --- a/guide/portuguese/go/installing-go/arch-linux/index.md +++ b/guide/portuguese/go/installing-go/arch-linux/index.md @@ -6,7 +6,7 @@ localeTitle: Instalando o Go no Arch Linux usando o pacman Usar o Gerenciador de Pacotes do Arch Linux (pacman) é a maneira mais fácil de instalar o Go. Com base na filosofia Arch Linux de fornecer novas versões de software muito rapidamente, você terá uma versão muito atual do go. Antes de instalar o pacote go, você precisa atualizar o sistema. -```sh +```shell $ sudo pacman -Syu $ sudo pacman -S go ``` @@ -15,7 +15,7 @@ $ sudo pacman -Syu Para verificar se foi instalado com sucesso, use: -```sh +```shell $ go version > go version go2.11.1 linux/amd64 ``` diff --git a/guide/portuguese/go/installing-go/mac-package-installer/index.md b/guide/portuguese/go/installing-go/mac-package-installer/index.md index 6d296f0772..1fb03d3c58 100644 --- a/guide/portuguese/go/installing-go/mac-package-installer/index.md +++ b/guide/portuguese/go/installing-go/mac-package-installer/index.md @@ -12,7 +12,7 @@ Na [página de download do golang](https://golang.org/dl/) , obtenha o instalado Para verificar se foi instalado com sucesso, abra seu terminal e use: -```sh +```shell $ go version ``` diff --git a/guide/portuguese/go/installing-go/mac-tarball/index.md b/guide/portuguese/go/installing-go/mac-tarball/index.md index 92f9b3e880..21276447c4 100644 --- a/guide/portuguese/go/installing-go/mac-tarball/index.md +++ b/guide/portuguese/go/installing-go/mac-tarball/index.md @@ -25,7 +25,7 @@ $ curl -O https://storage.googleapis.com/golang/go1.9.1.darwin-amd64.tar.gz Para verificar se foi instalado com sucesso, use: -```sh +```shell $ go version ``` diff --git a/guide/portuguese/go/installing-go/ubuntu-apt-get/index.md b/guide/portuguese/go/installing-go/ubuntu-apt-get/index.md index bbf181e53f..6b2ea8e231 100644 --- a/guide/portuguese/go/installing-go/ubuntu-apt-get/index.md +++ b/guide/portuguese/go/installing-go/ubuntu-apt-get/index.md @@ -8,7 +8,7 @@ Usar o Gerenciador de Pacotes do Ubuntu (apt-get) é a maneira mais fácil de in > Como desta escrita, a versão do go do Ubuntu Xenial é 1.6.1, enquanto o mais recente versão estável é 1.9.1 -```sh +```shell $ sudo apt-get update $ sudo apt-get install golang-go ``` @@ -17,7 +17,7 @@ $ sudo apt-get update Para verificar se foi instalado com sucesso, use: -```sh +```shell $ go version > go version go1.9.1 linux/amd64 ``` diff --git a/guide/portuguese/go/installing-go/ubuntu-tarball/index.md b/guide/portuguese/go/installing-go/ubuntu-tarball/index.md index 43a7dc9ca4..67f845e749 100644 --- a/guide/portuguese/go/installing-go/ubuntu-tarball/index.md +++ b/guide/portuguese/go/installing-go/ubuntu-tarball/index.md @@ -10,7 +10,7 @@ localeTitle: Instalando o Go no Ubuntu usando um tarball Antes de continuar, verifique se seu sistema é de 32 ou 64 bits. Se você não sabe, execute o seguinte comando para descobrir: -```sh +```shell $ lscpu | grep Architecture ``` @@ -52,7 +52,7 @@ $ wget https://storage.googleapis.com/golang/go1.9.1.linux-386.tar.gz Para verificar se foi instalado com sucesso, use: -```sh +```shell $ go version > go version go1.9.1 linux/amd64 ``` diff --git a/guide/portuguese/javascript/with/index.md b/guide/portuguese/javascript/with/index.md index 804f1c8d66..e7563995b2 100644 --- a/guide/portuguese/javascript/with/index.md +++ b/guide/portuguese/javascript/with/index.md @@ -10,7 +10,7 @@ JavaScript `with` instrução é uma forma abreviada de editar várias proprieda ### Sintaxe -```syntax +```js with (expression) statement ``` diff --git a/guide/portuguese/linux/getting-started/index.md b/guide/portuguese/linux/getting-started/index.md index e5bd149865..ddbbc57d05 100644 --- a/guide/portuguese/linux/getting-started/index.md +++ b/guide/portuguese/linux/getting-started/index.md @@ -22,7 +22,7 @@ No Debian / Ubuntu e derivados, o atalho para abrir o cli (Comman Line Interface cd (Change Directory) - O comando cd é um dos comandos que você mais usará na linha de comando do linux. Ele permite que você mude seu diretório de trabalho. Você o usa para se movimentar dentro da hierarquia do seu sistema de arquivos. -```unix +```shell cd ``` @@ -30,7 +30,7 @@ Usando apenas o comando cd, o diretório atual será alterado para o diretório ls (List) - Este comando lista o conteúdo no diretório atual. Também pode ser usado para listar informações de arquivos. -```unix +```shell ls ``` diff --git a/guide/portuguese/linux/how-to-use-sftp-to-securely-transfer-files-with-a-remote-server/index.md b/guide/portuguese/linux/how-to-use-sftp-to-securely-transfer-files-with-a-remote-server/index.md index 675a2a233b..ba42312a16 100644 --- a/guide/portuguese/linux/how-to-use-sftp-to-securely-transfer-files-with-a-remote-server/index.md +++ b/guide/portuguese/linux/how-to-use-sftp-to-securely-transfer-files-with-a-remote-server/index.md @@ -10,7 +10,7 @@ Este artigo é um tutorial rápido sobre como usar o protocolo SFTP para trocar Se ainda não o fez, teste que você é capaz de acessar o SSH no servidor. O SFTP usa o protocolo Secure Shell (SSH), portanto, se você não puder usar o SSH, provavelmente não será capaz de fazer SFTP. -```unix +```shell ssh your_username@hostname_or_ip_address ``` @@ -18,13 +18,13 @@ ssh your_username@hostname_or_ip_address Isso usa a mesma sintaxe do SSH e abre uma sessão na qual você pode transferir arquivos. -```unix +```shell sftp your_username@hostname_or_ip_address ``` Para listar comandos úteis: -```unix +```shell help ``` @@ -32,19 +32,19 @@ help Para baixar um arquivo: -```unix +```shell get ``` Para baixar uma pasta e seu conteúdo, use o sinalizador "-r" (também funciona para upload): -```unix +```shell get -r ``` Para fazer upload de um arquivo: -```unix +```shell put ``` @@ -52,13 +52,13 @@ put Para alterar a pasta local: -```unix +```shell lcd ``` Para alterar a pasta remota: -```unix +```shell cd ``` \ No newline at end of file diff --git a/guide/portuguese/linux/setting-up-yum-repositories-in-redhat-linux/index.md b/guide/portuguese/linux/setting-up-yum-repositories-in-redhat-linux/index.md index 01f1aa6acf..14716d4ea6 100644 --- a/guide/portuguese/linux/setting-up-yum-repositories-in-redhat-linux/index.md +++ b/guide/portuguese/linux/setting-up-yum-repositories-in-redhat-linux/index.md @@ -10,7 +10,7 @@ O arquivo do pacote RPM é um arquivo do Red Hat Package Manager e permite a ins Passo 1: Verifique se existem repositórios existentes ou não. -```sh +```shell #yum repolist ``` @@ -18,19 +18,19 @@ Você vai descobrir que não há repositórios. Etapa 2: alterar o diretório para -```sh +```shell #cd /etc/yum.repos.d ``` Etapa 3: criar novo arquivo -```sh +```shell #vim myrepo.repo ``` Etapa 4: digite as seguintes linhas no arquivo -```sh +```shell [file-name] name=filename baseurl="location of yum repositories" @@ -41,7 +41,7 @@ Etapa 5: Salvar e Sair Etapa 6: repita a etapa 1 -```sh +```shell You Will find repositories ``` \ No newline at end of file diff --git a/guide/portuguese/linux/the-anatomy-of-the-linux-command-line/index.md b/guide/portuguese/linux/the-anatomy-of-the-linux-command-line/index.md index 8de07bb238..999c369171 100644 --- a/guide/portuguese/linux/the-anatomy-of-the-linux-command-line/index.md +++ b/guide/portuguese/linux/the-anatomy-of-the-linux-command-line/index.md @@ -14,7 +14,7 @@ No Linux, os comandos são fornecidos (digitados) no terminal. Embora o aplicati Para começar a usar o terminal aberto (para o Ubuntu, simplesmente segure o Ctrl + Alt + T) e você será recebido por uma série de personagens organizados neste formato; -```linux +```shell user_name@machine_name:~$ ``` diff --git a/guide/portuguese/nodejs/index.md b/guide/portuguese/nodejs/index.md index ac75002f55..889f817840 100644 --- a/guide/portuguese/nodejs/index.md +++ b/guide/portuguese/nodejs/index.md @@ -32,7 +32,7 @@ import time **Node.js** -```node +```js function my_io_task() { setTimeout(function() { console.log('done'); diff --git a/guide/portuguese/php/loops/for-loop/index.md b/guide/portuguese/php/loops/for-loop/index.md index 0de5159a43..cc7d6ced6b 100644 --- a/guide/portuguese/php/loops/for-loop/index.md +++ b/guide/portuguese/php/loops/for-loop/index.md @@ -52,7 +52,7 @@ Ao indexar em um array muitas vezes é fácil exceder os limites do array (ex. T Isto irá produzir: -```txt +```shell int(1) int(2) int(3) NULL ``` diff --git a/guide/portuguese/python/python-coding-standards/index.md b/guide/portuguese/python/python-coding-standards/index.md index 74e6508e3d..4296a5a9a1 100644 --- a/guide/portuguese/python/python-coding-standards/index.md +++ b/guide/portuguese/python/python-coding-standards/index.md @@ -22,7 +22,7 @@ Nós amamos aderir às convenções. A comunidade de usuários de python criou u Veja como você verifica se o seu código python atende aos padrões dele. -```console +```shell :~$ pip install pep8 :~$ pep8 --first myCode.py ``` diff --git a/guide/portuguese/react/what-are-react-props/index.md b/guide/portuguese/react/what-are-react-props/index.md index 1bcf1f886f..d3ebc24f41 100644 --- a/guide/portuguese/react/what-are-react-props/index.md +++ b/guide/portuguese/react/what-are-react-props/index.md @@ -13,7 +13,7 @@ Começando com o React versão 15.5, esse recurso foi movido para um pacote sepa Para usá-lo, é necessário que ele seja adicionado ao projeto como uma dependência, digitando o seguinte comando em um console. -```sh +```shell npm install --save prop-types ``` diff --git a/guide/portuguese/redux/tutorial/index.md b/guide/portuguese/redux/tutorial/index.md index e651f89022..c3cf5e9641 100644 --- a/guide/portuguese/redux/tutorial/index.md +++ b/guide/portuguese/redux/tutorial/index.md @@ -1,7 +1,8 @@ ---- -title: React Redux Basic Setup -localeTitle: React Redux Basic Setup ---- ## React Redux Basic Setup +--- +title: React Redux Basic Setup +localeTitle: React Redux Basic Setup +--- +## React Redux Basic Setup Neste guia, será apresentado ao leitor como configurar um aplicativo simples React e Redux. @@ -12,8 +13,7 @@ Baseia-se no princípio de que um aplicativo [Node.js](https://nodejs.org/) já Assumindo que tudo esteja configurado e funcionando corretamente, existem alguns pacotes que precisam ser adicionados para que o Redux funcione com o React. Abra um terminal dentro da pasta do projeto que foi criada e emita o seguinte comando - -```sh +```shell npm install --save react react react-dom react-redux react-router redux ``` @@ -277,4 +277,4 @@ Como este guia nada mais é do que uma introdução sobre como o reagir e o redu [Redux Api](http://redux.js.org/docs/api/) -[Exemplos de Redux](https://github.com/reactjs/redux/tree/master/examples) \ No newline at end of file +[Exemplos de Redux](https://github.com/reactjs/redux/tree/master/examples) diff --git a/guide/portuguese/rust/installing-rust/index.md b/guide/portuguese/rust/installing-rust/index.md index fb3ee52cee..d0b75b4da4 100644 --- a/guide/portuguese/rust/installing-rust/index.md +++ b/guide/portuguese/rust/installing-rust/index.md @@ -1,7 +1,8 @@ ---- -title: Installing Rust -localeTitle: Instalando Rust ---- # Instalando Rust +--- +title: Installing Rust +localeTitle: Instalando Rust +--- +# Instalando Rust Usar `rustup` é preferido para a instalação Rust. `rustup` instala e gerencia o Rust para o seu sistema. @@ -12,8 +13,7 @@ Visite o [site](https://rustup.rs) do [rustup](https://rustup.rs) e baixe o `rus ## Instalando o Rust em outros sistemas operacionais (Mac OS X, Linux, BSD, Unix) Abra seu terminal e digite este comando: - -```sh +```shell curl https://sh.rustup.rs -sSf | sh ``` @@ -22,8 +22,7 @@ Isso irá buscar o instalador do `rustup` e, por sua vez, buscará tudo o que vo # Verificando instalação Instalar `rustup` irá instalar todas as coisas relevantes para ferrugem, mas o mais relevante é instalar o compilador e o gerenciador de pacotes. Para verificar se tudo está instalado, execute este comando: - -```sh +```shell cargo version ``` @@ -31,4 +30,4 @@ Agora você poderá usar o Rust! # Mais Informações -Para saber mais sobre o processo de instalação, visite https://www.rust-lang.org/pt-BR/install.html \ No newline at end of file +Para saber mais sobre o processo de instalação, visite https://www.rust-lang.org/pt-BR/install.html diff --git a/guide/portuguese/software-engineering/design-patterns/singleton/index.md b/guide/portuguese/software-engineering/design-patterns/singleton/index.md index ff6964219c..d62b988d03 100644 --- a/guide/portuguese/software-engineering/design-patterns/singleton/index.md +++ b/guide/portuguese/software-engineering/design-patterns/singleton/index.md @@ -126,7 +126,7 @@ obj_0 = MyClass() ## Singleton no iOS -```Swift4 +```swift class Singleton { static let sharedInstance = Singleton() diff --git a/guide/russian/algorithms/flood-fill/index.md b/guide/russian/algorithms/flood-fill/index.md index 883ecf1203..0d3456193b 100644 --- a/guide/russian/algorithms/flood-fill/index.md +++ b/guide/russian/algorithms/flood-fill/index.md @@ -27,7 +27,7 @@ Flood fill - это алгоритм, используемый в основно Для получения дополнительной информации, вот фрагмент кода, описывающий функцию: -```c++ +```cpp int wall = -1; void flood_fill(int pos_x, int pos_y, int target_color, int color) @@ -80,7 +80,7 @@ int wall = -1; У вас есть следующий ввод: -```c++ +```cpp 2 4 4 0 0 0 1 0 0 1 1 diff --git a/guide/russian/algorithms/lee-algorithm/index.md b/guide/russian/algorithms/lee-algorithm/index.md index cad519e5e4..0934baf17c 100644 --- a/guide/russian/algorithms/lee-algorithm/index.md +++ b/guide/russian/algorithms/lee-algorithm/index.md @@ -21,7 +21,7 @@ C ++ имеет очередь, уже реализованную в библи Код C ++: -```c++ +```cpp int dl[] = {-1, 0, 1, 0}; // these arrays will help you travel in the 4 directions more easily int dc[] = {0, 1, 0, -1}; diff --git a/guide/russian/algorithms/search-algorithms/binary-search/index.md b/guide/russian/algorithms/search-algorithms/binary-search/index.md index 9dedcea6af..55c7e7ce7d 100644 --- a/guide/russian/algorithms/search-algorithms/binary-search/index.md +++ b/guide/russian/algorithms/search-algorithms/binary-search/index.md @@ -174,7 +174,7 @@ int binarySearch(int a[], int l, int r, int x) { ### Реализация C / C ++ -```C++ +```cpp int binary_search(int arr[], int l, int r, int target) { if (r >= l) @@ -208,7 +208,7 @@ def binary_search(arr, l, r, target): ### Пример в C ++ -```c++ +```cpp // Binary Search using iteration int binary_search(int arr[], int beg, int end, int num) { @@ -225,7 +225,7 @@ def binary_search(arr, l, r, target): } ``` -```c++ +```cpp // Binary Search using recursion int binary_search(int arr[], int beg, int end, int num) { diff --git a/guide/russian/algorithms/search-algorithms/linear-search/index.md b/guide/russian/algorithms/search-algorithms/linear-search/index.md index 91d76ab6e0..9946bb5fbb 100644 --- a/guide/russian/algorithms/search-algorithms/linear-search/index.md +++ b/guide/russian/algorithms/search-algorithms/linear-search/index.md @@ -75,7 +75,7 @@ def linear_search(target, array) ### Пример в C ++ -```c++ +```cpp int linear_search(int arr[],int n,int num) { for(int i=0;i using namespace std; void heapify(int arr[], int n, int i) diff --git a/guide/russian/algorithms/sorting-algorithms/insertion-sort/index.md b/guide/russian/algorithms/sorting-algorithms/insertion-sort/index.md index d3122d89c7..06aec0627e 100644 --- a/guide/russian/algorithms/sorting-algorithms/insertion-sort/index.md +++ b/guide/russian/algorithms/sorting-algorithms/insertion-sort/index.md @@ -92,7 +92,7 @@ localeTitle: Вставка Сортировка Ниже алгоритм немного оптимизирован, чтобы избежать замены `key` элемента на каждой итерации. Здесь `key` элемент будет заменен в конце итерации (шаг). -```Algorithm +``` InsertionSort(arr[]) for j = 1 to arr.length key = arr[j] diff --git a/guide/russian/algorithms/sorting-algorithms/merge-sort/index.md b/guide/russian/algorithms/sorting-algorithms/merge-sort/index.md index 1866ae3e19..658dab66b2 100644 --- a/guide/russian/algorithms/sorting-algorithms/merge-sort/index.md +++ b/guide/russian/algorithms/sorting-algorithms/merge-sort/index.md @@ -23,7 +23,7 @@ T(n) = 2T(n/2) + n Подсчитая количество повторений n в сумме в конце, мы видим, что есть lg n + 1 из них. Таким образом, время работы n (lg n + 1) = n lg n + n. Заметим, что n lg n + n 0, поэтому время работы O (n lg n). -```Algorithm +``` MergeSort(arr[], left, right): If right > l: 1. Find the middle point to divide the array into two halves: diff --git a/guide/russian/c/math/index.md b/guide/russian/c/math/index.md index 174121b26a..81fae23321 100644 --- a/guide/russian/c/math/index.md +++ b/guide/russian/c/math/index.md @@ -132,7 +132,8 @@ double result = 23.0 / 2; C предоставляет математическую библиотеку ( `math.h` ), которая предоставляет множество полезных математических функций. Например, мощность числа может быть рассчитана как: -```#include +```c +#include int result = pow(2,3) // will result in 2*2*2 or 8 ``` diff --git a/guide/russian/certifications/apis-and-microservices/basic-node-and-express/use-body-parser-to-parse-post-requests/index.md b/guide/russian/certifications/apis-and-microservices/basic-node-and-express/use-body-parser-to-parse-post-requests/index.md index edb8476d74..3813798638 100644 --- a/guide/russian/certifications/apis-and-microservices/basic-node-and-express/use-body-parser-to-parse-post-requests/index.md +++ b/guide/russian/certifications/apis-and-microservices/basic-node-and-express/use-body-parser-to-parse-post-requests/index.md @@ -6,7 +6,7 @@ localeTitle: Использовать body-parser для запросов Parse Тело-парсер уже должен быть добавлен в ваш проект, если вы использовали предоставленный шаблон, но если он не должен быть там: -```code +```json "dependencies": { "body-parser": "^1.4.3", ... diff --git a/guide/russian/certifications/front-end-libraries/react/change-inline-css-conditionally-based-on-component-state/index.md b/guide/russian/certifications/front-end-libraries/react/change-inline-css-conditionally-based-on-component-state/index.md index 7cd7c2f50d..fdbe67a4a5 100644 --- a/guide/russian/certifications/front-end-libraries/react/change-inline-css-conditionally-based-on-component-state/index.md +++ b/guide/russian/certifications/front-end-libraries/react/change-inline-css-conditionally-based-on-component-state/index.md @@ -58,7 +58,7 @@ class GateKeeper extends React.Component { Напишите условный оператор, который оценивается в соответствии с вашим состоянием, как указано в описании задачи, проверяет длину ввода и назначает новый объект переменной inputStyle. -```react.js +```jsx if (this.state.input.length > 15) { inputStyle = { border: '3px solid red' diff --git a/guide/russian/certifications/front-end-libraries/react/create-a-controlled-form/index.md b/guide/russian/certifications/front-end-libraries/react/create-a-controlled-form/index.md index 57c459091e..bbb54aac1d 100644 --- a/guide/russian/certifications/front-end-libraries/react/create-a-controlled-form/index.md +++ b/guide/russian/certifications/front-end-libraries/react/create-a-controlled-form/index.md @@ -10,13 +10,13 @@ localeTitle: Создание управляемой формы ### Решение -```react.js +```jsx ``` Затем создайте метод handleSubmit для вашего компонента. Во-первых, поскольку ваша форма отправляется, вам придется не обновлять страницу. Во-вторых, вызовите метод `setState()` , передавая в объект разные пары ключ-значение, которые вы хотите изменить. В этом случае вы хотите установить 'submit' в значение переменной 'input' и установить 'input' в пустую строку. -```react.js +```jsx handleSubmit(event) { event.preventDefault(); this.setState({ diff --git a/guide/russian/certifications/front-end-libraries/react/give-sibling-elements-a-unique-key-attribute/index.md b/guide/russian/certifications/front-end-libraries/react/give-sibling-elements-a-unique-key-attribute/index.md index 28689ca90a..cd9da9ae6e 100644 --- a/guide/russian/certifications/front-end-libraries/react/give-sibling-elements-a-unique-key-attribute/index.md +++ b/guide/russian/certifications/front-end-libraries/react/give-sibling-elements-a-unique-key-attribute/index.md @@ -12,7 +12,7 @@ localeTitle: Дайте сиблинг-элементам уникальный Просто добавьте `key` атрибут в `
  • ` чтобы сделать уникальный -```react.js +```jsx const renderFrameworks = frontEndFrameworks.map((item) =>
  • {item}
  • ); diff --git a/guide/russian/certifications/front-end-libraries/react/introducing-inline-styles/index.md b/guide/russian/certifications/front-end-libraries/react/introducing-inline-styles/index.md index 8805ae791c..e53841685a 100644 --- a/guide/russian/certifications/front-end-libraries/react/introducing-inline-styles/index.md +++ b/guide/russian/certifications/front-end-libraries/react/introducing-inline-styles/index.md @@ -10,7 +10,7 @@ localeTitle: Представление встроенных стилей Давайте проведем шаги, чтобы вы поняли разницу. Сначала установите тэг стиля в **объект JavaScript** . -```react.js +```jsx class Colorful extends React.Component { render() { return ( @@ -26,7 +26,7 @@ class Colorful extends React.Component { Во-вторых, давайте установим красный цвет. -```react.js +```jsx class Colorful extends React.Component { render() { return ( @@ -42,7 +42,7 @@ class Colorful extends React.Component { ### Спойлер -```react.js +```jsx class Colorful extends React.Component { render() { return ( diff --git a/guide/russian/certifications/front-end-libraries/react/override-default-props/index.md b/guide/russian/certifications/front-end-libraries/react/override-default-props/index.md index e10ff8d65a..21dca71448 100644 --- a/guide/russian/certifications/front-end-libraries/react/override-default-props/index.md +++ b/guide/russian/certifications/front-end-libraries/react/override-default-props/index.md @@ -6,7 +6,7 @@ localeTitle: Переопределить опоры по умолчанию Эта задача имеет переопределить значение по умолчанию реквизита `quantity` для компонента Items. Если значение по умолчанию `quantity` устанавливается в `0` . -```react.js +```jsx const Items = (props) => { return

    Current Quantity of Items in Cart: {props.quantity}

    } @@ -18,13 +18,13 @@ const Items = (props) => { Чтобы переопределить значение реквизита по умолчанию, синтаксис, который следует соблюдать, -```react.js +```jsx ``` После синтаксиса следующий код должен быть объявлен ниже данного кода -```react.js +```jsx ``` diff --git a/guide/russian/certifications/front-end-libraries/react/render-conditionally-from-props/index.md b/guide/russian/certifications/front-end-libraries/react/render-conditionally-from-props/index.md index cc23bbbf2c..29d01ab3f7 100644 --- a/guide/russian/certifications/front-end-libraries/react/render-conditionally-from-props/index.md +++ b/guide/russian/certifications/front-end-libraries/react/render-conditionally-from-props/index.md @@ -10,7 +10,7 @@ localeTitle: Отказывать условно от реквизита Измените `handleClick()` с правильной инструкцией по увеличению. -```react.js +```jsx handleClick() { this.setState({ counter: this.state.counter + 1 @@ -20,7 +20,7 @@ handleClick() { В методе `render()` используйте `Math.random()` как указано в описании задачи, и напишите тернарное выражение, чтобы передать `props` в компоненте **Results** . -```react.js +```jsx let expression = Math.random() > .5; {(expression == 1)? : } @@ -28,7 +28,7 @@ handleClick() { Затем `fiftyFifty` реквизит в компоненте Results. -```react.js +```jsx

    { this.props.fiftyFifty diff --git a/guide/russian/certifications/front-end-libraries/react/render-state-in-the-user-interface/index.md b/guide/russian/certifications/front-end-libraries/react/render-state-in-the-user-interface/index.md index a436f39dd0..4e8d37f9ed 100644 --- a/guide/russian/certifications/front-end-libraries/react/render-state-in-the-user-interface/index.md +++ b/guide/russian/certifications/front-end-libraries/react/render-state-in-the-user-interface/index.md @@ -12,7 +12,7 @@ localeTitle: Состояние визуализации в пользовате ## Решение -```react.js +```jsx class MyComponent extends React.Component { constructor(props) { super(props); diff --git a/guide/russian/certifications/front-end-libraries/react/render-with-an-ifelse-condition/index.md b/guide/russian/certifications/front-end-libraries/react/render-with-an-ifelse-condition/index.md index 707820d70f..51e84eed21 100644 --- a/guide/russian/certifications/front-end-libraries/react/render-with-an-ifelse-condition/index.md +++ b/guide/russian/certifications/front-end-libraries/react/render-with-an-ifelse-condition/index.md @@ -12,7 +12,7 @@ localeTitle: Отображать с условием If / Else ### Решение -```react.js +```jsx if (this.state.display === true) { return (
    @@ -25,7 +25,7 @@ if (this.state.display === true) { Затем создайте оператор else, который возвращает тот же JSX **без** элемента `h1` . -```react.js +```jsx else { return (
    diff --git a/guide/russian/certifications/front-end-libraries/react/use-a-ternary-expression-for-conditional-rendering/index.md b/guide/russian/certifications/front-end-libraries/react/use-a-ternary-expression-for-conditional-rendering/index.md index 1d31bb4ff7..4622e5bb91 100644 --- a/guide/russian/certifications/front-end-libraries/react/use-a-ternary-expression-for-conditional-rendering/index.md +++ b/guide/russian/certifications/front-end-libraries/react/use-a-ternary-expression-for-conditional-rendering/index.md @@ -17,7 +17,7 @@ condition ? expressionIfTrue : expressionIfFalse Вот образец решения с использованием тройного выражения. Сначала вам нужно объявить состояние в конструкторе, как это -```react.js +```jsx constructor(props) { super(props); // change code below this line @@ -33,7 +33,7 @@ constructor(props) { Тогда тернарный оператор -```react.js +```jsx { /* change code here */ (this.state.userAge >= 18) ? buttonTwo : (this.state.userAge== '')? buttonOne: buttonThree diff --git a/guide/russian/certifications/front-end-libraries/react/use-proptypes-to-define-the-props-you-expect/index.md b/guide/russian/certifications/front-end-libraries/react/use-proptypes-to-define-the-props-you-expect/index.md index b453f6563f..17e67e96fb 100644 --- a/guide/russian/certifications/front-end-libraries/react/use-proptypes-to-define-the-props-you-expect/index.md +++ b/guide/russian/certifications/front-end-libraries/react/use-proptypes-to-define-the-props-you-expect/index.md @@ -6,7 +6,7 @@ localeTitle: Используйте PropTypes для определения ре В этой задаче вы установили `propTypes` для компонента `Items` . -```react.js +```jsx const Items = (props) => { return

    Current Quantity of Items in Cart: {props.quantity}

    }; @@ -14,7 +14,7 @@ const Items = (props) => { Чтобы установить propTypes, синтаксис, который следует соблюдать, - это -```react.js +```jsx itemName.propTypes = { props: PropTypes.dataType.isRequired }; @@ -22,7 +22,7 @@ itemName.propTypes = { После синтаксиса следующий код должен быть установлен ниже заданного кода для `quantity` реквизитов компонента `Items` -```react.js +```jsx Items.propTypes = { quantity: PropTypes.number.isRequired }; diff --git a/guide/russian/certifications/front-end-libraries/redux/define-a-redux-action/index.md b/guide/russian/certifications/front-end-libraries/redux/define-a-redux-action/index.md index b5d2251ea5..5af8661dc2 100644 --- a/guide/russian/certifications/front-end-libraries/redux/define-a-redux-action/index.md +++ b/guide/russian/certifications/front-end-libraries/redux/define-a-redux-action/index.md @@ -6,7 +6,7 @@ localeTitle: Определение действия Redux Вот как объявить действие Redux. -```react.js +```jsx let action={ type: 'LOGIN' } diff --git a/guide/russian/certifications/front-end-libraries/redux/dispatch-an-action-event/index.md b/guide/russian/certifications/front-end-libraries/redux/dispatch-an-action-event/index.md index 314b6ed8c8..8ddfa3f11c 100644 --- a/guide/russian/certifications/front-end-libraries/redux/dispatch-an-action-event/index.md +++ b/guide/russian/certifications/front-end-libraries/redux/dispatch-an-action-event/index.md @@ -6,7 +6,7 @@ localeTitle: Отправка события Отправляйте действие LOGIN в хранилище Redux, вызывая метод отправки и передавая действие, созданное `loginAction()` . -```react.js +```jsx store.dispatch(loginAction()); ``` \ No newline at end of file diff --git a/guide/russian/certifications/front-end-libraries/redux/get-state-from-the-redux-store/index.md b/guide/russian/certifications/front-end-libraries/redux/get-state-from-the-redux-store/index.md index 22e222df77..ac22901d5b 100644 --- a/guide/russian/certifications/front-end-libraries/redux/get-state-from-the-redux-store/index.md +++ b/guide/russian/certifications/front-end-libraries/redux/get-state-from-the-redux-store/index.md @@ -6,7 +6,7 @@ localeTitle: Получить статус из магазина Redux `getState()` данные из хранилища с помощью `getState()` . -```react.js +```jsx let currentState = store.getState(); ``` \ No newline at end of file diff --git a/guide/russian/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-a-literal-string-with-different-possibilities/index.md b/guide/russian/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-a-literal-string-with-different-possibilities/index.md index 95221e1b5c..e8ec0d9543 100644 --- a/guide/russian/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-a-literal-string-with-different-possibilities/index.md +++ b/guide/russian/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-a-literal-string-with-different-possibilities/index.md @@ -14,7 +14,7 @@ localeTitle: Сопоставьте литеральную строку с ра ## Решение: -```javascriot +```js let petString = "James has a pet cat."; let petRegex = /dog|cat|bird|fish/; let result = petRegex.test(petString); diff --git a/guide/russian/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-single-characters-not-specified/index.md b/guide/russian/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-single-characters-not-specified/index.md index 108ce1f1e8..f5ed4179de 100644 --- a/guide/russian/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-single-characters-not-specified/index.md +++ b/guide/russian/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-single-characters-not-specified/index.md @@ -24,7 +24,7 @@ let exampleRegExp = /[^az]/; Не забудьте проверить правильность номера вашего номера - проблема требует от нас отрицания всех чисел от 0 до 99. Это можно сделать с помощью каретки negate, помещенной сразу после первой открытой скобки вашего регулярного выражения. -```javacsript +```js let numbersRegExp = /[^0-99]/ig; ``` diff --git a/guide/russian/computer-science/data-structures/stacks/index.md b/guide/russian/computer-science/data-structures/stacks/index.md index 4e58cdaf2b..c8da038ba1 100644 --- a/guide/russian/computer-science/data-structures/stacks/index.md +++ b/guide/russian/computer-science/data-structures/stacks/index.md @@ -17,7 +17,7 @@ localeTitle: Стеки Реализация стека возможна с использованием массивов или связанных списков. Ниже приведена простая реализация массива структуры данных стека с наиболее распространенными операциями. -```C++ +```cpp //Stack implementation using array in C++ //You can also include and then use the C++ STL Library stack class. diff --git a/guide/russian/containers/docker/creating-a-new-container/index.md b/guide/russian/containers/docker/creating-a-new-container/index.md index 1f55749926..c4a47bbd1c 100644 --- a/guide/russian/containers/docker/creating-a-new-container/index.md +++ b/guide/russian/containers/docker/creating-a-new-container/index.md @@ -12,7 +12,7 @@ docker create [OPTIONS] IMAGE [COMMAND] [ARG...] Создание и запуск контейнера -```sh +```shell $ docker create -t -i fedora bash ``` \ No newline at end of file diff --git a/guide/russian/cplusplus/for-loop/index.md b/guide/russian/cplusplus/for-loop/index.md index 70fdc6dc88..2fc03b8496 100644 --- a/guide/russian/cplusplus/for-loop/index.md +++ b/guide/russian/cplusplus/for-loop/index.md @@ -37,7 +37,7 @@ for ( init; condition;) { ## РЕАЛИЗАЦИЯ: -```C++ +```cpp #include using namespace std; // Here we use the scope resolution operator to define the scope of the standar functions as std:: diff --git a/guide/russian/cplusplus/input-and-output/index.md b/guide/russian/cplusplus/input-and-output/index.md index b6a5479c95..75a3d875c8 100644 --- a/guide/russian/cplusplus/input-and-output/index.md +++ b/guide/russian/cplusplus/input-and-output/index.md @@ -10,7 +10,7 @@ localeTitle: Вход и выход Программа Hello World использует `cout` для печати «Hello World!». на консоль: -```C++ +```cpp #include using namespace std; @@ -30,24 +30,24 @@ localeTitle: Вход и выход Почти все можно поместить в поток: строки, числа, переменные, выражения и т. Д. Здесь приведены некоторые примеры действительных входов потока: -```C++ +```cpp // Notice we can use the number 42 and not the string "42". cout << "The meaning of life is " << 42 << endl;` // Output: The meaning of life is 42 ``` -```C++ +```cpp string name = "Tim"; cout << "Except for you, " << name << endl;`// Output: Except for you, Tim ``` -```C++ +```cpp string name = "Tim"; cout << name; cout << " is a great guy!" << endl;` // Output: Tim is a great guy! ``` -```C++ +```cpp int a = 3; cout << a*2 + 18/a << endl;`// Output: 12 ``` @@ -56,7 +56,7 @@ int a = 3; C ++ всегда ставит _вас_ под контроль и делает именно то, что вы ему говорите. Иногда это может удивлять, как в следующем примере: -```C++ +```cpp string name = "Sarah"; cout << "Good morning" << name << "how are you today? << endl; ``` @@ -65,7 +65,7 @@ string name = "Sarah"; Разрывы строк не происходят сами по себе. Вы могли бы подумать, что это напечатает рецепт на четырех строках: -```C++ +```cpp cout << "To make bread, you need:"; cout << "* One egg"; cout << "* One water"; @@ -76,7 +76,7 @@ cout << "To make bread, you need:"; Вы можете исправить это, добавив `endl` s после каждой строки, потому что, как обсуждалось ранее, `endl` вставляет символ новой строки в выходной поток. Тем не менее, это также заставляет буфер очищаться, что лишает нас небольшой производительности, так как мы могли напечатать все строки за один раз. Поэтому лучше всего было бы добавить фактических символов новой строки в конце строк и использовать `endl` в конце: -```C++ +```cpp cout << "To make bread, you need:\n"; cout << "* One egg\n"; cout << "* One water\n"; @@ -89,7 +89,7 @@ cout << "To make bread, you need:\n"; Чтобы читать с консоли, вы используете _входной поток_ `cin` же, как и `cout` , но вместо того, чтобы помещать вещи в `cin` , вы «вынимаете их». Следующая программа считывает два числа от пользователя и добавляет их вместе: -```C++ +```cpp #include using namespace std; @@ -112,7 +112,7 @@ cout << "To make bread, you need:\n"; Оператор экстракции `<<` может быть скован. Вот та же программа, что и в прошлый раз, но написана более кратким образом: -```C++ +```cpp #include using namespace std; diff --git a/guide/russian/cplusplus/map/index.md b/guide/russian/cplusplus/map/index.md index 07c0882cf3..c67ffb44d5 100644 --- a/guide/russian/cplusplus/map/index.md +++ b/guide/russian/cplusplus/map/index.md @@ -16,7 +16,7 @@ localeTitle: карта Вот пример: -```c++ +```cpp #include #include @@ -56,7 +56,7 @@ a => 10 Вставка данных с функцией вставки. -```c++ +```cpp myMap.insert(make_pair("earth", 1)); myMap.insert(make_pair("moon", 2)); ``` @@ -69,7 +69,7 @@ myMap.insert(make_pair("earth", 1)); Чтобы получить доступ к элементам карты, вам необходимо создать для нее итератор. Вот пример, как было сказано ранее. -```c++ +```cpp map::iterator it; for(it=first.begin(); it!=first.end(); ++it){ cout << it->first << " => " << it->second << '\n'; diff --git a/guide/russian/cplusplus/terms-to-know-for-beginners/index.md b/guide/russian/cplusplus/terms-to-know-for-beginners/index.md index fff2283c50..4852e06ebe 100644 --- a/guide/russian/cplusplus/terms-to-know-for-beginners/index.md +++ b/guide/russian/cplusplus/terms-to-know-for-beginners/index.md @@ -1,7 +1,8 @@ ---- -title: IDE and Printing different text -localeTitle: IDE и печать другого текста ---- # Введение в IDE и печать другого текста: +--- +title: IDE and Printing different text +localeTitle: IDE и печать другого текста +--- +# Введение в IDE и печать другого текста: * В последней статье приведены некоторые ссылки для загрузки программного обеспечения, необходимого для программирования. Программное обеспечение, подобное этому, известно как IDE. **IDE означает интегрированную среду разработки** @@ -33,8 +34,7 @@ _В: Попробуйте найти IDE в Google и запустить на н ``` Вышеприведенный код возвращает ошибку, потому что в строке 2 мы использовали двоеточие (:) вместо точки с запятой (;) Итак, давайте отлаживаем ошибку: - -```C++ +```cpp #include using namespace std ; int main() @@ -139,4 +139,4 @@ Hello World! I love freeCodeCamp! `cpp (7!=5);` Это соответствует истинному -[Суммирование всех операторов печати, используемых в этой статье. Не стесняйтесь настраивать код! :)](https://repl.it/L4ox) \ No newline at end of file +[Суммирование всех операторов печати, используемых в этой статье. Не стесняйтесь настраивать код! :)](https://repl.it/L4ox) diff --git a/guide/russian/cplusplus/while-loop/index.md b/guide/russian/cplusplus/while-loop/index.md index f269596e6b..e7786d5b25 100644 --- a/guide/russian/cplusplus/while-loop/index.md +++ b/guide/russian/cplusplus/while-loop/index.md @@ -10,7 +10,7 @@ localeTitle: undefined Пример: -```C++ +```cpp #include using namespace std; diff --git a/guide/russian/csharp/for/index.md b/guide/russian/csharp/for/index.md index df5dd26d99..b4c5637adb 100644 --- a/guide/russian/csharp/for/index.md +++ b/guide/russian/csharp/for/index.md @@ -8,7 +8,7 @@ localeTitle: Для цикла ## Синтаксис -```C# +```csharp for ((Initial variable); (condition); (step)) { (code) @@ -25,7 +25,7 @@ for ((Initial variable); (condition); (step)) ## пример -```C# +```csharp int[] array = { 1, 2, 3, 4, 5 }; for (int i = 0; i < array.Length; i++) { diff --git a/guide/russian/csharp/foreach/index.md b/guide/russian/csharp/foreach/index.md index 4b8c9615b5..6e4f0090f5 100644 --- a/guide/russian/csharp/foreach/index.md +++ b/guide/russian/csharp/foreach/index.md @@ -24,7 +24,7 @@ foreach (element in iterable-item) ### Вывод: -```sh +```shell > We have Jim > We have Jane > We have Jack diff --git a/guide/russian/csharp/hello-world/index.md b/guide/russian/csharp/hello-world/index.md index 3eb5a42f8d..bcdabbca96 100644 --- a/guide/russian/csharp/hello-world/index.md +++ b/guide/russian/csharp/hello-world/index.md @@ -1,7 +1,8 @@ ---- -title: Hello World -localeTitle: Привет мир ---- # Привет мир +--- +title: Hello World +localeTitle: Привет мир +--- +# Привет мир Чтобы написать текст на консоли, мы используем `Console.WriteLine()` . Этот метод принимает строку как ввод. @@ -28,9 +29,8 @@ using System; ``` ## Вывод: - -```sh +```shell > Hello World! > Press any key to exit. -``` \ No newline at end of file +``` diff --git a/guide/russian/csharp/null-coalescing-operator/index.md b/guide/russian/csharp/null-coalescing-operator/index.md index 3a8369ccfd..c0e0cf2d6a 100644 --- a/guide/russian/csharp/null-coalescing-operator/index.md +++ b/guide/russian/csharp/null-coalescing-operator/index.md @@ -10,7 +10,7 @@ localeTitle: Оператор Null-coalescing Поскольку `name` равно `null` , `clientName` будет присвоено значение «John Doe». -```cs +```csharp string name = null; string clientName = name ?? "John Doe"; @@ -18,7 +18,7 @@ string name = null; Console.WriteLine(clientName); ``` -```cs +```csharp > John Doe ``` @@ -26,7 +26,7 @@ string name = null; Поскольку `name` не равно `null` , `clientName` будет присвоено значение `name` , которое является «Jane Smith». -```cs +```csharp string name = "Jane Smith"; string clientName = name ?? "John Doe"; @@ -34,7 +34,7 @@ string name = "Jane Smith"; Console.WriteLine(clientName); ``` -```cs +```csharp > Jane Smith ``` @@ -42,7 +42,7 @@ string name = "Jane Smith"; Вы можете использовать оператор `if...else` для проверки наличия `null` и назначения другого значения. -```cs +```csharp string clientName; if (name != null) @@ -53,7 +53,7 @@ string clientName; Однако это может быть значительно упрощено с помощью оператора нулевой коалесценции. -```cs +```csharp string clientName = name ?? "John Doe"; ``` @@ -61,13 +61,13 @@ string clientName = name ?? "John Doe"; Также можно использовать условный оператор для проверки наличия `null` и присвоения другого значения. -```cs +```csharp string clientName = name != null ? name : "John Doe"; ``` Опять же, это можно упростить с помощью оператора нуль-коалесценции. -```cs +```csharp string clientName = name ?? "John Doe"; ``` diff --git a/guide/russian/csharp/xaml/index.md b/guide/russian/csharp/xaml/index.md index 603e03842a..82b644e4e1 100644 --- a/guide/russian/csharp/xaml/index.md +++ b/guide/russian/csharp/xaml/index.md @@ -26,7 +26,7 @@ XAML, объявленный как «Zammel», является языком з В следующем примере показана метка с «Hello World!». как его содержимое в контейнере верхнего уровня, называемом UserControl. -```XAML +```xml diff --git a/guide/russian/css/breakpoints/index.md b/guide/russian/css/breakpoints/index.md index ab4518cdda..b285094fe8 100644 --- a/guide/russian/css/breakpoints/index.md +++ b/guide/russian/css/breakpoints/index.md @@ -174,7 +174,7 @@ localeTitle: Контрольные точки Вы также можете установить минимальную и максимальную ширину, что позволит вам экспериментировать с различными диапазонами. Это примерно триггер между smar-телефоном и большими размерами рабочего стола и монитора -```code +```css @media only screen and (min-width: 700px) and (max-width: 1500px) { something { something: something; diff --git a/guide/russian/go/installing-go/arch-linux/index.md b/guide/russian/go/installing-go/arch-linux/index.md index 50e021bcbb..78b63fa426 100644 --- a/guide/russian/go/installing-go/arch-linux/index.md +++ b/guide/russian/go/installing-go/arch-linux/index.md @@ -6,7 +6,7 @@ localeTitle: Установка Go в Arch Linux с помощью pacman Использование Arch Linux Package Manager (pacman) - это самый простой способ установки Go. Основываясь на философии Arch Linux по предоставлению новых версий программного обеспечения очень быстро, вы получите очень актуальную версию go. Прежде чем вы сможете установить пакет go, вам необходимо обновить систему. -```sh +```shell $ sudo pacman -Syu $ sudo pacman -S go ``` @@ -15,7 +15,7 @@ $ sudo pacman -Syu Чтобы проверить, успешно ли установлен go, используйте: -```sh +```shell $ go version > go version go2.11.1 linux/amd64 ``` diff --git a/guide/russian/go/installing-go/mac-package-installer/index.md b/guide/russian/go/installing-go/mac-package-installer/index.md index 36cf873e55..f9e3fa0782 100644 --- a/guide/russian/go/installing-go/mac-package-installer/index.md +++ b/guide/russian/go/installing-go/mac-package-installer/index.md @@ -12,7 +12,7 @@ localeTitle: Установка Go в Mac OS X с помощью установ Чтобы проверить, успешно ли установлен go, откройте терминал и используйте: -```sh +```shell $ go version ``` diff --git a/guide/russian/go/installing-go/mac-tarball/index.md b/guide/russian/go/installing-go/mac-tarball/index.md index 9b16d2bdf0..c3aec8170b 100644 --- a/guide/russian/go/installing-go/mac-tarball/index.md +++ b/guide/russian/go/installing-go/mac-tarball/index.md @@ -25,7 +25,7 @@ $ curl -O https://storage.googleapis.com/golang/go1.9.1.darwin-amd64.tar.gz Чтобы проверить, успешно ли установлен go, используйте: -```sh +```shell $ go version ``` diff --git a/guide/russian/go/installing-go/ubuntu-apt-get/index.md b/guide/russian/go/installing-go/ubuntu-apt-get/index.md index 601bac2f2c..4bf8052aea 100644 --- a/guide/russian/go/installing-go/ubuntu-apt-get/index.md +++ b/guide/russian/go/installing-go/ubuntu-apt-get/index.md @@ -8,7 +8,7 @@ localeTitle: Установка Go в Ubuntu с помощью apt-get > На момент написания этой статьи версия Ubuntu Xenial версии 1.6.1, а последняя версия стабильная версия - 1.9.1 -```sh +```shell $ sudo apt-get update $ sudo apt-get install golang-go ``` @@ -17,7 +17,7 @@ $ sudo apt-get update Чтобы проверить, успешно ли установлен go, используйте: -```sh +```shell $ go version > go version go1.9.1 linux/amd64 ``` diff --git a/guide/russian/go/installing-go/ubuntu-tarball/index.md b/guide/russian/go/installing-go/ubuntu-tarball/index.md index 755dcf6fc5..f554d66e0e 100644 --- a/guide/russian/go/installing-go/ubuntu-tarball/index.md +++ b/guide/russian/go/installing-go/ubuntu-tarball/index.md @@ -10,7 +10,7 @@ localeTitle: Установка Go в Ubuntu с помощью tarball Прежде чем продолжить, убедитесь, что знаете, ваша система 32 или 64 бит. Если вы не знаете, выполните следующую команду, чтобы узнать: -```sh +```shell $ lscpu | grep Architecture ``` @@ -52,7 +52,7 @@ $ wget https://storage.googleapis.com/golang/go1.9.1.linux-386.tar.gz Чтобы проверить, успешно ли установлен go, используйте: -```sh +```shell $ go version > go version go1.9.1 linux/amd64 ``` diff --git a/guide/russian/javascript/with/index.md b/guide/russian/javascript/with/index.md index d956351d5c..99159c1939 100644 --- a/guide/russian/javascript/with/index.md +++ b/guide/russian/javascript/with/index.md @@ -10,7 +10,7 @@ localeTitle: С ### Синтаксис -```syntax +```js with (expression) statement ``` diff --git a/guide/russian/linux/getting-started/index.md b/guide/russian/linux/getting-started/index.md index 9675a6e598..3fa307c960 100644 --- a/guide/russian/linux/getting-started/index.md +++ b/guide/russian/linux/getting-started/index.md @@ -22,7 +22,7 @@ localeTitle: Начиная cd (Change Directory). Команда cd является одной из команд, которые вы будете использовать больше всего в командной строке в Linux. Он позволяет вам изменить рабочий каталог. Вы используете его для перемещения по иерархии вашей файловой системы. -```unix +```shell cd ``` @@ -30,7 +30,7 @@ cd ls (List) - эта команда отображает содержимое в текущем каталоге. Его также можно использовать для отображения информации о файлах. -```unix +```shell ls ``` diff --git a/guide/russian/linux/how-to-use-sftp-to-securely-transfer-files-with-a-remote-server/index.md b/guide/russian/linux/how-to-use-sftp-to-securely-transfer-files-with-a-remote-server/index.md index 620c9be922..e282a71ef4 100644 --- a/guide/russian/linux/how-to-use-sftp-to-securely-transfer-files-with-a-remote-server/index.md +++ b/guide/russian/linux/how-to-use-sftp-to-securely-transfer-files-with-a-remote-server/index.md @@ -10,7 +10,7 @@ localeTitle: Как использовать SFTP для безопасной п Если вы еще этого не сделали, проверьте, что вы можете использовать SSH на сервере. SFTP использует протокол Secure Shell (SSH), поэтому, если вы не можете использовать SSH, вы, вероятно, тоже не сможете использовать SFTP. -```unix +```shell ssh your_username@hostname_or_ip_address ``` @@ -18,13 +18,13 @@ ssh your_username@hostname_or_ip_address Он использует тот же синтаксис, что и SSH, и открывает сеанс, в котором вы можете передавать файлы. -```unix +```shell sftp your_username@hostname_or_ip_address ``` Чтобы указать полезные команды: -```unix +```shell help ``` @@ -32,19 +32,19 @@ help Чтобы загрузить файл: -```unix +```shell get ``` Чтобы загрузить папку и ее содержимое, используйте флаг «-r» (также работает для загрузки): -```unix +```shell get -r ``` Чтобы загрузить файл: -```unix +```shell put ``` @@ -52,13 +52,13 @@ put Чтобы изменить локальную папку: -```unix +```shell lcd ``` Чтобы изменить удалённую папку: -```unix +```shell cd ``` \ No newline at end of file diff --git a/guide/russian/linux/setting-up-yum-repositories-in-redhat-linux/index.md b/guide/russian/linux/setting-up-yum-repositories-in-redhat-linux/index.md index 33eb2eeb7a..9d8e1d5186 100644 --- a/guide/russian/linux/setting-up-yum-repositories-in-redhat-linux/index.md +++ b/guide/russian/linux/setting-up-yum-repositories-in-redhat-linux/index.md @@ -10,7 +10,7 @@ localeTitle: Настройка репозиториев Yum в RedHat / CentOS Шаг 1: Проверьте, существуют ли существующие хранилища или нет. -```sh +```shell #yum repolist ``` @@ -18,19 +18,19 @@ localeTitle: Настройка репозиториев Yum в RedHat / CentOS Шаг 2: измените каталог на -```sh +```shell #cd /etc/yum.repos.d ``` Шаг 3: Создайте новый файл -```sh +```shell #vim myrepo.repo ``` Шаг 4: Введите следующие строки в файле -```sh +```shell [file-name] name=filename baseurl="location of yum repositories" @@ -41,7 +41,7 @@ localeTitle: Настройка репозиториев Yum в RedHat / CentOS Шаг 6: Повторите шаг 1 -```sh +```shell You Will find repositories ``` \ No newline at end of file diff --git a/guide/russian/linux/the-anatomy-of-the-linux-command-line/index.md b/guide/russian/linux/the-anatomy-of-the-linux-command-line/index.md index 1f20d5261f..621face6b4 100644 --- a/guide/russian/linux/the-anatomy-of-the-linux-command-line/index.md +++ b/guide/russian/linux/the-anatomy-of-the-linux-command-line/index.md @@ -14,7 +14,7 @@ localeTitle: Анатомия командной строки Linux Чтобы начать использовать открытый терминал (для Ubuntu просто удерживайте Ctrl + Alt + T), и вас приветствует серия символов, расположенных в этом формате; -```linux +```shell user_name@machine_name:~$ ``` diff --git a/guide/russian/nodejs/index.md b/guide/russian/nodejs/index.md index 15808e4640..0d2031c18b 100644 --- a/guide/russian/nodejs/index.md +++ b/guide/russian/nodejs/index.md @@ -32,7 +32,7 @@ import time **Node.js** -```node +```js function my_io_task() { setTimeout(function() { console.log('done'); diff --git a/guide/russian/php/loops/for-loop/index.md b/guide/russian/php/loops/for-loop/index.md index b7991dfed5..22e0b0b1be 100644 --- a/guide/russian/php/loops/for-loop/index.md +++ b/guide/russian/php/loops/for-loop/index.md @@ -52,7 +52,7 @@ localeTitle: Для цикла Это приведет к выводу: -```txt +```shell int(1) int(2) int(3) NULL ``` diff --git a/guide/russian/python/python-coding-standards/index.md b/guide/russian/python/python-coding-standards/index.md index ef5fad6848..79f02e28ab 100644 --- a/guide/russian/python/python-coding-standards/index.md +++ b/guide/russian/python/python-coding-standards/index.md @@ -22,7 +22,7 @@ localeTitle: Стандарты кодирования Вот как вы проверяете, соответствует ли ваш код Python его стандартам. -```console +```shell :~$ pip install pep8 :~$ pep8 --first myCode.py ``` diff --git a/guide/russian/react/what-are-react-props/index.md b/guide/russian/react/what-are-react-props/index.md index 714a9726a7..0483bb644a 100644 --- a/guide/russian/react/what-are-react-props/index.md +++ b/guide/russian/react/what-are-react-props/index.md @@ -12,7 +12,7 @@ localeTitle: React TypeChecking с помошью PropTypes Чтобы использовать его, он должен быть добавлен в проект в качестве зависимости, выпустив следующую команду в консоли. -```sh +```shell npm install --save prop-types ``` diff --git a/guide/russian/redux/tutorial/index.md b/guide/russian/redux/tutorial/index.md index 5be3767f8e..3d5d96bb28 100644 --- a/guide/russian/redux/tutorial/index.md +++ b/guide/russian/redux/tutorial/index.md @@ -1,7 +1,8 @@ ---- -title: React Redux Basic Setup -localeTitle: React Redux Basic Setup ---- ## React Redux Basic Setup +--- +title: React Redux Basic Setup +localeTitle: React Redux Basic Setup +--- +## React Redux Basic Setup В этом руководстве читателю будет представлено, как настроить простое приложение React и Redux. @@ -12,8 +13,7 @@ localeTitle: React Redux Basic Setup Предполагая, что все настроено и работает правильно, есть некоторые пакеты, которые необходимо добавить, чтобы Redux работал с React. Откройте терминал внутри созданной папки проекта и выполните следующую команду - -```sh +```shell npm install --save react react react-dom react-redux react-router redux ``` @@ -277,4 +277,4 @@ export const APP_ACTION_A='MAKE_A'; [Redux Api](http://redux.js.org/docs/api/) -[Примеры Redux](https://github.com/reactjs/redux/tree/master/examples) \ No newline at end of file +[Примеры Redux](https://github.com/reactjs/redux/tree/master/examples) diff --git a/guide/russian/rust/installing-rust/index.md b/guide/russian/rust/installing-rust/index.md index 8d6fb26961..037c7dc4f9 100644 --- a/guide/russian/rust/installing-rust/index.md +++ b/guide/russian/rust/installing-rust/index.md @@ -1,7 +1,8 @@ ---- -title: Installing Rust -localeTitle: Установка ржавчины ---- # Установка ржавчины +--- +title: Installing Rust +localeTitle: Установка ржавчины +--- +# Установка ржавчины Использование `rustup` является предпочтительным для установки Rust. `rustup` устанавливает и управляет Rust для вашей системы. @@ -12,8 +13,7 @@ localeTitle: Установка ржавчины ## Установка Rust в другие операционные системы (Mac OS X, Linux, BSD, Unix) Откройте терминал и введите следующую команду: - -```sh +```shell curl https://sh.rustup.rs -sSf | sh ``` @@ -22,8 +22,7 @@ curl https://sh.rustup.rs -sSf | sh # Проверка установки Установка `rustup` будет устанавливать все, что относится к ржавчине, но, самое главное, это означает установку компилятора и менеджера пакетов. Чтобы убедиться, что все установлено, выполните следующую команду: - -```sh +```shell cargo version ``` @@ -31,4 +30,4 @@ cargo version # Больше информации -Чтобы узнать больше об установке, посетите https://www.rust-lang.org/en-US/install.html \ No newline at end of file +Чтобы узнать больше об установке, посетите https://www.rust-lang.org/en-US/install.html diff --git a/guide/russian/software-engineering/design-patterns/singleton/index.md b/guide/russian/software-engineering/design-patterns/singleton/index.md index 14db80898d..0fcd040093 100644 --- a/guide/russian/software-engineering/design-patterns/singleton/index.md +++ b/guide/russian/software-engineering/design-patterns/singleton/index.md @@ -126,7 +126,7 @@ obj_0 = MyClass() ## Синглтон в iOS -```Swift4 +```swift class Singleton { static let sharedInstance = Singleton() diff --git a/guide/spanish/algorithms/flood-fill/index.md b/guide/spanish/algorithms/flood-fill/index.md index 68dcf3b5ba..ea83b6877c 100644 --- a/guide/spanish/algorithms/flood-fill/index.md +++ b/guide/spanish/algorithms/flood-fill/index.md @@ -27,7 +27,7 @@ El cuadrado rojo es el punto de partida y los cuadrados grises son los llamados Para más detalles, aquí hay un código que describe la función: -```c++ +```cpp int wall = -1; void flood_fill(int pos_x, int pos_y, int target_color, int color) @@ -80,7 +80,7 @@ En una matriz bidimensional se le da un número n de **"islas"** . Intenta encon Tienes la siguiente entrada: -```c++ +```cpp 2 4 4 0 0 0 1 0 0 1 1 diff --git a/guide/spanish/algorithms/lee-algorithm/index.md b/guide/spanish/algorithms/lee-algorithm/index.md index e8cad92c99..04a63eb4ec 100644 --- a/guide/spanish/algorithms/lee-algorithm/index.md +++ b/guide/spanish/algorithms/lee-algorithm/index.md @@ -21,7 +21,7 @@ C ++ ya tiene la cola implementada en la biblioteca `` , pero si está ut Código C ++: -```c++ +```cpp int dl[] = {-1, 0, 1, 0}; // these arrays will help you travel in the 4 directions more easily int dc[] = {0, 1, 0, -1}; diff --git a/guide/spanish/algorithms/search-algorithms/linear-search/index.md b/guide/spanish/algorithms/search-algorithms/linear-search/index.md index a40298e07b..b69741b893 100644 --- a/guide/spanish/algorithms/search-algorithms/linear-search/index.md +++ b/guide/spanish/algorithms/search-algorithms/linear-search/index.md @@ -75,7 +75,7 @@ def linear_search(target, array) ### Ejemplo en C ++ -```c++ +```cpp int linear_search(int arr[],int n,int num) { for(int i=0;i using namespace std; void heapify(int arr[], int n, int i) diff --git a/guide/spanish/algorithms/sorting-algorithms/insertion-sort/index.md b/guide/spanish/algorithms/sorting-algorithms/insertion-sort/index.md index ecf87f27da..2e264e5a27 100644 --- a/guide/spanish/algorithms/sorting-algorithms/insertion-sort/index.md +++ b/guide/spanish/algorithms/sorting-algorithms/insertion-sort/index.md @@ -92,7 +92,7 @@ Paso 5: El algoritmo siguiente es una versión ligeramente optimizada para evitar el intercambio de elementos `key` en cada iteración. Aquí, el elemento `key` se intercambiará al final de la iteración (paso). -```Algorithm +``` InsertionSort(arr[]) for j = 1 to arr.length key = arr[j] diff --git a/guide/spanish/algorithms/sorting-algorithms/merge-sort/index.md b/guide/spanish/algorithms/sorting-algorithms/merge-sort/index.md index ab6e2fbd41..a70c3cf7c5 100644 --- a/guide/spanish/algorithms/sorting-algorithms/merge-sort/index.md +++ b/guide/spanish/algorithms/sorting-algorithms/merge-sort/index.md @@ -23,7 +23,7 @@ T(n) = 2T(n/2) + n Contando el número de repeticiones de n en la suma al final, vemos que hay lg n + 1 de ellas. Por lo tanto, el tiempo de ejecución es n (lg n + 1) = n lg n + n. Observamos que n lg n + n 0, por lo que el tiempo de ejecución es O (n lg n). -```Algorithm +``` MergeSort(arr[], left, right): If right > l: 1. Find the middle point to divide the array into two halves: diff --git a/guide/spanish/certifications/apis-and-microservices/basic-node-and-express/use-body-parser-to-parse-post-requests/index.md b/guide/spanish/certifications/apis-and-microservices/basic-node-and-express/use-body-parser-to-parse-post-requests/index.md index 8e994dccee..eb0e9c99d6 100644 --- a/guide/spanish/certifications/apis-and-microservices/basic-node-and-express/use-body-parser-to-parse-post-requests/index.md +++ b/guide/spanish/certifications/apis-and-microservices/basic-node-and-express/use-body-parser-to-parse-post-requests/index.md @@ -6,7 +6,7 @@ localeTitle: Use el analizador de cuerpo para analizar las solicitudes POST El analizador de cuerpo ya debería estar agregado a su proyecto si usó la placa de caldera provista, pero si no, debería estar allí como: -```code +```json "dependencies": { "body-parser": "^1.4.3", ... diff --git a/guide/spanish/certifications/front-end-libraries/react/change-inline-css-conditionally-based-on-component-state/index.md b/guide/spanish/certifications/front-end-libraries/react/change-inline-css-conditionally-based-on-component-state/index.md index 2e13f3ef70..967a8f2664 100644 --- a/guide/spanish/certifications/front-end-libraries/react/change-inline-css-conditionally-based-on-component-state/index.md +++ b/guide/spanish/certifications/front-end-libraries/react/change-inline-css-conditionally-based-on-component-state/index.md @@ -58,7 +58,7 @@ class GateKeeper extends React.Component { Escriba una declaración condicional que se evalúe de acuerdo con su estado, como se menciona en la descripción del desafío, verifique la longitud de la entrada y asigne un nuevo objeto a la variable inputStyle. -```react.js +```jsx if (this.state.input.length > 15) { inputStyle = { border: '3px solid red' diff --git a/guide/spanish/certifications/front-end-libraries/react/create-a-controlled-form/index.md b/guide/spanish/certifications/front-end-libraries/react/create-a-controlled-form/index.md index 8fa6f72d8d..43ff953d5e 100644 --- a/guide/spanish/certifications/front-end-libraries/react/create-a-controlled-form/index.md +++ b/guide/spanish/certifications/front-end-libraries/react/create-a-controlled-form/index.md @@ -10,13 +10,13 @@ Primero, cree una entrada controlada que almacene su valor en el estado, de modo ### Solución -```react.js +```jsx ``` A continuación, cree el método handleSubmit para su componente. Primero, debido a que su formulario se está enviando, tendrá que evitar que la página se actualice. Segundo, llame al método `setState()` , pasando un objeto de los diferentes pares clave-valor que desea cambiar. En este caso, desea establecer 'enviar' al valor de la variable 'entrada' y establecer 'entrada' a una cadena vacía. -```react.js +```jsx handleSubmit(event) { event.preventDefault(); this.setState({ diff --git a/guide/spanish/certifications/front-end-libraries/react/give-sibling-elements-a-unique-key-attribute/index.md b/guide/spanish/certifications/front-end-libraries/react/give-sibling-elements-a-unique-key-attribute/index.md index 959cae4978..c3419335e4 100644 --- a/guide/spanish/certifications/front-end-libraries/react/give-sibling-elements-a-unique-key-attribute/index.md +++ b/guide/spanish/certifications/front-end-libraries/react/give-sibling-elements-a-unique-key-attribute/index.md @@ -12,7 +12,7 @@ Es casi igual que el [desafío](https://learn.freecodecamp.org/front-end-librari Solo agregue el atributo `key` a la etiqueta `
  • ` para que sea único -```react.js +```jsx const renderFrameworks = frontEndFrameworks.map((item) =>
  • {item}
  • ); diff --git a/guide/spanish/certifications/front-end-libraries/react/introducing-inline-styles/index.md b/guide/spanish/certifications/front-end-libraries/react/introducing-inline-styles/index.md index 0f3d308139..f40f8ebf31 100644 --- a/guide/spanish/certifications/front-end-libraries/react/introducing-inline-styles/index.md +++ b/guide/spanish/certifications/front-end-libraries/react/introducing-inline-styles/index.md @@ -10,7 +10,7 @@ Este puede ser un poco complicado porque JSX es muy similar a HTML pero **NO es Repasemos los pasos para que puedas entender la diferencia. Primero establece tu etiqueta de estilo en un **objeto JavaScript** . -```react.js +```jsx class Colorful extends React.Component { render() { return ( @@ -26,7 +26,7 @@ Ahora tienes tu etiqueta de estilo establecida en un objeto vacío. Observe cóm En segundo lugar, vamos a configurar el color en rojo. -```react.js +```jsx class Colorful extends React.Component { render() { return ( @@ -42,7 +42,7 @@ Finalmente, vamos a establecer el tamaño de la fuente a 72px. ### Alerón -```react.js +```jsx class Colorful extends React.Component { render() { return ( diff --git a/guide/spanish/certifications/front-end-libraries/react/override-default-props/index.md b/guide/spanish/certifications/front-end-libraries/react/override-default-props/index.md index a4bc0a6a2d..0b3b7f9be4 100644 --- a/guide/spanish/certifications/front-end-libraries/react/override-default-props/index.md +++ b/guide/spanish/certifications/front-end-libraries/react/override-default-props/index.md @@ -6,7 +6,7 @@ localeTitle: Anular apoyos predeterminados Este desafío tiene que anular el valor predeterminado de la `quantity` de accesorios para el componente Artículos. Donde el valor predeterminado de `quantity` se establece en `0` . -```react.js +```jsx const Items = (props) => { return

    Current Quantity of Items in Cart: {props.quantity}

    } @@ -18,13 +18,13 @@ const Items = (props) => { Para anular un valor de propiedades predeterminado, la sintaxis que se debe seguir es -```react.js +```jsx ``` Siguiendo la sintaxis, el siguiente código debe ser declarado debajo del código dado -```react.js +```jsx ``` diff --git a/guide/spanish/certifications/front-end-libraries/react/render-conditionally-from-props/index.md b/guide/spanish/certifications/front-end-libraries/react/render-conditionally-from-props/index.md index 7dd2b87e8f..c8ddc28620 100644 --- a/guide/spanish/certifications/front-end-libraries/react/render-conditionally-from-props/index.md +++ b/guide/spanish/certifications/front-end-libraries/react/render-conditionally-from-props/index.md @@ -10,7 +10,7 @@ Este es un reto un poco complicado pero fácil. Cambie `handleClick()` con la declaración de incremento adecuada. -```react.js +```jsx handleClick() { this.setState({ counter: this.state.counter + 1 @@ -20,7 +20,7 @@ handleClick() { En `render()` el uso del método `Math.random()` como se menciona en la descripción desafío y escribir una expresión ternaria para pasar `props` en el componente de **Resultados.** -```react.js +```jsx let expression = Math.random() > .5; {(expression == 1)? : } @@ -28,7 +28,7 @@ En `render()` el uso del método `Math.random()` como se menciona en la descripc Luego renderiza los `fiftyFifty` apoyos en el componente Resultados. -```react.js +```jsx

    { this.props.fiftyFifty diff --git a/guide/spanish/certifications/front-end-libraries/react/render-state-in-the-user-interface/index.md b/guide/spanish/certifications/front-end-libraries/react/render-state-in-the-user-interface/index.md index 02d3fdc988..c170e1d893 100644 --- a/guide/spanish/certifications/front-end-libraries/react/render-state-in-the-user-interface/index.md +++ b/guide/spanish/certifications/front-end-libraries/react/render-state-in-the-user-interface/index.md @@ -12,7 +12,7 @@ Simplemente haga una etiqueta `

    ` y renderice `this.state.name` entre la etiq ## Solución -```react.js +```jsx class MyComponent extends React.Component { constructor(props) { super(props); diff --git a/guide/spanish/certifications/front-end-libraries/react/render-with-an-ifelse-condition/index.md b/guide/spanish/certifications/front-end-libraries/react/render-with-an-ifelse-condition/index.md index 7ccb40818e..96996bdb41 100644 --- a/guide/spanish/certifications/front-end-libraries/react/render-with-an-ifelse-condition/index.md +++ b/guide/spanish/certifications/front-end-libraries/react/render-with-an-ifelse-condition/index.md @@ -12,7 +12,7 @@ Primero, ajuste el método de retorno actual dentro de una declaración if y est ### Solución -```react.js +```jsx if (this.state.display === true) { return (
    @@ -25,7 +25,7 @@ if (this.state.display === true) { A continuación, cree una declaración else que devuelva el mismo JSX **sin** el elemento `h1` . -```react.js +```jsx else { return (
    diff --git a/guide/spanish/certifications/front-end-libraries/react/use-a-ternary-expression-for-conditional-rendering/index.md b/guide/spanish/certifications/front-end-libraries/react/use-a-ternary-expression-for-conditional-rendering/index.md index 57670ff0ac..c90900f90e 100644 --- a/guide/spanish/certifications/front-end-libraries/react/use-a-ternary-expression-for-conditional-rendering/index.md +++ b/guide/spanish/certifications/front-end-libraries/react/use-a-ternary-expression-for-conditional-rendering/index.md @@ -17,7 +17,7 @@ condition ? expressionIfTrue : expressionIfFalse Aquí está la solución de muestra de usar la expresión ternaria. Primero necesitas declarar estado en constructor como este. -```react.js +```jsx constructor(props) { super(props); // change code below this line @@ -33,7 +33,7 @@ constructor(props) { Entonces el operador ternario -```react.js +```jsx { /* change code here */ (this.state.userAge >= 18) ? buttonTwo : (this.state.userAge== '')? buttonOne: buttonThree diff --git a/guide/spanish/certifications/front-end-libraries/react/use-proptypes-to-define-the-props-you-expect/index.md b/guide/spanish/certifications/front-end-libraries/react/use-proptypes-to-define-the-props-you-expect/index.md index c31db499da..3560cd52c6 100644 --- a/guide/spanish/certifications/front-end-libraries/react/use-proptypes-to-define-the-props-you-expect/index.md +++ b/guide/spanish/certifications/front-end-libraries/react/use-proptypes-to-define-the-props-you-expect/index.md @@ -6,7 +6,7 @@ localeTitle: Use PropTypes para definir los beneficios que espera Este desafío tiene que establecer un `propTypes` para el componente `Items` . -```react.js +```jsx const Items = (props) => { return

    Current Quantity of Items in Cart: {props.quantity}

    }; @@ -14,7 +14,7 @@ const Items = (props) => { Para establecer un propTypes, la sintaxis a seguir es -```react.js +```jsx itemName.propTypes = { props: PropTypes.dataType.isRequired }; @@ -22,7 +22,7 @@ itemName.propTypes = { Siguiendo la sintaxis, el siguiente código debe establecerse debajo del código dado para la `quantity` accesorios del componente `Items` -```react.js +```jsx Items.propTypes = { quantity: PropTypes.number.isRequired }; diff --git a/guide/spanish/certifications/front-end-libraries/redux/define-a-redux-action/index.md b/guide/spanish/certifications/front-end-libraries/redux/define-a-redux-action/index.md index 2174f30152..db591355d1 100644 --- a/guide/spanish/certifications/front-end-libraries/redux/define-a-redux-action/index.md +++ b/guide/spanish/certifications/front-end-libraries/redux/define-a-redux-action/index.md @@ -6,7 +6,7 @@ localeTitle: Definir una acción redux Aquí es cómo declarar una acción Redux. -```react.js +```jsx let action={ type: 'LOGIN' } diff --git a/guide/spanish/certifications/front-end-libraries/redux/dispatch-an-action-event/index.md b/guide/spanish/certifications/front-end-libraries/redux/dispatch-an-action-event/index.md index e08b3d25c1..2b4284d8ae 100644 --- a/guide/spanish/certifications/front-end-libraries/redux/dispatch-an-action-event/index.md +++ b/guide/spanish/certifications/front-end-libraries/redux/dispatch-an-action-event/index.md @@ -6,7 +6,7 @@ localeTitle: Enviar un evento de acción Envíe la acción de INICIAR SESIÓN al almacén de Redux llamando al método de despacho, y pase la acción creada por `loginAction()` . -```react.js +```jsx store.dispatch(loginAction()); ``` \ No newline at end of file diff --git a/guide/spanish/certifications/front-end-libraries/redux/get-state-from-the-redux-store/index.md b/guide/spanish/certifications/front-end-libraries/redux/get-state-from-the-redux-store/index.md index 9a34c5917f..22d85954e0 100644 --- a/guide/spanish/certifications/front-end-libraries/redux/get-state-from-the-redux-store/index.md +++ b/guide/spanish/certifications/front-end-libraries/redux/get-state-from-the-redux-store/index.md @@ -6,7 +6,7 @@ localeTitle: Obtener el estado de la tienda redux Recupere datos de la tienda utilizando el método `getState()` . -```react.js +```jsx let currentState = store.getState(); ``` \ No newline at end of file diff --git a/guide/spanish/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-a-literal-string-with-different-possibilities/index.md b/guide/spanish/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-a-literal-string-with-different-possibilities/index.md index 64f634396e..7e396e7a88 100644 --- a/guide/spanish/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-a-literal-string-with-different-possibilities/index.md +++ b/guide/spanish/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-a-literal-string-with-different-possibilities/index.md @@ -14,7 +14,7 @@ Dentro de la cadena literal, coloque los nombres de las mascotas, cada uno separ ## Solución: -```javascriot +```js let petString = "James has a pet cat."; let petRegex = /dog|cat|bird|fish/; let result = petRegex.test(petString); diff --git a/guide/spanish/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-single-characters-not-specified/index.md b/guide/spanish/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-single-characters-not-specified/index.md index 92cb8aa99f..9627128a51 100644 --- a/guide/spanish/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-single-characters-not-specified/index.md +++ b/guide/spanish/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-single-characters-not-specified/index.md @@ -24,7 +24,7 @@ Si es así, entonces vuelva a verificar que está agregando las banderas apropia Asegúrese de verificar si su rango de números es correcto: el desafío nos pide que neguemos todos los números del 0 al 99. Esto se puede hacer usando la carátula de negación colocada inmediatamente después del primer soporte de apertura de su expresión regular. -```javacsript +```js let numbersRegExp = /[^0-99]/ig; ``` diff --git a/guide/spanish/computer-science/data-structures/stacks/index.md b/guide/spanish/computer-science/data-structures/stacks/index.md index be263c29ba..137a7ab24b 100644 --- a/guide/spanish/computer-science/data-structures/stacks/index.md +++ b/guide/spanish/computer-science/data-structures/stacks/index.md @@ -17,7 +17,7 @@ Algunas operaciones básicas de la pila son: La implementación de una pila es posible utilizando matrices o listas vinculadas. La siguiente es una implementación de matriz simple de la estructura de datos de pila con sus operaciones más comunes. -```C++ +```cpp //Stack implementation using array in C++ //You can also include and then use the C++ STL Library stack class. diff --git a/guide/spanish/containers/docker/creating-a-new-container/index.md b/guide/spanish/containers/docker/creating-a-new-container/index.md index 88a56b6bf4..ed2f3a2aa5 100644 --- a/guide/spanish/containers/docker/creating-a-new-container/index.md +++ b/guide/spanish/containers/docker/creating-a-new-container/index.md @@ -12,7 +12,7 @@ docker create [OPTIONS] IMAGE [COMMAND] [ARG...] Crea y comienza un contenedor. -```sh +```shell $ docker create -t -i fedora bash ``` \ No newline at end of file diff --git a/guide/spanish/cplusplus/input-and-output/index.md b/guide/spanish/cplusplus/input-and-output/index.md index 632ca2146d..d8d3471499 100644 --- a/guide/spanish/cplusplus/input-and-output/index.md +++ b/guide/spanish/cplusplus/input-and-output/index.md @@ -10,7 +10,7 @@ Para imprimir cosas en la consola, o leerlas, utiliza `cout` y `cin` , que se de El programa "Hello World" usa `cout` para imprimir "Hello World!" a la consola: -```C++ +```cpp #include using namespace std; @@ -30,24 +30,24 @@ Las primeras dos líneas en la parte superior son necesarias para que uses `cout Casi todo se puede poner en una secuencia: cadenas, números, variables, expresiones, etc. Aquí se muestran algunos ejemplos de inserciones de secuencias válidas: -```C++ +```cpp // Notice we can use the number 42 and not the string "42". cout << "The meaning of life is " << 42 << endl;` // Output: The meaning of life is 42 ``` -```C++ +```cpp string name = "Tim"; cout << "Except for you, " << name << endl;`// Output: Except for you, Tim ``` -```C++ +```cpp string name = "Tim"; cout << name; cout << " is a great guy!" << endl;` // Output: Tim is a great guy! ``` -```C++ +```cpp int a = 3; cout << a*2 + 18/a << endl;`// Output: 12 ``` @@ -56,7 +56,7 @@ int a = 3; C ++ siempre _te_ pone en control, y solo hace exactamente lo que le dices que haga. Esto a veces puede ser sorprendente, como en el siguiente ejemplo: -```C++ +```cpp string name = "Sarah"; cout << "Good morning" << name << "how are you today? << endl; ``` @@ -65,7 +65,7 @@ Podría esperar que se imprima "Buenos días, Sarah, ¿cómo estás hoy?", Pero Los saltos de línea no ocurren por sí mismos, tampoco. Podría pensar que esto imprimiría una receta en cuatro líneas: -```C++ +```cpp cout << "To make bread, you need:"; cout << "* One egg"; cout << "* One water"; @@ -76,7 +76,7 @@ pero la salida es en realidad todo en una línea: "Para hacer pan, necesitas: \* Podría arreglar esto agregando `endl` s después de cada línea, porque como se `endl` anteriormente, `endl` inserta un carácter de nueva línea en la secuencia de salida. Sin embargo, también obliga a vaciar el búfer, lo que nos hace perder un poco de rendimiento, ya que podríamos haber impreso todas las líneas de una sola vez. Por lo tanto, lo mejor sería agregar caracteres de nueva línea al final de las líneas, y solo usar `endl` al final: -```C++ +```cpp cout << "To make bread, you need:\n"; cout << "* One egg\n"; cout << "* One water\n"; @@ -89,7 +89,7 @@ Si solo imprime una receta pequeña, el tiempo que guarda es minúsculo y no val Para leer desde la consola, utiliza el _flujo de entrada_ `cin` de la misma manera que lo haría con `cout` , pero en lugar de poner las cosas en `cin` , las "saca". El siguiente programa lee dos números del usuario y los suma: -```C++ +```cpp #include using namespace std; @@ -112,7 +112,7 @@ Vale la pena señalar que `cin` detendrá todo el programa para esperar a que el El operador de extracción `<<` se puede encadenar. Este es el mismo programa que la última vez, pero escrito de una manera más concisa: -```C++ +```cpp #include using namespace std; diff --git a/guide/spanish/cplusplus/map/index.md b/guide/spanish/cplusplus/map/index.md index ac3d8f3897..e2a265eb47 100644 --- a/guide/spanish/cplusplus/map/index.md +++ b/guide/spanish/cplusplus/map/index.md @@ -16,7 +16,7 @@ localeTitle: Mapa Aquí hay un ejemplo: -```c++ +```cpp #include #include @@ -56,7 +56,7 @@ a => 10 Insertando datos con la función miembro insertada. -```c++ +```cpp myMap.insert(make_pair("earth", 1)); myMap.insert(make_pair("moon", 2)); ``` @@ -69,7 +69,7 @@ También podemos insertar datos en std :: map utilizando el operador \[\], es de Para acceder a los elementos del mapa, debe crear un iterador para él. Aquí hay un ejemplo como se dijo antes. -```c++ +```cpp map::iterator it; for(it=first.begin(); it!=first.end(); ++it){ cout << it->first << " => " << it->second << '\n'; diff --git a/guide/spanish/cplusplus/terms-to-know-for-beginners/index.md b/guide/spanish/cplusplus/terms-to-know-for-beginners/index.md index 300c4b3a27..2593d44b18 100644 --- a/guide/spanish/cplusplus/terms-to-know-for-beginners/index.md +++ b/guide/spanish/cplusplus/terms-to-know-for-beginners/index.md @@ -1,7 +1,8 @@ ---- -title: IDE and Printing different text -localeTitle: IDE y la impresión de diferentes textos ---- # Introducción a un IDE e impresión de diferentes textos: +--- +title: IDE and Printing different text +localeTitle: IDE y la impresión de diferentes textos +--- +# Introducción a un IDE e impresión de diferentes textos: * En el último artículo, algunos enlaces de descarga de software requeridos para la programación. Software como este es conocido como un IDE. **IDE significa Ambiente de Desarrollo Integrado** @@ -33,8 +34,7 @@ Un programa de muestra: ``` El código anterior devuelve un error porque en la línea 2, hemos usado dos puntos (:) en lugar de un punto y coma (;) Entonces, vamos a depurar el error: - -```C++ +```cpp #include using namespace std ; int main() @@ -139,4 +139,4 @@ Esto se evalúa como falso `cpp (7!=5);` Esto se evalúa como verdadero -[Un resumen de todas las declaraciones impresas utilizadas en este artículo. ¡Siéntase libre de modificar el código! :)](https://repl.it/L4ox) \ No newline at end of file +[Un resumen de todas las declaraciones impresas utilizadas en este artículo. ¡Siéntase libre de modificar el código! :)](https://repl.it/L4ox) diff --git a/guide/spanish/cplusplus/while-loop/index.md b/guide/spanish/cplusplus/while-loop/index.md index 82686171bb..bf702da8b2 100644 --- a/guide/spanish/cplusplus/while-loop/index.md +++ b/guide/spanish/cplusplus/while-loop/index.md @@ -10,7 +10,7 @@ Un punto clave del bucle while es que tal vez el bucle no se ejecute nunca. Cuan Ejemplo: -```C++ +```cpp #include using namespace std; diff --git a/guide/spanish/csharp/for/index.md b/guide/spanish/csharp/for/index.md index 579adcdf8e..609ad480d6 100644 --- a/guide/spanish/csharp/for/index.md +++ b/guide/spanish/csharp/for/index.md @@ -8,7 +8,7 @@ El bucle `for` ejecuta un bloque de código hasta que una condición especificad ## Sintaxis -```C# +```csharp for ((Initial variable); (condition); (step)) { (code) @@ -25,7 +25,7 @@ El C # para el bucle consta de tres expresiones y algunos códigos. ## Ejemplo -```C# +```csharp int[] array = { 1, 2, 3, 4, 5 }; for (int i = 0; i < array.Length; i++) { diff --git a/guide/spanish/csharp/null-coalescing-operator/index.md b/guide/spanish/csharp/null-coalescing-operator/index.md index 10578989f5..9e6bd68fcb 100644 --- a/guide/spanish/csharp/null-coalescing-operator/index.md +++ b/guide/spanish/csharp/null-coalescing-operator/index.md @@ -10,7 +10,7 @@ El operador de unión nula en C # se usa para ayudar a asignar una variable a ot Como el `name` es `null` , a `clientName` se le asignará el valor "John Doe". -```cs +```csharp string name = null; string clientName = name ?? "John Doe"; @@ -18,7 +18,7 @@ string name = null; Console.WriteLine(clientName); ``` -```cs +```csharp > John Doe ``` @@ -26,7 +26,7 @@ string name = null; Dado que el `name` no es `null` , a `clientName` se le asignará el valor de `name` , que es "Jane Smith". -```cs +```csharp string name = "Jane Smith"; string clientName = name ?? "John Doe"; @@ -34,7 +34,7 @@ string name = "Jane Smith"; Console.WriteLine(clientName); ``` -```cs +```csharp > Jane Smith ``` @@ -42,7 +42,7 @@ string name = "Jane Smith"; Podría usar una instrucción `if...else` para probar la presencia de `null` y asignar un valor diferente. -```cs +```csharp string clientName; if (name != null) @@ -53,7 +53,7 @@ string clientName; Sin embargo, esto puede simplificarse enormemente utilizando el operador de fusión nula. -```cs +```csharp string clientName = name ?? "John Doe"; ``` @@ -61,13 +61,13 @@ string clientName = name ?? "John Doe"; También es posible utilizar el operador condicional para probar la presencia de `null` y asignar un valor diferente. -```cs +```csharp string clientName = name != null ? name : "John Doe"; ``` De nuevo, esto se puede simplificar utilizando el operador de unión nula. -```cs +```csharp string clientName = name ?? "John Doe"; ``` diff --git a/guide/spanish/csharp/xaml/index.md b/guide/spanish/csharp/xaml/index.md index bcb5baa1d6..334f24fe6c 100644 --- a/guide/spanish/csharp/xaml/index.md +++ b/guide/spanish/csharp/xaml/index.md @@ -26,7 +26,7 @@ Creando un TextBlock con varias propiedades. Los TextBlocks se emplean generalme El siguiente ejemplo muestra una etiqueta con "Hello World!" como su contenido en un contenedor de nivel superior llamado UserControl. -```XAML +```xml diff --git a/guide/spanish/css/breakpoints/index.md b/guide/spanish/css/breakpoints/index.md index a089a5ba02..91407b16ca 100644 --- a/guide/spanish/css/breakpoints/index.md +++ b/guide/spanish/css/breakpoints/index.md @@ -174,7 +174,7 @@ Los puntos de interrupción que se basan en el contenido en lugar de en el dispo También puede establecer un ancho mínimo y máximo, que le permita experimentar con diferentes rangos. Este dispara aproximadamente entre teléfonos inteligentes y tamaños de monitores y de escritorio más grandes -```code +```css @media only screen and (min-width: 700px) and (max-width: 1500px) { something { something: something; diff --git a/guide/spanish/go/installing-go/arch-linux/index.md b/guide/spanish/go/installing-go/arch-linux/index.md index ae688eea81..6860314908 100644 --- a/guide/spanish/go/installing-go/arch-linux/index.md +++ b/guide/spanish/go/installing-go/arch-linux/index.md @@ -6,7 +6,7 @@ localeTitle: Instalar Go en Arch Linux usando pacman Usar Arch Linux Package Manager (pacman) es la forma más fácil de instalar Go. Basado en la filosofía de Arch Linux de proporcionar nuevas versiones de software muy rápido, obtendrá una versión muy actual de go. Antes de que pueda instalar el paquete go, debe actualizar el sistema. -```sh +```shell $ sudo pacman -Syu $ sudo pacman -S go ``` @@ -15,7 +15,7 @@ $ sudo pacman -Syu Para comprobar si Go se instaló correctamente, use: -```sh +```shell $ go version > go version go2.11.1 linux/amd64 ``` diff --git a/guide/spanish/go/installing-go/mac-package-installer/index.md b/guide/spanish/go/installing-go/mac-package-installer/index.md index da597dc386..d1336baf81 100644 --- a/guide/spanish/go/installing-go/mac-package-installer/index.md +++ b/guide/spanish/go/installing-go/mac-package-installer/index.md @@ -12,7 +12,7 @@ Desde la [página de descarga de golang](https://golang.org/dl/) , obtenga el in Para verificar si Go se instaló correctamente, abra su terminal y use: -```sh +```shell $ go version ``` diff --git a/guide/spanish/go/installing-go/mac-tarball/index.md b/guide/spanish/go/installing-go/mac-tarball/index.md index 6c2362d279..032496f1ca 100644 --- a/guide/spanish/go/installing-go/mac-tarball/index.md +++ b/guide/spanish/go/installing-go/mac-tarball/index.md @@ -25,7 +25,7 @@ $ curl -O https://storage.googleapis.com/golang/go1.9.1.darwin-amd64.tar.gz Para comprobar si Go se instaló correctamente, use: -```sh +```shell $ go version ``` diff --git a/guide/spanish/go/installing-go/ubuntu-apt-get/index.md b/guide/spanish/go/installing-go/ubuntu-apt-get/index.md index 090cb06e75..3015805fb5 100644 --- a/guide/spanish/go/installing-go/ubuntu-apt-get/index.md +++ b/guide/spanish/go/installing-go/ubuntu-apt-get/index.md @@ -8,7 +8,7 @@ Usar el Administrador de paquetes fuente de Ubuntu (apt-get) es la forma más f > A partir de este escrito, la versión de Ubuntu Xenial de go es 1.6.1, mientras que la última La versión estable es 1.9.1 -```sh +```shell $ sudo apt-get update $ sudo apt-get install golang-go ``` @@ -17,7 +17,7 @@ $ sudo apt-get update Para comprobar si Go se instaló correctamente, use: -```sh +```shell $ go version > go version go1.9.1 linux/amd64 ``` diff --git a/guide/spanish/go/installing-go/ubuntu-tarball/index.md b/guide/spanish/go/installing-go/ubuntu-tarball/index.md index c6ef991bd3..09ad8c7059 100644 --- a/guide/spanish/go/installing-go/ubuntu-tarball/index.md +++ b/guide/spanish/go/installing-go/ubuntu-tarball/index.md @@ -10,7 +10,7 @@ localeTitle: Instalar Go en Ubuntu usando un tarball Antes de continuar, asegúrese de saber si su sistema es de 32 o 64 bits. Si no lo sabes, ejecuta el siguiente comando para averiguarlo: -```sh +```shell $ lscpu | grep Architecture ``` @@ -52,7 +52,7 @@ $ wget https://storage.googleapis.com/golang/go1.9.1.linux-386.tar.gz Para comprobar si Go se instaló correctamente, use: -```sh +```shell $ go version > go version go1.9.1 linux/amd64 ``` diff --git a/guide/spanish/linux/getting-started/index.md b/guide/spanish/linux/getting-started/index.md index 4ccc34d4e3..9ae845e59f 100644 --- a/guide/spanish/linux/getting-started/index.md +++ b/guide/spanish/linux/getting-started/index.md @@ -22,7 +22,7 @@ En Debian / Ubuntu y sus derivados, el acceso directo para abrir cli (Interfaz d cd (Cambiar directorio): el comando cd es uno de los comandos que más utilizará en la línea de comandos en linux. Te permite cambiar tu directorio de trabajo. Lo usa para moverse dentro de la jerarquía de su sistema de archivos. -```unix +```shell cd ``` @@ -30,7 +30,7 @@ El uso del comando cd solo cambiará el directorio actual al directorio de inici ls (Lista): este comando muestra el contenido en el directorio actual. También se puede utilizar para listar información de archivos. -```unix +```shell ls ``` diff --git a/guide/spanish/linux/how-to-use-sftp-to-securely-transfer-files-with-a-remote-server/index.md b/guide/spanish/linux/how-to-use-sftp-to-securely-transfer-files-with-a-remote-server/index.md index 056abfa7aa..049a847c79 100644 --- a/guide/spanish/linux/how-to-use-sftp-to-securely-transfer-files-with-a-remote-server/index.md +++ b/guide/spanish/linux/how-to-use-sftp-to-securely-transfer-files-with-a-remote-server/index.md @@ -10,7 +10,7 @@ Este artículo es un tutorial rápido sobre cómo utilizar el Protocolo seguro d Si aún no lo has hecho, prueba que puedes SSH en el servidor. SFTP usa el protocolo Secure Shell (SSH), por lo que si no puede SSH, probablemente tampoco podrá SFTP. -```unix +```shell ssh your_username@hostname_or_ip_address ``` @@ -18,13 +18,13 @@ ssh your_username@hostname_or_ip_address Esto usa la misma sintaxis que SSH y abre una sesión en la que puede transferir archivos. -```unix +```shell sftp your_username@hostname_or_ip_address ``` Para listar comandos útiles: -```unix +```shell help ``` @@ -32,19 +32,19 @@ help Para descargar un archivo: -```unix +```shell get ``` Para descargar una carpeta y su contenido, use la bandera "-r" (también funciona para cargar): -```unix +```shell get -r ``` Para subir un archivo: -```unix +```shell put ``` @@ -52,13 +52,13 @@ put Para cambiar la carpeta local: -```unix +```shell lcd ``` Para cambiar la carpeta remota: -```unix +```shell cd ``` \ No newline at end of file diff --git a/guide/spanish/linux/setting-up-yum-repositories-in-redhat-linux/index.md b/guide/spanish/linux/setting-up-yum-repositories-in-redhat-linux/index.md index 70de098c14..4363c192b6 100644 --- a/guide/spanish/linux/setting-up-yum-repositories-in-redhat-linux/index.md +++ b/guide/spanish/linux/setting-up-yum-repositories-in-redhat-linux/index.md @@ -10,7 +10,7 @@ El archivo del paquete RPM es un archivo de Red Hat Package Manager y permite la Paso 1: Compruebe si hay repositorios existentes o no. -```sh +```shell #yum repolist ``` @@ -18,19 +18,19 @@ Encontrarás que no hay repositorios. Paso 2: Cambiar Directorio a -```sh +```shell #cd /etc/yum.repos.d ``` Paso 3: Crear nuevo archivo -```sh +```shell #vim myrepo.repo ``` Paso 4: Escribe las siguientes líneas en el archivo -```sh +```shell [file-name] name=filename baseurl="location of yum repositories" @@ -41,7 +41,7 @@ Paso 5: guardar y salir Paso 6: Repita el paso 1 -```sh +```shell You Will find repositories ``` \ No newline at end of file diff --git a/guide/spanish/php/loops/for-loop/index.md b/guide/spanish/php/loops/for-loop/index.md index 4291f666d1..e1fc861924 100644 --- a/guide/spanish/php/loops/for-loop/index.md +++ b/guide/spanish/php/loops/for-loop/index.md @@ -52,7 +52,7 @@ Cuando se indexa una matriz muchas veces, es fácil superar los límites de la m Esto dará como resultado: -```txt +```shell int(1) int(2) int(3) NULL ``` diff --git a/guide/spanish/python/python-coding-standards/index.md b/guide/spanish/python/python-coding-standards/index.md index 7ea8457918..61556a1273 100644 --- a/guide/spanish/python/python-coding-standards/index.md +++ b/guide/spanish/python/python-coding-standards/index.md @@ -22,7 +22,7 @@ Nos encanta pegarnos a las convenciones. La comunidad de usuarios de Python ha c Así es como verificas si tu código de Python cumple con los estándares. -```console +```shell :~$ pip install pep8 :~$ pep8 --first myCode.py ``` diff --git a/guide/spanish/react/what-are-react-props/index.md b/guide/spanish/react/what-are-react-props/index.md index 7e498c470f..1f0e517e46 100644 --- a/guide/spanish/react/what-are-react-props/index.md +++ b/guide/spanish/react/what-are-react-props/index.md @@ -12,7 +12,7 @@ A partir de la versión 15.5 de React, esta característica se movió a un paque Para usarlo, se requiere que se agregue al proyecto como una dependencia emitiendo el siguiente comando en una consola. -```sh +```shell npm install --save prop-types ``` diff --git a/guide/spanish/redux/tutorial/index.md b/guide/spanish/redux/tutorial/index.md index dbb80d837a..cb1a637eb5 100644 --- a/guide/spanish/redux/tutorial/index.md +++ b/guide/spanish/redux/tutorial/index.md @@ -1,7 +1,8 @@ ---- -title: React Redux Basic Setup -localeTitle: React Redux Basic Setup ---- ## React Redux Basic Setup +--- +title: React Redux Basic Setup +localeTitle: React Redux Basic Setup +--- +## React Redux Basic Setup En esta guía se presentará al lector cómo configurar una aplicación React y Redux simple. @@ -12,8 +13,7 @@ Se basa en el principio de que una aplicación [Node.js](https://nodejs.org/) ya Suponiendo que todo está configurado y funcionando correctamente, hay algunos paquetes que deben agregarse para que Redux funcione con React. Abra un terminal dentro de la carpeta del proyecto que se creó y ejecute el siguiente comando - -```sh +```shell npm install --save react react react-dom react-redux react-router redux ``` @@ -277,4 +277,4 @@ Como esta guía no es más que una introducción a cómo reaccionar y redux trab [Redux api](http://redux.js.org/docs/api/) -[Ejemplos de Redux](https://github.com/reactjs/redux/tree/master/examples) \ No newline at end of file +[Ejemplos de Redux](https://github.com/reactjs/redux/tree/master/examples) diff --git a/guide/spanish/software-engineering/design-patterns/singleton/index.md b/guide/spanish/software-engineering/design-patterns/singleton/index.md index 6603e174e3..b24cfc3435 100644 --- a/guide/spanish/software-engineering/design-patterns/singleton/index.md +++ b/guide/spanish/software-engineering/design-patterns/singleton/index.md @@ -126,7 +126,7 @@ obj_0 = MyClass() ## Singleton en iOS -```Swift4 +```swift class Singleton { static let sharedInstance = Singleton()